mesa: move max texture image unit constants to gl_program_constants
authorMarek Olšák <maraeo@gmail.com>
Thu, 2 May 2013 00:30:44 +0000 (02:30 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sat, 11 May 2013 21:45:01 +0000 (23:45 +0200)
Const.MaxTextureImageUnits -> Const.FragmentProgram.MaxTextureImageUnits
Const.MaxVertexTextureImageUnits -> Const.VertexProgram.MaxTextureImageUnits
etc.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
27 files changed:
src/glsl/glsl_parser_extras.cpp
src/glsl/linker.cpp
src/glsl/standalone_scaffolding.cpp
src/mesa/drivers/dri/i915/i830_context.c
src/mesa/drivers/dri/i915/i915_context.c
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/nouveau/nv04_context.c
src/mesa/drivers/dri/nouveau/nv10_context.c
src/mesa/drivers/dri/nouveau/nv20_context.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r200/r200_state.c
src/mesa/drivers/dri/radeon/radeon_context.c
src/mesa/drivers/dri/radeon/radeon_state.c
src/mesa/main/context.c
src/mesa/main/get_hash_params.py
src/mesa/main/mtypes.h
src/mesa/main/texenv.c
src/mesa/main/version.c
src/mesa/program/program_parse.y
src/mesa/state_tracker/st_atom_sampler.c
src/mesa/state_tracker/st_atom_texture.c
src/mesa/state_tracker/st_extensions.c
src/mesa/state_tracker/st_glsl_to_tgsi.cpp
src/mesa/state_tracker/st_mesa_to_tgsi.c
src/mesa/swrast/s_context.c
src/mesa/swrast/s_texcombine.c
src/mesa/tnl/t_vb_program.c

index e4636f8730993c2d26fb7b96c5a444cd1ea2df82..cf6c8c621516399cb8df0db14f82dd52e0eccd10 100644 (file)
@@ -93,9 +93,9 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
    this->Const.MaxVertexAttribs = ctx->Const.VertexProgram.MaxAttribs;
    this->Const.MaxVertexUniformComponents = ctx->Const.VertexProgram.MaxUniformComponents;
    this->Const.MaxVaryingFloats = ctx->Const.MaxVarying * 4;
-   this->Const.MaxVertexTextureImageUnits = ctx->Const.MaxVertexTextureImageUnits;
+   this->Const.MaxVertexTextureImageUnits = ctx->Const.VertexProgram.MaxTextureImageUnits;
    this->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits;
-   this->Const.MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits;
+   this->Const.MaxTextureImageUnits = ctx->Const.FragmentProgram.MaxTextureImageUnits;
    this->Const.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents;
    this->Const.MinProgramTexelOffset = ctx->Const.MinProgramTexelOffset;
    this->Const.MaxProgramTexelOffset = ctx->Const.MaxProgramTexelOffset;
index 2b30d2b652d044839eaa86895a458708e3a4bb22..3ef5940f892f2baf47b7ac387037f79212a40d59 100644 (file)
@@ -1512,15 +1512,15 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
    };
 
    const unsigned max_samplers[MESA_SHADER_TYPES] = {
-      ctx->Const.MaxVertexTextureImageUnits,
-      ctx->Const.MaxTextureImageUnits,
-      ctx->Const.MaxGeometryTextureImageUnits
+      ctx->Const.VertexProgram.MaxTextureImageUnits,
+      ctx->Const.FragmentProgram.MaxTextureImageUnits,
+      ctx->Const.GeometryProgram.MaxTextureImageUnits
    };
 
    const unsigned max_uniform_components[MESA_SHADER_TYPES] = {
       ctx->Const.VertexProgram.MaxUniformComponents,
       ctx->Const.FragmentProgram.MaxUniformComponents,
-      0          /* FINISHME: Geometry shaders. */
+      ctx->Const.GeometryProgram.MaxUniformComponents
    };
 
    const unsigned max_uniform_blocks[MESA_SHADER_TYPES] = {
index 3c8f70f9e29f25d1a46290f6c4f5d1bc136749a6..8653c4e1eef79fbf0b5c931c5ceaaeb81556f99c 100644 (file)
@@ -117,9 +117,9 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
 
    ctx->Const.VertexProgram.MaxUniformComponents = 512;
    ctx->Const.MaxVarying = 8; /* == gl_MaxVaryingFloats / 4 */
-   ctx->Const.MaxVertexTextureImageUnits = 0;
+   ctx->Const.VertexProgram.MaxTextureImageUnits = 0;
    ctx->Const.MaxCombinedTextureImageUnits = 2;
-   ctx->Const.MaxTextureImageUnits = 2;
+   ctx->Const.FragmentProgram.MaxTextureImageUnits = 2;
    ctx->Const.FragmentProgram.MaxUniformComponents = 64;
 
    ctx->Const.MaxDrawBuffers = 1;
index 072f8e02aab0702927e9b828aa2d394a75db835b..b7553d87fdc782859e150941822297f04e6660bf 100644 (file)
@@ -96,7 +96,7 @@ i830CreateContext(int api,
       FALLBACK(intel, INTEL_FALLBACK_USER, 1);
 
    intel->ctx.Const.MaxTextureUnits = I830_TEX_UNITS;
-   intel->ctx.Const.MaxTextureImageUnits = I830_TEX_UNITS;
+   intel->ctx.Const.FragmentProgram.MaxTextureImageUnits = I830_TEX_UNITS;
    intel->ctx.Const.MaxTextureCoordUnits = I830_TEX_UNITS;
 
    /* Advertise the full hardware capabilities.  The new memory
index e5635372a098b9e898102ce89de9edf1e452195a..d3864465b262e9aad3bf00d5002db97a54f2e3c1 100644 (file)
@@ -191,12 +191,12 @@ i915CreateContext(int api,
       FALLBACK(intel, INTEL_FALLBACK_USER, 1);
 
    ctx->Const.MaxTextureUnits = I915_TEX_UNITS;
-   ctx->Const.MaxTextureImageUnits = I915_TEX_UNITS;
+   ctx->Const.FragmentProgram.MaxTextureImageUnits = I915_TEX_UNITS;
    ctx->Const.MaxTextureCoordUnits = I915_TEX_UNITS;
    ctx->Const.MaxVarying = I915_TEX_UNITS;
    ctx->Const.MaxCombinedTextureImageUnits =
-      ctx->Const.MaxVertexTextureImageUnits +
-      ctx->Const.MaxTextureImageUnits;
+      ctx->Const.VertexProgram.MaxTextureImageUnits +
+      ctx->Const.FragmentProgram.MaxTextureImageUnits;
 
    /* Advertise the full hardware capabilities.  The new memory
     * manager should cope much better with overload situations:
index 5e6e97d4325b8326b76c2122eb7954d3b034ca82..a676415dde077be0e7a742fb134f31cee6172b39 100644 (file)
@@ -155,14 +155,14 @@ brwCreateContext(int api,
 
    ctx->Const.MaxDualSourceDrawBuffers = 1;
    ctx->Const.MaxDrawBuffers = BRW_MAX_DRAW_BUFFERS;
-   ctx->Const.MaxTextureImageUnits = BRW_MAX_TEX_UNIT;
+   ctx->Const.FragmentProgram.MaxTextureImageUnits = BRW_MAX_TEX_UNIT;
    ctx->Const.MaxTextureCoordUnits = 8; /* Mesa limit */
    ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits,
-                                     ctx->Const.MaxTextureImageUnits);
-   ctx->Const.MaxVertexTextureImageUnits = BRW_MAX_TEX_UNIT;
+                                     ctx->Const.FragmentProgram.MaxTextureImageUnits);
+   ctx->Const.VertexProgram.MaxTextureImageUnits = BRW_MAX_TEX_UNIT;
    ctx->Const.MaxCombinedTextureImageUnits =
