~ubuntu-branches/ubuntu/jaunty/mesa/jaunty

« back to all changes in this revision

Viewing changes to src/mesa/shader/arbprogparse.c

  • Committer: Bazaar Package Importer
  • Author(s): Timo Aaltonen
  • Date: 2009-01-23 10:20:24 UTC
  • mfrom: (1.2.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20090123102024-1f3kmb3aea7wzk67
Tags: 7.3~rc3-1ubuntu1
* Merge with Debian experimental.
* Drop 102_dont_vblank.patch, since the new drm code in the kernel
  fixes the bugs that it worked around.
* Bump the build-dependency of libdrm to 2.4.4. It's the first version
  with necessary changes to build this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
963
963
 
964
964
 
965
965
/**
 
966
 * Validate the index of a texture coordinate
 
967
 *
966
968
 * \param coord The texture unit index
967
969
 * \return 0 on sucess, 1 on error
968
970
 */
972
974
{
973
975
   GLint i = parse_integer (inst, Program);
974
976
 
975
 
   if ((i < 0) || (i >= (int)ctx->Const.MaxTextureUnits)) {
976
 
      program_error(ctx, Program->Position, "Invalid texture unit index");
977
 
      return 1;
978
 
   }
979
 
 
980
 
   *coord = (GLuint) i;
981
 
   return 0;
982
 
}
 
977
   if ((i < 0) || (i >= (int)ctx->Const.MaxTextureCoordUnits)) {
 
978
      program_error(ctx, Program->Position, "Invalid texture coordinate index");
 
979
      return 1;
 
980
   }
 
981
 
 
982
   *coord = (GLuint) i;
 
983
   return 0;
 
984
}
 
985
 
 
986
 
 
987
/**
 
988
 * Validate the index of a texture image unit
 
989
 *
 
990
 * \param coord The texture unit index
 
991
 * \return 0 on sucess, 1 on error
 
992
 */
 
993
static GLuint
 
994
parse_teximage_num (GLcontext * ctx, const GLubyte ** inst,
 
995
                    struct arb_program *Program, GLuint * coord)
 
996
{
 
997
   GLint i = parse_integer (inst, Program);
 
998
 
 
999
   if ((i < 0) || (i >= (int)ctx->Const.MaxTextureImageUnits)) {
 
1000
      program_error(ctx, Program->Position, "Invalid texture image index");
 
1001
      return 1;
 
1002
   }
 
1003
 
 
1004
   *coord = (GLuint) i;
 
1005
   return 0;
 
1006
}
 
1007
 
983
1008
 
984
1009
/**
985
1010
 * \param coord The weight index
3003
3028
            return 1;
3004
3029
 
3005
3030
         /* texImageUnit */
3006
 
         if (parse_texcoord_num (ctx, inst, Program, &texcoord))
 
3031
         if (parse_teximage_num (ctx, inst, Program, &texcoord))
3007
3032
            return 1;
3008
3033
         fp->TexSrcUnit = texcoord;
3009
3034