mesa: move max texture image unit constants to gl_program_constants

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>
This commit is contained in:
Marek Olšák
2013-05-02 02:30:44 +02:00
parent d27d29f1a6
commit 5e78433eec
27 changed files with 61 additions and 63 deletions

View 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.MaxVertexAttribs = ctx->Const.VertexProgram.MaxAttribs;
this->Const.MaxVertexUniformComponents = ctx->Const.VertexProgram.MaxUniformComponents; this->Const.MaxVertexUniformComponents = ctx->Const.VertexProgram.MaxUniformComponents;
this->Const.MaxVaryingFloats = ctx->Const.MaxVarying * 4; 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.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.MaxFragmentUniformComponents = ctx->Const.FragmentProgram.MaxUniformComponents;
this->Const.MinProgramTexelOffset = ctx->Const.MinProgramTexelOffset; this->Const.MinProgramTexelOffset = ctx->Const.MinProgramTexelOffset;
this->Const.MaxProgramTexelOffset = ctx->Const.MaxProgramTexelOffset; this->Const.MaxProgramTexelOffset = ctx->Const.MaxProgramTexelOffset;

View File

@@ -1512,15 +1512,15 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
}; };
const unsigned max_samplers[MESA_SHADER_TYPES] = { const unsigned max_samplers[MESA_SHADER_TYPES] = {
ctx->Const.MaxVertexTextureImageUnits, ctx->Const.VertexProgram.MaxTextureImageUnits,
ctx->Const.MaxTextureImageUnits, ctx->Const.FragmentProgram.MaxTextureImageUnits,
ctx->Const.MaxGeometryTextureImageUnits ctx->Const.GeometryProgram.MaxTextureImageUnits
}; };
const unsigned max_uniform_components[MESA_SHADER_TYPES] = { const unsigned max_uniform_components[MESA_SHADER_TYPES] = {
ctx->Const.VertexProgram.MaxUniformComponents, ctx->Const.VertexProgram.MaxUniformComponents,
ctx->Const.FragmentProgram.MaxUniformComponents, ctx->Const.FragmentProgram.MaxUniformComponents,
0 /* FINISHME: Geometry shaders. */ ctx->Const.GeometryProgram.MaxUniformComponents
}; };
const unsigned max_uniform_blocks[MESA_SHADER_TYPES] = { const unsigned max_uniform_blocks[MESA_SHADER_TYPES] = {

View File

@@ -117,9 +117,9 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
ctx->Const.VertexProgram.MaxUniformComponents = 512; ctx->Const.VertexProgram.MaxUniformComponents = 512;
ctx->Const.MaxVarying = 8; /* == gl_MaxVaryingFloats / 4 */ ctx->Const.MaxVarying = 8; /* == gl_MaxVaryingFloats / 4 */
ctx->Const.MaxVertexTextureImageUnits = 0; ctx->Const.VertexProgram.MaxTextureImageUnits = 0;
ctx->Const.MaxCombinedTextureImageUnits = 2; ctx->Const.MaxCombinedTextureImageUnits = 2;
ctx->Const.MaxTextureImageUnits = 2; ctx->Const.FragmentProgram.MaxTextureImageUnits = 2;
ctx->Const.FragmentProgram.MaxUniformComponents = 64; ctx->Const.FragmentProgram.MaxUniformComponents = 64;
ctx->Const.MaxDrawBuffers = 1; ctx->Const.MaxDrawBuffers = 1;

View File

@@ -96,7 +96,7 @@ i830CreateContext(int api,
FALLBACK(intel, INTEL_FALLBACK_USER, 1); FALLBACK(intel, INTEL_FALLBACK_USER, 1);
intel->ctx.Const.MaxTextureUnits = I830_TEX_UNITS; 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; intel->ctx.Const.MaxTextureCoordUnits = I830_TEX_UNITS;
/* Advertise the full hardware capabilities. The new memory /* Advertise the full hardware capabilities. The new memory

View File

@@ -191,12 +191,12 @@ i915CreateContext(int api,
FALLBACK(intel, INTEL_FALLBACK_USER, 1); FALLBACK(intel, INTEL_FALLBACK_USER, 1);
ctx->Const.MaxTextureUnits = I915_TEX_UNITS; 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.MaxTextureCoordUnits = I915_TEX_UNITS;
ctx->Const.MaxVarying = I915_TEX_UNITS; ctx->Const.MaxVarying = I915_TEX_UNITS;
ctx->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits =
ctx->Const.MaxVertexTextureImageUnits + ctx->Const.VertexProgram.MaxTextureImageUnits +
ctx->Const.MaxTextureImageUnits; ctx->Const.FragmentProgram.MaxTextureImageUnits;
/* Advertise the full hardware capabilities. The new memory /* Advertise the full hardware capabilities. The new memory
* manager should cope much better with overload situations: * manager should cope much better with overload situations:

View File

@@ -155,14 +155,14 @@ brwCreateContext(int api,
ctx->Const.MaxDualSourceDrawBuffers = 1; ctx->Const.MaxDualSourceDrawBuffers = 1;
ctx->Const.MaxDrawBuffers = BRW_MAX_DRAW_BUFFERS; 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.MaxTextureCoordUnits = 8; /* Mesa limit */
ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits, ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits,
ctx->Const.MaxTextureImageUnits); ctx->Const.FragmentProgram.MaxTextureImageUnits);
ctx->Const.MaxVertexTextureImageUnits = BRW_MAX_TEX_UNIT; ctx->Const.VertexProgram.MaxTextureImageUnits = BRW_MAX_TEX_UNIT;
ctx->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxCombinedTextureImageUnits =
ctx->Const.MaxVertexTextureImageUnits + ctx->Const.VertexProgram.MaxTextureImageUnits +
ctx->Const.MaxTextureImageUnits; ctx->Const.FragmentProgram.MaxTextureImageUnits;
ctx->Const.MaxTextureLevels = 14; /* 8192 */ ctx->Const.MaxTextureLevels = 14; /* 8192 */
if (ctx->Const.MaxTextureLevels > MAX_TEXTURE_LEVELS) if (ctx->Const.MaxTextureLevels > MAX_TEXTURE_LEVELS)

View File

@@ -159,7 +159,7 @@ nv04_context_create(struct nouveau_screen *screen, const struct gl_config *visua
/* GL constants. */ /* GL constants. */
ctx->Const.MaxTextureLevels = 11; ctx->Const.MaxTextureLevels = 11;
ctx->Const.MaxTextureCoordUnits = NV04_TEXTURE_UNITS; 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.MaxTextureUnits = NV04_TEXTURE_UNITS;
ctx->Const.MaxTextureMaxAnisotropy = 2; ctx->Const.MaxTextureMaxAnisotropy = 2;
ctx->Const.MaxTextureLodBias = 15; ctx->Const.MaxTextureLodBias = 15;

View File

@@ -457,7 +457,7 @@ nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visua
/* GL constants. */ /* GL constants. */
ctx->Const.MaxTextureLevels = 12; ctx->Const.MaxTextureLevels = 12;
ctx->Const.MaxTextureCoordUnits = NV10_TEXTURE_UNITS; 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.MaxTextureUnits = NV10_TEXTURE_UNITS;
ctx->Const.MaxTextureMaxAnisotropy = 2; ctx->Const.MaxTextureMaxAnisotropy = 2;
ctx->Const.MaxTextureLodBias = 15; ctx->Const.MaxTextureLodBias = 15;

View File

@@ -467,7 +467,7 @@ nv20_context_create(struct nouveau_screen *screen, const struct gl_config *visua
/* GL constants. */ /* GL constants. */
ctx->Const.MaxTextureCoordUnits = NV20_TEXTURE_UNITS; 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.MaxTextureUnits = NV20_TEXTURE_UNITS;
ctx->Const.MaxTextureMaxAnisotropy = 8; ctx->Const.MaxTextureMaxAnisotropy = 8;
ctx->Const.MaxTextureLodBias = 15; ctx->Const.MaxTextureLodBias = 15;

View File

@@ -306,7 +306,7 @@ GLboolean r200CreateContext( gl_api api,
*/ */
ctx->Const.MaxTextureUnits = driQueryOptioni (&rmesa->radeon.optionCache, ctx->Const.MaxTextureUnits = driQueryOptioni (&rmesa->radeon.optionCache,
"texture_units"); "texture_units");
ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits; ctx->Const.FragmentProgram.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits; ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
ctx->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxTextureUnits; ctx->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxTextureUnits;

View File

@@ -2237,7 +2237,7 @@ static GLboolean r200ValidateBuffers(struct gl_context *ctx)
0, RADEON_GEM_DOMAIN_VRAM); 0, RADEON_GEM_DOMAIN_VRAM);
} }
for (i = 0; i < ctx->Const.MaxTextureImageUnits; ++i) { for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; ++i) {
radeonTexObj *t; radeonTexObj *t;
if (!ctx->Texture.Unit[i]._ReallyEnabled) if (!ctx->Texture.Unit[i]._ReallyEnabled)

View File

@@ -269,7 +269,7 @@ r100CreateContext( gl_api api,
ctx->Const.MaxTextureUnits = driQueryOptioni (&rmesa->radeon.optionCache, ctx->Const.MaxTextureUnits = driQueryOptioni (&rmesa->radeon.optionCache,
"texture_units"); "texture_units");
ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits; ctx->Const.FragmentProgram.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits; ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
ctx->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxTextureUnits; ctx->Const.MaxCombinedTextureImageUnits = ctx->Const.MaxTextureUnits;

View File

@@ -2013,7 +2013,7 @@ static GLboolean r100ValidateBuffers(struct gl_context *ctx)
0, RADEON_GEM_DOMAIN_VRAM); 0, RADEON_GEM_DOMAIN_VRAM);
} }
for (i = 0; i < ctx->Const.MaxTextureImageUnits; ++i) { for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; ++i) {
radeonTexObj *t; radeonTexObj *t;
if (!ctx->Texture.Unit[i]._ReallyEnabled) if (!ctx->Texture.Unit[i]._ReallyEnabled)

View File

@@ -552,9 +552,9 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxTextureRectSize = MAX_TEXTURE_RECT_SIZE; ctx->Const.MaxTextureRectSize = MAX_TEXTURE_RECT_SIZE;
ctx->Const.MaxArrayTextureLayers = MAX_ARRAY_TEXTURE_LAYERS; ctx->Const.MaxArrayTextureLayers = MAX_ARRAY_TEXTURE_LAYERS;
ctx->Const.MaxTextureCoordUnits = MAX_TEXTURE_COORD_UNITS; 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.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits,
ctx->Const.MaxTextureImageUnits); ctx->Const.FragmentProgram.MaxTextureImageUnits);
ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY; ctx->Const.MaxTextureMaxAnisotropy = MAX_TEXTURE_MAX_ANISOTROPY;
ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS; ctx->Const.MaxTextureLodBias = MAX_TEXTURE_LOD_BIAS;
ctx->Const.MaxTextureBufferSize = 65536; ctx->Const.MaxTextureBufferSize = 65536;
@@ -601,10 +601,10 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS; ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS;
ctx->Const.MaxRenderbufferSize = MAX_RENDERBUFFER_SIZE; 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.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxVarying = 16; /* old limit not to break tnl and swrast */ 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.MaxVertexVaryingComponents = MAX_VERTEX_VARYING_COMPONENTS;
ctx->Const.MaxGeometryVaryingComponents = MAX_GEOMETRY_VARYING_COMPONENTS; ctx->Const.MaxGeometryVaryingComponents = MAX_GEOMETRY_VARYING_COMPONENTS;
ctx->Const.MaxGeometryOutputVertices = MAX_GEOMETRY_OUTPUT_VERTICES; 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); assert(ctx->Const.VertexProgram.MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
/* Texture unit checks */ /* Texture unit checks */
assert(ctx->Const.MaxTextureImageUnits > 0); assert(ctx->Const.FragmentProgram.MaxTextureImageUnits > 0);
assert(ctx->Const.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS); assert(ctx->Const.FragmentProgram.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS);
assert(ctx->Const.MaxTextureCoordUnits > 0); assert(ctx->Const.MaxTextureCoordUnits > 0);
assert(ctx->Const.MaxTextureCoordUnits <= MAX_TEXTURE_COORD_UNITS); assert(ctx->Const.MaxTextureCoordUnits <= MAX_TEXTURE_COORD_UNITS);
assert(ctx->Const.MaxTextureUnits > 0); assert(ctx->Const.MaxTextureUnits > 0);
assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_IMAGE_UNITS); assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_IMAGE_UNITS);
assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_COORD_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)); ctx->Const.MaxTextureCoordUnits));
assert(ctx->Const.MaxCombinedTextureImageUnits > 0); assert(ctx->Const.MaxCombinedTextureImageUnits > 0);
assert(ctx->Const.MaxCombinedTextureImageUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS); assert(ctx->Const.MaxCombinedTextureImageUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
assert(ctx->Const.MaxTextureCoordUnits <= 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 */ /* 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 */ /* Texture size checks */

View File

@@ -273,8 +273,8 @@ descriptor=[
# GL_ARB_fragment_program # GL_ARB_fragment_program
# == GL_MAX_TEXTURE_IMAGE_UNITS_NV # == GL_MAX_TEXTURE_IMAGE_UNITS_NV
[ "MAX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxTextureImageUnits), extra_ARB_fragment_program" ], [ "MAX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.FragmentProgram.MaxTextureImageUnits), extra_ARB_fragment_program" ],
[ "MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxVertexTextureImageUnits), extra_ARB_vertex_shader" ], [ "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" ], [ "MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", "CONTEXT_INT(Const.MaxCombinedTextureImageUnits), extra_ARB_vertex_shader" ],
# GL_ARB_shader_objects # GL_ARB_shader_objects
@@ -637,7 +637,7 @@ descriptor=[
[ "MAX_VERTEX_STREAMS", "CONTEXT_INT(Const.MaxVertexStreams), extra_ARB_transform_feedback3" ], [ "MAX_VERTEX_STREAMS", "CONTEXT_INT(Const.MaxVertexStreams), extra_ARB_transform_feedback3" ],
# GL_ARB_geometry_shader4 # 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_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_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" ], [ "MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB", "CONTEXT_INT(Const.GeometryProgram.MaxUniformComponents), extra_ARB_geometry_shader4" ],

View File

@@ -2735,6 +2735,7 @@ struct gl_program_constants
/* GL_ARB_uniform_buffer_object */ /* GL_ARB_uniform_buffer_object */
GLuint MaxUniformBlocks; GLuint MaxUniformBlocks;
GLuint MaxCombinedUniformComponents; GLuint MaxCombinedUniformComponents;
GLuint MaxTextureImageUnits;
}; };
@@ -2751,11 +2752,8 @@ struct gl_constants
GLuint MaxArrayTextureLayers; /**< Max layers in array textures */ GLuint MaxArrayTextureLayers; /**< Max layers in array textures */
GLuint MaxTextureRectSize; /**< Max rectangle texture size, in pixes */ GLuint MaxTextureRectSize; /**< Max rectangle texture size, in pixes */
GLuint MaxTextureCoordUnits; GLuint MaxTextureCoordUnits;
GLuint MaxTextureImageUnits;
GLuint MaxVertexTextureImageUnits;
GLuint MaxCombinedTextureImageUnits; GLuint MaxCombinedTextureImageUnits;
GLuint MaxGeometryTextureImageUnits; GLuint MaxTextureUnits; /**< = MIN(CoordUnits, FragmentProgram.ImageUnits) */
GLuint MaxTextureUnits; /**< = MIN(CoordUnits, ImageUnits) */
GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */
GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */ GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */
GLuint MaxTextureBufferSize; /**< GL_ARB_texture_buffer_object */ GLuint MaxTextureBufferSize; /**< GL_ARB_texture_buffer_object */

View File

@@ -880,7 +880,7 @@ _mesa_GetTexBumpParameterivATI( GLenum pname, GLint *param )
} }
else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) { else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) {
GLint count = 0; 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)) { if (ctx->Const.SupportedBumpUnits & (1 << i)) {
count++; count++;
} }
@@ -888,7 +888,7 @@ _mesa_GetTexBumpParameterivATI( GLenum pname, GLint *param )
*param = count; *param = count;
} }
else if (pname == GL_BUMP_TEX_UNITS_ATI) { 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)) { if (ctx->Const.SupportedBumpUnits & (1 << i)) {
*param++ = i + GL_TEXTURE0; *param++ = i + GL_TEXTURE0;
} }
@@ -929,7 +929,7 @@ _mesa_GetTexBumpParameterfvATI( GLenum pname, GLfloat *param )
} }
else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) { else if (pname == GL_BUMP_NUM_TEX_UNITS_ATI) {
GLint count = 0; 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)) { if (ctx->Const.SupportedBumpUnits & (1 << i)) {
count++; count++;
} }
@@ -937,7 +937,7 @@ _mesa_GetTexBumpParameterfvATI( GLenum pname, GLfloat *param )
*param = (GLfloat) count; *param = (GLfloat) count;
} }
else if (pname == GL_BUMP_TEX_UNITS_ATI) { 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)) { if (ctx->Const.SupportedBumpUnits & (1 << i)) {
*param++ = (GLfloat) (i + GL_TEXTURE0); *param++ = (GLfloat) (i + GL_TEXTURE0);
} }