-      ctx->Const.MaxVertexTextureImageUnits +
-      ctx->Const.MaxTextureImageUnits;
+      ctx->Const.VertexProgram.MaxTextureImageUnits +
+      ctx->Const.FragmentProgram.MaxTextureImageUnits;
 
    ctx->Const.MaxTextureLevels = 14; /* 8192 */
    if (ctx->Const.MaxTextureLevels > MAX_TEXTURE_LEVELS)
index 829aa87c47395523e5d94104d71be0023edb268d..c198c03f095a46fcb8abf514c220e44c1fe3002e 100644 (file)
@@ -159,7 +159,7 @@ nv04_context_create(struct nouveau_screen *screen, const struct gl_config *visua
        /* GL constants. */
        ctx->Const.MaxTextureLevels = 11;
        ctx->Const.MaxTextureCoordUnits = NV04_TEXTURE_UNITS;
-       ctx->Const.MaxTextureImageUnits = NV04_TEXTURE_UNITS;
+       ctx->Const.FragmentProgram.MaxTextureImageUnits = NV04_TEXTURE_UNITS;
        ctx->Const.MaxTextureUnits = NV04_TEXTURE_UNITS;
        ctx->Const.MaxTextureMaxAnisotropy = 2;
        ctx->Const.MaxTextureLodBias = 15;
index 4ffc4ef153fccc28405d024a0a1846e2bf47aefa..1918f12238d2f98be665a816478d8b7479b0890c 100644 (file)
@@ -457,7 +457,7 @@ nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visua
        /* GL constants. */
        ctx->Const.MaxTextureLevels = 12;
        ctx->Const.MaxTextureCoordUnits = NV10_TEXTURE_UNITS;
-       ctx->Const.MaxTextureImageUnits = NV10_TEXTURE_UNITS;
+       ctx->Const.FragmentProgram.MaxTextureImageUnits = NV10_TEXTURE_UNITS;
        ctx->Const.MaxTextureUnits = NV10_TEXTURE_UNITS;
        ctx->Const.MaxTextureMaxAnisotropy = 2;
        ctx->Const.MaxTextureLodBias = 15;
index 68e90d2c67f95cd918f81b5a5ca91568881dc2e1..1d77132db11554064aa15460e1d230311e799ff2 100644 (file)
@@ -467,7 +467,7 @@ nv20_context_create(struct nouveau_screen *screen, const struct gl_config *visua
 
        /* GL constants. */
        ctx->Const.MaxTextureCoordUnits = NV20_TEXTURE_UNITS;
-       ctx->Const.MaxTextureImageUnits = NV20_TEXTURE_UNITS;
+       ctx->Const.FragmentProgram.MaxTextureImageUnits = NV20_TEXTURE_UNITS;
        ctx->Const.MaxTextureUnits = NV20_TEXTURE_UNITS;
        ctx->Const.MaxTextureMaxAnisotropy = 8;
        ctx->Const.MaxTextureLodBias = 15;
index 4d62bc4af7e41b6d764ed7b5d400deea50358242..036ff7560adfbcd8a88d68dbdeb4dcb2460042f5 100644 (file)
@@ -306,7 +306,7 @@ GLboolean r200CreateContext( gl_api api,
     */
    ctx->Const.MaxTextureUnits = driQueryOptioni (&rmesa->radeon.optionCache,
                                                 "texture_units");
-   ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
+   ctx->Const.FragmentProgram.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
    ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
 
    ctx->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxTextureUnits;
index 6f79610f85b67acf0dcf220c985649639cf79c8c..f812a15c62a0b8345255c7690b3dba89e17d9b01 100644 (file)
@@ -2237,7 +2237,7 @@ static GLboolean r200ValidateBuffers(struct gl_context *ctx)
                                       0, RADEON_GEM_DOMAIN_VRAM);
    }
 
-   for (i = 0; i < ctx->Const.MaxTextureImageUnits; ++i) {
+   for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; ++i) {
       radeonTexObj *t;
 
       if (!ctx->Texture.Unit[i]._ReallyEnabled)
index e1b83a2d90f2d103c6c9950a578c0a4ea190baad..7dd9109cca785e44242d8348a159291f64b809f1 100644 (file)
@@ -269,7 +269,7 @@ r100CreateContext( gl_api api,
 
    ctx->Const.MaxTextureUnits = driQueryOptioni (&rmesa->radeon.optionCache,
                                                 "texture_units");
-   ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
+   ctx->Const.FragmentProgram.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
    ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
    ctx->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxTextureUnits;
 
index 2f30f64f2edc5ed00ee661cd424c0f35cfe49482..94fb69bc76880daf0b49ea66cf306a93efc9f2e8 100644 (file)
@@ -2013,7 +2013,7 @@ static GLboolean r100ValidateBuffers(struct gl_context *ctx)
                                       0, RADEON_GEM_DOMAIN_VRAM);
    }
 
-   for (i = 0; i < ctx->Const.MaxTextureImageUnits; ++i) {
+   for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; ++i) {
       radeonTexObj *t;
 
       if (!ctx->Texture.Unit[i]._ReallyEnabled)
index 2cc8f36c53b407c7a831a9095de9b9f57b31c1b0..e94509ad773b872d8bbb2be82e8647e9ba396b0e 100644 (file)
@@ -552,9 +552,9 @@ _mesa_init_constants(struct gl_context *ctx)
    ctx->Const.MaxTextureRectSize = MAX_TEXTURE_RECT_SIZE;
    ctx->Const.MaxArrayTextureLayers = MAX_ARRAY_TEXTURE_LAYERS;
    ctx->Const.MaxTextureCoordUnits = MAX_TEXTURE_COORD_UNITS;
-   ctx->Const.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
+   ctx->Const.FragmentProgram.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
    ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits,
-                                     ctx->Const.MaxTextureImageUnits);
+                                     ctx->Const.FragmentProgram.MaxTextureImageUnits);
    ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY;
    ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS;
    ctx->Const.MaxTextureBufferSize = 65536;
