mesa: add new enum MAX_UNIFORM_LOCATIONS
authorTapani Pälli <tapani.palli@intel.com>
Mon, 5 May 2014 04:55:34 +0000 (07:55 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 16 Jun 2014 03:49:59 +0000 (06:49 +0300)
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>
src/mesa/main/context.c
src/mesa/main/get.c
src/mesa/main/get_hash_params.py
src/mesa/main/mtypes.h
src/mesa/main/tests/enum_strings.cpp

index 8eb426d5904ea7ad5e9558b28bac4e48f8ba5190..f350788500c6619b23bedf1cb505f1bbe063669b 100644 (file)
@@ -610,6 +610,10 @@ _mesa_init_constants(struct gl_context *ctx)
    ctx->Const.MaxUniformBlockSize = 16384;
    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++)
       init_program_limits(ctx, i, &ctx->Const.Program[i]);
 
index 9b56edb741b5699a625c4b6af544ba99c51b9bdd..183a13bd138d610619edf9f5e756ba154b107380 100644 (file)
@@ -395,6 +395,7 @@ EXTRA_EXT(ARB_compute_shader);
 EXTRA_EXT(ARB_gpu_shader5);
 EXTRA_EXT2(ARB_transform_feedback3, ARB_gpu_shader5);
 EXTRA_EXT(INTEL_performance_query);
+EXTRA_EXT(ARB_explicit_uniform_location);
 
 static const int
 extra_ARB_color_buffer_float_or_glcore[] = {
index 87d96b29a61204f5b55a06a0dc0f4f79cb629e2f..d45962d95e469de5390b8646c5d0ad8b2942cb07 100644 (file)
@@ -480,6 +480,7 @@ descriptor=[
   [ "MAX_LIST_NESTING", "CONST(MAX_LIST_NESTING), 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_UNIFORM_LOCATIONS", "CONTEXT_INT(Const.MaxUserAssignableUniformLocations), extra_ARB_explicit_uniform_location" ],
   [ "NAME_STACK_DEPTH", "CONTEXT_INT(Select.NameStackDepth), NO_EXTRA" ],
   [ "PACK_LSB_FIRST", "CONTEXT_BOOL(Pack.LsbFirst), NO_EXTRA" ],
   [ "PACK_SWAP_BYTES", "CONTEXT_BOOL(Pack.SwapBytes), NO_EXTRA" ],
index 6d51f19a5e87c641e4d696920ea9d253b362b17c..8b7ee306ed3f04237fa6032222882e96e8d6da07 100644 (file)
@@ -3323,6 +3323,11 @@ struct gl_constants
    GLuint UniformBufferOffsetAlignment;
    /** @} */
 
+   /**
+    * GL_ARB_explicit_uniform_location
+    */
+   GLuint MaxUserAssignableUniformLocations;
+
    /** GL_ARB_geometry_shader4 */
    GLuint MaxGeometryOutputVertices;
    GLuint MaxGeometryTotalOutputComponents;
index 66ff4ec6e7de3b4771f656ede3c928d36fe10ccb..2913668aeb005a2b18d2d7a791c2bc815cb8e5d9 100644 (file)
@@ -787,6 +787,7 @@ const struct enum_info everything[] = {
    { 0x8256, "GL_RESET_NOTIFICATION_STRATEGY_ARB" },
    { 0x8257, "GL_PROGRAM_BINARY_RETRIEVABLE_HINT" },
    { 0x8261, "GL_NO_RESET_NOTIFICATION_ARB" },
+   { 0x826E, "GL_MAX_UNIFORM_LOCATIONS" },
    { 0x82DF, "GL_TEXTURE_IMMUTABLE_LEVELS" },
    { 0x8362, "GL_UNSIGNED_BYTE_2_3_3_REV" },
    { 0x8363, "GL_UNSIGNED_SHORT_5_6_5" },