View File

@@ -260,7 +260,7 @@ compute_version(struct gl_context *ctx)
ctx->Extensions.EXT_texture_snorm && ctx->Extensions.EXT_texture_snorm &&
ctx->Extensions.NV_primitive_restart && ctx->Extensions.NV_primitive_restart &&
ctx->Extensions.NV_texture_rectangle && ctx->Extensions.NV_texture_rectangle &&
ctx->Const.MaxVertexTextureImageUnits >= 16); ctx->Const.VertexProgram.MaxTextureImageUnits >= 16);
const GLboolean ver_3_2 = (ver_3_1 && const GLboolean ver_3_2 = (ver_3_1 &&
ctx->Const.GLSLVersion >= 150 && ctx->Const.GLSLVersion >= 150 &&
ctx->Extensions.ARB_depth_clamp && ctx->Extensions.ARB_depth_clamp &&

View File

@@ -2714,7 +2714,7 @@ _mesa_parse_arb_program(struct gl_context *ctx, GLenum target, const GLubyte *st
? & ctx->Const.VertexProgram ? & ctx->Const.VertexProgram
: & ctx->Const.FragmentProgram; : & ctx->Const.FragmentProgram;
state->MaxTextureImageUnits = ctx->Const.MaxTextureImageUnits; state->MaxTextureImageUnits = ctx->Const.FragmentProgram.MaxTextureImageUnits;
state->MaxTextureCoordUnits = ctx->Const.MaxTextureCoordUnits; state->MaxTextureCoordUnits = ctx->Const.MaxTextureCoordUnits;
state->MaxTextureUnits = ctx->Const.MaxTextureUnits; state->MaxTextureUnits = ctx->Const.MaxTextureUnits;
state->MaxClipPlanes = ctx->Const.MaxClipPlanes; state->MaxClipPlanes = ctx->Const.MaxClipPlanes;

View File

@@ -279,14 +279,14 @@ update_samplers(struct st_context *st)
update_shader_samplers(st, update_shader_samplers(st,
PIPE_SHADER_FRAGMENT, PIPE_SHADER_FRAGMENT,
&ctx->FragmentProgram._Current->Base, &ctx->FragmentProgram._Current->Base,
ctx->Const.MaxTextureImageUnits, ctx->Const.FragmentProgram.MaxTextureImageUnits,
st->state.samplers[PIPE_SHADER_FRAGMENT], st->state.samplers[PIPE_SHADER_FRAGMENT],
&st->state.num_samplers[PIPE_SHADER_FRAGMENT]); &st->state.num_samplers[PIPE_SHADER_FRAGMENT]);
update_shader_samplers(st, update_shader_samplers(st,
PIPE_SHADER_VERTEX, PIPE_SHADER_VERTEX,
&ctx->VertexProgram._Current->Base, &ctx->VertexProgram._Current->Base,
ctx->Const.MaxVertexTextureImageUnits, ctx->Const.VertexProgram.MaxTextureImageUnits,
st->state.samplers[PIPE_SHADER_VERTEX], st->state.samplers[PIPE_SHADER_VERTEX],
&st->state.num_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, update_shader_samplers(st,
PIPE_SHADER_GEOMETRY, PIPE_SHADER_GEOMETRY,
&ctx->GeometryProgram._Current->Base, &ctx->GeometryProgram._Current->Base,
ctx->Const.MaxGeometryTextureImageUnits, ctx->Const.GeometryProgram.MaxTextureImageUnits,
st->state.samplers[PIPE_SHADER_GEOMETRY], st->state.samplers[PIPE_SHADER_GEOMETRY],
&st->state.num_samplers[PIPE_SHADER_GEOMETRY]); &st->state.num_samplers[PIPE_SHADER_GEOMETRY]);
} }

View File

@@ -325,11 +325,11 @@ update_vertex_textures(struct st_context *st)
{ {
const struct gl_context *ctx = st->ctx; const struct gl_context *ctx = st->ctx;
if (ctx->Const.MaxVertexTextureImageUnits > 0) { if (ctx->Const.VertexProgram.MaxTextureImageUnits > 0) {
update_textures(st, update_textures(st,
PIPE_SHADER_VERTEX, PIPE_SHADER_VERTEX,
&ctx->VertexProgram._Current->Base, &ctx->VertexProgram._Current->Base,
ctx->Const.MaxVertexTextureImageUnits, ctx->Const.VertexProgram.MaxTextureImageUnits,
st->state.sampler_views[PIPE_SHADER_VERTEX], st->state.sampler_views[PIPE_SHADER_VERTEX],
&st->state.num_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, update_textures(st,
PIPE_SHADER_FRAGMENT, PIPE_SHADER_FRAGMENT,
&ctx->FragmentProgram._Current->Base, &ctx->FragmentProgram._Current->Base,
ctx->Const.MaxTextureImageUnits, ctx->Const.FragmentProgram.MaxTextureImageUnits,
st->state.sampler_views[PIPE_SHADER_FRAGMENT], st->state.sampler_views[PIPE_SHADER_FRAGMENT],
&st->state.num_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, update_textures(st,
PIPE_SHADER_GEOMETRY, PIPE_SHADER_GEOMETRY,
&ctx->GeometryProgram._Current->Base, &ctx->GeometryProgram._Current->Base,
ctx->Const.MaxTextureImageUnits, ctx->Const.FragmentProgram.MaxTextureImageUnits,
st->state.sampler_views[PIPE_SHADER_GEOMETRY], st->state.sampler_views[PIPE_SHADER_GEOMETRY],
&st->state.num_sampler_views[PIPE_SHADER_GEOMETRY]); &st->state.num_sampler_views[PIPE_SHADER_GEOMETRY]);
} }

View File

@@ -90,12 +90,12 @@ void st_init_limits(struct st_context *st)
c->MaxArrayTextureLayers c->MaxArrayTextureLayers
= screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS); = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
c->MaxTextureImageUnits c->FragmentProgram.MaxTextureImageUnits
= _min(screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, = _min(screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT,
PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS), PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS),
MAX_TEXTURE_IMAGE_UNITS); MAX_TEXTURE_IMAGE_UNITS);
c->MaxVertexTextureImageUnits c->VertexProgram.MaxTextureImageUnits
= _min(screen->get_shader_param(screen, PIPE_SHADER_VERTEX, = _min(screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS), PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS),
MAX_TEXTURE_IMAGE_UNITS); MAX_TEXTURE_IMAGE_UNITS);
@@ -105,9 +105,9 @@ void st_init_limits(struct st_context *st)
MAX_COMBINED_TEXTURE_IMAGE_UNITS); MAX_COMBINED_TEXTURE_IMAGE_UNITS);
c->MaxTextureCoordUnits 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 /* Define max viewport size and max renderbuffer size in terms of
* max texture size (note: max tex RECT size = max tex 2D size). * max texture size (note: max tex RECT size = max tex 2D size).

View File

@@ -4930,7 +4930,7 @@ st_translate_program(
assert(i == program->num_immediates); assert(i == program->num_immediates);
/* texture samplers */ /* 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)) { if (program->samplers_used & (1 << i)) {
t->samplers[i] = ureg_DECL_sampler(ureg, i); t->samplers[i] = ureg_DECL_sampler(ureg, i);
} }

View File

@@ -1221,7 +1221,7 @@ st_translate_mesa_program(
} }
/* texture samplers */ /* texture samplers */
for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { for (i = 0; i < ctx->Const.FragmentProgram.MaxTextureImageUnits; i++) {
if (program->SamplersUsed & (1 << i)) { if (program->SamplersUsed & (1 << i)) {
t->samplers[i] = ureg_DECL_sampler( ureg, i ); t->samplers[i] = ureg_DECL_sampler( ureg, i );
} }

View File

@@ -459,7 +459,7 @@ _swrast_invalidate_state( struct gl_context *ctx, GLbitfield new_state )
swrast->BlendFunc = _swrast_validate_blend_func; swrast->BlendFunc = _swrast_validate_blend_func;
if (new_state & _SWRAST_NEW_TEXTURE_SAMPLE_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; swrast->TextureSample[i] = NULL;
} }
@@ -473,7 +473,7 @@ _swrast_update_texture_samplers(struct gl_context *ctx)
if (!swrast) if (!swrast)
return; /* pipe hack */ 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; struct gl_texture_object *tObj = ctx->Texture.Unit[u]._Current;
/* Note: If tObj is NULL, the sample function will be a simple /* Note: If tObj is NULL, the sample function will be a simple
* function that just returns opaque black (0,0,0,1). * function that just returns opaque black (0,0,0,1).

View File

@@ -612,7 +612,7 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span )
* thread. * thread.
*/ */
swrast->TexelBuffer = swrast->TexelBuffer =
malloc(ctx->Const.MaxTextureImageUnits * maxThreads * malloc(ctx->Const.FragmentProgram.MaxTextureImageUnits * maxThreads *
SWRAST_MAX_WIDTH * 4 * sizeof(GLfloat)); SWRAST_MAX_WIDTH * 4 * sizeof(GLfloat));
if (!swrast->TexelBuffer) { if (!swrast->TexelBuffer) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "texture_combine"); _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture_combine");

View File

@@ -260,7 +260,7 @@ map_textures(struct gl_context *ctx, const struct gl_vertex_program *vp)
{ {
GLuint u; GLuint u;
for (u = 0; u < ctx->Const.MaxVertexTextureImageUnits; u++) { for (u = 0; u < ctx->Const.VertexProgram.MaxTextureImageUnits; u++) {
if (vp->Base.TexturesUsed[u]) { if (vp->Base.TexturesUsed[u]) {
/* Note: _Current *should* correspond to the target indicated /* Note: _Current *should* correspond to the target indicated
* in TexturesUsed[u]. * in TexturesUsed[u].
@@ -279,7 +279,7 @@ unmap_textures(struct gl_context *ctx, const struct gl_vertex_program *vp)
{ {
GLuint u; GLuint u;
for (u = 0; u < ctx->Const.MaxVertexTextureImageUnits; u++) { for (u = 0; u < ctx->Const.VertexProgram.MaxTextureImageUnits; u++) {
if (vp->Base.TexturesUsed[u]) { if (vp->Base.TexturesUsed[u]) {
/* Note: _Current *should* correspond to the target indicated /* Note: _Current *should* correspond to the target indicated
* in TexturesUsed[u]. * in TexturesUsed[u].