@@ -601,10 +601,10 @@ _mesa_init_constants(struct gl_context *ctx)
    ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS;
    ctx->Const.MaxRenderbufferSize = MAX_RENDERBUFFER_SIZE;
 
-   ctx->Const.MaxVertexTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
+   ctx->Const.VertexProgram.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
    ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
    ctx->Const.MaxVarying = 16; /* old limit not to break tnl and swrast */
-   ctx->Const.MaxGeometryTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
+   ctx->Const.GeometryProgram.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS;
    ctx->Const.MaxVertexVaryingComponents = MAX_VERTEX_VARYING_COMPONENTS;
    ctx->Const.MaxGeometryVaryingComponents = MAX_GEOMETRY_VARYING_COMPONENTS;
    ctx->Const.MaxGeometryOutputVertices = MAX_GEOMETRY_OUTPUT_VERTICES;
@@ -681,20 +681,20 @@ check_context_limits(struct gl_context *ctx)
    assert(ctx->Const.VertexProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
 
    /* Texture unit checks */
-   assert(ctx->Const.MaxTextureImageUnits > 0);
-   assert(ctx->Const.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS);
+   assert(ctx->Const.FragmentProgram.MaxTextureImageUnits > 0);
+   assert(ctx->Const.FragmentProgram.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS);
    assert(ctx->Const.MaxTextureCoordUnits > 0);
    assert(ctx->Const.MaxTextureCoordUnits <= MAX_TEXTURE_COORD_UNITS);
    assert(ctx->Const.MaxTextureUnits > 0);
    assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_IMAGE_UNITS);
    assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_COORD_UNITS);
