mesa: add new enum MAX_UNIFORM_LOCATIONS
Patch adds new implementation dependent value required by the GL_ARB_explicit_uniform_location extension. Default value for user assignable locations is calculated as sum of MaxUniformComponents for each stage. v2: fix descriptor in get_hash_params.py (Petri) v3: simpler formula for calculating initial value (Ian) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
@@ -610,6 +610,10 @@ _mesa_init_constants(struct gl_context *ctx)
|
|||||||
ctx->Const.MaxUniformBlockSize = 16384;
|
ctx->Const.MaxUniformBlockSize = 16384;
|
||||||
ctx->Const.UniformBufferOffsetAlignment = 1;
|
ctx->Const.UniformBufferOffsetAlignment = 1;
|
||||||
|
|
||||||
|
/* GL_ARB_explicit_uniform_location, GL_MAX_UNIFORM_LOCATIONS */
|
||||||
|
ctx->Const.MaxUserAssignableUniformLocations =
|
||||||
|
4 * MESA_SHADER_STAGES * MAX_UNIFORMS;
|
||||||
|
|
||||||
for (i = 0; i < MESA_SHADER_STAGES; i++)
|
for (i = 0; i < MESA_SHADER_STAGES; i++)
|
||||||
init_program_limits(ctx, i, &ctx->Const.Program[i]);
|
init_program_limits(ctx, i, &ctx->Const.Program[i]);
|
||||||
|
|
||||||
|
@@ -395,6 +395,7 @@ EXTRA_EXT(ARB_compute_shader);
|
|||||||
EXTRA_EXT(ARB_gpu_shader5);
|
EXTRA_EXT(ARB_gpu_shader5);
|
||||||
EXTRA_EXT2(ARB_transform_feedback3, ARB_gpu_shader5);
|
EXTRA_EXT2(ARB_transform_feedback3, ARB_gpu_shader5);
|
||||||
EXTRA_EXT(INTEL_performance_query);
|
EXTRA_EXT(INTEL_performance_query);
|
||||||
|
EXTRA_EXT(ARB_explicit_uniform_location);
|
||||||
|
|
||||||
static const int
|
static const int
|
||||||
extra_ARB_color_buffer_float_or_glcore[] = {
|
extra_ARB_color_buffer_float_or_glcore[] = {
|
||||||
|
@@ -480,6 +480,7 @@ descriptor=[
|
|||||||
[ "MAX_LIST_NESTING", "CONST(MAX_LIST_NESTING), NO_EXTRA" ],
|
[ "MAX_LIST_NESTING", "CONST(MAX_LIST_NESTING), NO_EXTRA" ],
|
||||||
[ "MAX_NAME_STACK_DEPTH", "CONST(MAX_NAME_STACK_DEPTH), NO_EXTRA" ],
|
[ "MAX_NAME_STACK_DEPTH", "CONST(MAX_NAME_STACK_DEPTH), NO_EXTRA" ],
|
||||||
[ "MAX_PIXEL_MAP_TABLE", "CONST(MAX_PIXEL_MAP_TABLE), NO_EXTRA" ],
|
[ "MAX_PIXEL_MAP_TABLE", "CONST(MAX_PIXEL_MAP_TABLE), NO_EXTRA" ],
|
||||||
|
[ "MAX_UNIFORM_LOCATIONS", "CONTEXT_INT(Const.MaxUserAssignableUniformLocations), extra_ARB_explicit_uniform_location" ],
|
||||||
[ "NAME_STACK_DEPTH", "CONTEXT_INT(Select.NameStackDepth), NO_EXTRA" ],
|
[ "NAME_STACK_DEPTH", "CONTEXT_INT(Select.NameStackDepth), NO_EXTRA" ],
|
||||||
[ "PACK_LSB_FIRST", "CONTEXT_BOOL(Pack.LsbFirst), NO_EXTRA" ],
|
[ "PACK_LSB_FIRST", "CONTEXT_BOOL(Pack.LsbFirst), NO_EXTRA" ],
|
||||||
[ "PACK_SWAP_BYTES", "CONTEXT_BOOL(Pack.SwapBytes), NO_EXTRA" ],
|
[ "PACK_SWAP_BYTES", "CONTEXT_BOOL(Pack.SwapBytes), NO_EXTRA" ],
|
||||||
|
@@ -3323,6 +3323,11 @@ struct gl_constants
|
|||||||
GLuint UniformBufferOffsetAlignment;
|
GLuint UniformBufferOffsetAlignment;
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GL_ARB_explicit_uniform_location
|
||||||
|
*/
|
||||||
|
GLuint MaxUserAssignableUniformLocations;
|
||||||
|
|
||||||
/** GL_ARB_geometry_shader4 */
|
/** GL_ARB_geometry_shader4 */
|
||||||
GLuint MaxGeometryOutputVertices;
|
GLuint MaxGeometryOutputVertices;
|
||||||
GLuint MaxGeometryTotalOutputComponents;
|
GLuint MaxGeometryTotalOutputComponents;
|
||||||
|
@@ -787,6 +787,7 @@ const struct enum_info everything[] = {
|
|||||||
{ 0x8256, "GL_RESET_NOTIFICATION_STRATEGY_ARB" },
|
{ 0x8256, "GL_RESET_NOTIFICATION_STRATEGY_ARB" },
|
||||||
{ 0x8257, "GL_PROGRAM_BINARY_RETRIEVABLE_HINT" },
|
{ 0x8257, "GL_PROGRAM_BINARY_RETRIEVABLE_HINT" },
|
||||||
{ 0x8261, "GL_NO_RESET_NOTIFICATION_ARB" },
|
{ 0x8261, "GL_NO_RESET_NOTIFICATION_ARB" },
|
||||||
|
{ 0x826E, "GL_MAX_UNIFORM_LOCATIONS" },
|
||||||
{ 0x82DF, "GL_TEXTURE_IMMUTABLE_LEVELS" },
|
{ 0x82DF, "GL_TEXTURE_IMMUTABLE_LEVELS" },
|
||||||
{ 0x8362, "GL_UNSIGNED_BYTE_2_3_3_REV" },
|
{ 0x8362, "GL_UNSIGNED_BYTE_2_3_3_REV" },
|
||||||
{ 0x8363, "GL_UNSIGNED_SHORT_5_6_5" },
|
{ 0x8363, "GL_UNSIGNED_SHORT_5_6_5" },
|
||||||
|
Reference in New Issue
Block a user