-   assert(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.MaxTextureImageUnits,
+   assert(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.FragmentProgram.MaxTextureImageUnits,
                                              ctx->Const.MaxTextureCoordUnits));
    assert(ctx->Const.MaxCombinedTextureImageUnits > 0);
    assert(ctx->Const.MaxCombinedTextureImageUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
    assert(ctx->Const.MaxTextureCoordUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
    /* number of coord units cannot be greater than number of image units */
-   assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.MaxTextureImageUnits);
+   assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.FragmentProgram.MaxTextureImageUnits);
 
 
    /* Texture size checks */
index 2b97da6b5ee3f1f248b068ac84aceac2ba79dafc..596c86dc07396b37a5d1dc343d7b58944fd76244 100644 (file)
@@ -273,8 +273,8 @@ descriptor=[
 
 # GL_ARB_fragment_program
 # == GL_MAX_TEXTURE_IMAGE_UNITS_NV
-  [ "MAX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxTextureImageUnits), extra_ARB_fragment_program" ],
-  [ "MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxVertexTextureImageUnits), extra_ARB_vertex_shader" ],
+  [ "MAX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.FragmentProgram.MaxTextureImageUnits), extra_ARB_fragment_program" ],
+  [ "MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.VertexProgram.MaxTextureImageUnits), extra_ARB_vertex_shader" ],
   [ "MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxCombinedTextureImageUnits), extra_ARB_vertex_shader" ],
 
 # GL_ARB_shader_objects
@@ -637,7 +637,7 @@ descriptor=[
   [ "MAX_VERTEX_STREAMS", "CONTEXT_INT(Const.MaxVertexStreams), extra_ARB_transform_feedback3" ],
 
 # GL_ARB_geometry_shader4
-  [ "MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxGeometryTextureImageUnits), extra_ARB_geometry_shader4" ],
+  [ "MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.GeometryProgram.MaxTextureImageUnits), extra_ARB_geometry_shader4" ],
   [ "MAX_GEOMETRY_OUTPUT_VERTICES_ARB", "CONTEXT_INT(Const.MaxGeometryOutputVertices), extra_ARB_geometry_shader4" ],
   [ "MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxGeometryTotalOutputComponents), extra_ARB_geometry_shader4" ],
   [ "MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.GeometryProgram.MaxUniformComponents), extra_ARB_geometry_shader4" ],
index 3fb8618c62f371f5810f2373266f432585ae6024..6cd8b96b54fefb173078217c4384dafab9bd37d9 100644 (file)
@@ -2735,6 +2735,7 @@ struct gl_program_constants
    /* GL_ARB_uniform_buffer_object */
    GLuint MaxUniformBlocks;
    GLuint MaxCombinedUniformComponents;
+   GLuint MaxTextureImageUnits;
 };
 
 
@@ -2751,11 +2752,8 @@ struct gl_constants
    GLuint MaxArrayTextureLayers; /**< Max layers in array textures */
    GLuint MaxTextureRectSize;    /**< Max rectangle texture size, in pixes */
    GLuint MaxTextureCoordUnits;
-   GLuint MaxTextureImageUnits;
-   GLuint MaxVertexTextureImageUnits;
    GLuint MaxCombinedTextureImageUnits;
-   GLuint MaxGeometryTextureImageUnits;
-   GLuint MaxTextureUnits;           /**< = MIN(CoordUnits, ImageUnits) */
+   GLuint MaxTextureUnits;           /**< = MIN(CoordUnits, FragmentProgram.ImageUnits) */
    GLfloat MaxTextureMaxAnisotropy;  /**< GL_EXT_texture_filter_anisotropic */
    GLfloat MaxTextureLodBias;        /**< GL_EXT_texture_lod_bias */
    GLuint MaxTextureBufferSize;      /**< GL_ARB_texture_buffer_object */
index c2cf89ee489ea934bcd145146e47f63b3c3a1ced..84731dddab5d78b1bfddde0cbc69f885ea686a67 100644 (file)
@@ -880,7 +880,7 @@ _mesa_GetTexBumpParameterivATI( GLenum pname, GLint *param )
    }
    else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) {
       GLint count = 0;
-      for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+      for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) {
          if (ctx->Const.SupportedBumpUnits & (1 << i)) {
             count++;
          }
@@ -888,7 +888,7 @@ _mesa_GetTexBumpParameterivATI( GLenum pname, GLint *param )
       *param = count;
    }
    else if (pname == GL_BUMP_TEX_UNITS_ATI) {
-      for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+      for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) {
          if (ctx->Const.SupportedBumpUnits & (1 << i)) {
             *param++ = i + GL_TEXTURE0;
          }
@@ -929,7 +929,7 @@ _mesa_GetTexBumpParameterfvATI( GLenum pname, GLfloat *param )
    }
    else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) {
       GLint count = 0;
-      for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+      for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) {
          if (ctx->Const.SupportedBumpUnits & (1 << i)) {
             count++;
          }
@@ -937,7 +937,7 @@ _mesa_GetTexBumpParameterfvATI( GLenum pname, GLfloat *param )
       *param = (GLfloat) count;
    }
    else if (pname == GL_BUMP_TEX_UNITS_ATI) {
-      for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+      for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) {
          if (ctx->Const.SupportedBumpUnits & (1 << i)) {
             *param++ = (GLfloat) (i + GL_TEXTURE0);
          }
index 4f83a6f887d687bb8775f6d5508ce6b97ffbf1b4..cdd5ed316af7fa42f494f6ad10522f3bb0d99ead 100644 (file)
@@ -260,7 +260,7 @@ compute_version(struct gl_context *ctx)
                               ctx->Extensions.EXT_texture_snorm &&
                               ctx->Extensions.NV_primitive_restart &&
                               ctx->Extensions.NV_texture_rectangle &&
-                              ctx->Const.MaxVertexTextureImageUnits >= 16);
+                              ctx->Const.VertexProgram.MaxTextureImageUnits >= 16);
    const GLboolean ver_3_2 = (ver_3_1 &&
                               ctx->Const.GLSLVersion >= 150 &&
                               ctx->Extensions.ARB_depth_clamp &&
index 8e4fdb61a7570e818c1a5b45c61d30e5add6e411..cbf3fe6ca7ce48fd244905fda1fa0d403af9dca8 100644 (file)
@@ -2714,7 +2714,7 @@ _mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *st
       ? & ctx->Const.VertexProgram
       : & ctx->Const.FragmentProgram;
 
-   state->MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits;
+   state->MaxTextureImageUnits = ctx->Const.FragmentProgram.MaxTextureImageUnits;
    state->MaxTextureCoordUnits = ctx->Const.MaxTextureCoordUnits;
    state->MaxTextureUnits = ctx->Const.MaxTextureUnits;
    state->MaxClipPlanes = ctx->Const.MaxClipPlanes;
index db51eead16b65b85ce4975b92875443ab91fbd8f..302e1298143c6e7b71c3fa47da21f8fc3cbe2c51 100644 (file)
@@ -279,14 +279,14 @@ update_samplers(struct st_context *st)
    update_shader_samplers(st,
                           PIPE_SHADER_FRAGMENT,
                           &ctx->FragmentProgram._Current->Base,
-                          ctx->Const.MaxTextureImageUnits,
+                          ctx->Const.FragmentProgram.MaxTextureImageUnits,
                           st->state.samplers[PIPE_SHADER_FRAGMENT],
                           &st->state.num_samplers[PIPE_SHADER_FRAGMENT]);
 
    update_shader_samplers(st,
                           PIPE_SHADER_VERTEX,
                           &ctx->VertexProgram._Current->Base,
-                          ctx->Const.MaxVertexTextureImageUnits,
+                          ctx->Const.VertexProgram.MaxTextureImageUnits,
                           st->state.samplers[PIPE_SHADER_VERTEX],
                           &st->state.num_samplers[PIPE_SHADER_VERTEX]);
 
@@ -294,7 +294,7 @@ update_samplers(struct st_context *st)
       update_shader_samplers(st,
                              PIPE_SHADER_GEOMETRY,
                              &ctx->GeometryProgram._Current->Base,
-                             ctx->Const.MaxGeometryTextureImageUnits,
+                             ctx->Const.GeometryProgram.MaxTextureImageUnits,
                              st->state.samplers[PIPE_SHADER_GEOMETRY],
                              &st->state.num_samplers[PIPE_SHADER_GEOMETRY]);
    }
index fc2d69013aefe1ae152b86c492acf31ef209c5eb..8d1250fdc9167f6370569e30fa1daeca13612f8e 100644 (file)
@@ -325,11 +325,11 @@ update_vertex_textures(struct st_context *st)
 {
    const struct gl_context *ctx = st->ctx;
 
-   if (ctx->Const.MaxVertexTextureImageUnits > 0) {
+   if (ctx->Const.VertexProgram.MaxTextureImageUnits > 0) {
       update_textures(st,
                       PIPE_SHADER_VERTEX,
                       &ctx->VertexProgram._Current->Base,
-                      ctx->Const.MaxVertexTextureImageUnits,
+                      ctx->Const.VertexProgram.MaxTextureImageUnits,
                       st->state.sampler_views[PIPE_SHADER_VERTEX],
                       &st->state.num_sampler_views[PIPE_SHADER_VERTEX]);
    }
@@ -344,7 +344,7 @@ update_fragment_textures(struct st_context *st)
    update_textures(st,
                    PIPE_SHADER_FRAGMENT,
                    &ctx->FragmentProgram._Current->Base,
-                   ctx->Const.MaxTextureImageUnits,
+                   ctx->Const.FragmentProgram.MaxTextureImageUnits,
                    st->state.sampler_views[PIPE_SHADER_FRAGMENT],
                    &st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]);
 }
@@ -359,7 +359,7 @@ update_geometry_textures(struct st_context *st)
       update_textures(st,
                       PIPE_SHADER_GEOMETRY,
                       &ctx->GeometryProgram._Current->Base,
-                      ctx->Const.MaxTextureImageUnits,
+                      ctx->Const.FragmentProgram.MaxTextureImageUnits,
                       st->state.sampler_views[PIPE_SHADER_GEOMETRY],
                       &st->state.num_sampler_views[PIPE_SHADER_GEOMETRY]);
    }
index a72728c1a824008bcf38ba3b8aa8a7fc0d1bba94..9111d1fc5945bf186905029ed0bc7092482000da 100644 (file)
@@ -90,12 +90,12 @@ void st_init_limits(struct st_context *st)
    c->MaxArrayTextureLayers
       = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
 
-   c->MaxTextureImageUnits
+   c->FragmentProgram.MaxTextureImageUnits
       = _min(screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT,
                                       PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS),
             MAX_TEXTURE_IMAGE_UNITS);
 
-   c->MaxVertexTextureImageUnits
+   c->VertexProgram.MaxTextureImageUnits
       = _min(screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
                                       PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS),
              MAX_TEXTURE_IMAGE_UNITS);
@@ -105,9 +105,9 @@ void st_init_limits(struct st_context *st)
              MAX_COMBINED_TEXTURE_IMAGE_UNITS);
 
    c->MaxTextureCoordUnits
-      = _min(c->MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS);
+      = _min(c->FragmentProgram.MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS);
 
-   c->MaxTextureUnits = _min(c->MaxTextureImageUnits, c->MaxTextureCoordUnits);
+   c->MaxTextureUnits = _min(c->FragmentProgram.MaxTextureImageUnits, c->MaxTextureCoordUnits);
 
    /* Define max viewport size and max renderbuffer size in terms of
     * max texture size (note: max tex RECT size = max tex 2D size).
index 5f1ffecc6dd4c70d5f181864b9380208e4f64a57..dd8810d454c885ac350a0201a183fe107b931535 100644 (file)
@@ -4930,7 +4930,7 @@ st_translate_program(
    assert(i == program->num_immediates);
 
    /* texture samplers */
-   for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+   for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) {
       if (program->samplers_used & (1 << i)) {
          t->samplers[i] = ureg_DECL_sampler(ureg, i);
       }
index 2581e1ea88c7d6393bf0cfc9eef7b9a9ea872c9d..dd9f4fc53bfc73cde5ffae2f0af0b67972b9489b 100644 (file)
@@ -1221,7 +1221,7 @@ st_translate_mesa_program(
    }
 
    /* texture samplers */
-   for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) {
+   for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) {
       if (program->SamplersUsed & (1 << i)) {
          t->samplers[i] = ureg_DECL_sampler( ureg, i );
       }
index cd36a30e3090087eef062f48a863d08b37457475..591fe57cbd31f0f432aa764ce64a3fa18b463253 100644 (file)
@@ -459,7 +459,7 @@ _swrast_invalidate_state( struct gl_context *ctx, GLbitfield new_state )
       swrast->BlendFunc = _swrast_validate_blend_func;
 
    if (new_state & _SWRAST_NEW_TEXTURE_SAMPLE_FUNC)
-      for (i = 0 ; i < ctx->Const.MaxTextureImageUnits ; i++)
+      for (i = 0 ; i < ctx->Const.FragmentProgram.MaxTextureImageUnits ; i++)
         swrast->TextureSample[i] = NULL;
 }
 
@@ -473,7 +473,7 @@ _swrast_update_texture_samplers(struct gl_context *ctx)
    if (!swrast)
       return; /* pipe hack */
 
-   for (u = 0; u < ctx->Const.MaxTextureImageUnits; u++) {
+   for (u = 0; u < ctx->Const.FragmentProgram.MaxTextureImageUnits; u++) {
       struct gl_texture_object *tObj = ctx->Texture.Unit[u]._Current;
       /* Note: If tObj is NULL, the sample function will be a simple
        * function that just returns opaque black (0,0,0,1).
index 523fea15afd910a8b520f3015a420994fc95a020..df3a74a06adee0c0563fbaa2d3593660bf279bb4 100644 (file)
@@ -612,7 +612,7 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span )
        * thread.
        */
       swrast->TexelBuffer =
-        malloc(ctx->Const.MaxTextureImageUnits * maxThreads *
+        malloc(ctx->Const.FragmentProgram.MaxTextureImageUnits * maxThreads *
                            SWRAST_MAX_WIDTH * 4 * sizeof(GLfloat));
       if (!swrast->TexelBuffer) {
         _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture_combine");
index 1720e434b314c1b3fb787f071a73ca31c6499c44..5ade54343dddede80cf018cf158570ca6efd8e38 100644 (file)
@@ -260,7 +260,7 @@ map_textures(struct gl_context *ctx, const struct gl_vertex_program *vp)
 {
    GLuint u;
 
-   for (u = 0; u < ctx->Const.MaxVertexTextureImageUnits; u++) {
+   for (u = 0; u < ctx->Const.VertexProgram.MaxTextureImageUnits; u++) {
       if (vp->Base.TexturesUsed[u]) {
          /* Note: _Current *should* correspond to the target indicated
           * in TexturesUsed[u].
@@ -279,7 +279,7 @@ unmap_textures(struct gl_context *ctx, const struct gl_vertex_program *vp)
 {
    GLuint u;
 
-   for (u = 0; u < ctx->Const.MaxVertexTextureImageUnits; u++) {
+   for (u = 0; u < ctx->Const.VertexProgram.MaxTextureImageUnits; u++) {
       if (vp->Base.TexturesUsed[u]) {
          /* Note: _Current *should* correspond to the target indicated
           * in TexturesUsed[u].