From d3575622b7897c88c62e4f57341c196eb913c960 Mon Sep 17 00:00:00 2001 From: Maxence Le Dore Date: Mon, 24 Dec 2012 00:57:02 +0100 Subject: [PATCH] mesa: add texture gather changes Reviewed-by: Kenneth Graunke Reviewed-by: Ian Romanick --- src/mapi/glapi/gen/ARB_texture_gather.xml | 14 ++++++++++++++ src/mapi/glapi/gen/gl_API.xml | 2 +- src/mesa/main/context.c | 4 ++++ src/mesa/main/extensions.c | 1 + src/mesa/main/get.c | 1 + src/mesa/main/get_hash_params.py | 6 ++++++ src/mesa/main/mtypes.h | 6 ++++++ src/mesa/main/tests/enum_strings.cpp | 3 +++ 8 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/mapi/glapi/gen/ARB_texture_gather.xml diff --git a/src/mapi/glapi/gen/ARB_texture_gather.xml b/src/mapi/glapi/gen/ARB_texture_gather.xml new file mode 100644 index 00000000000..01c7b88ff66 --- /dev/null +++ b/src/mapi/glapi/gen/ARB_texture_gather.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index f6511e9878e..3ffa8178756 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -8189,7 +8189,7 @@ - + diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 310518c92f4..0d1f71c7142 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -652,6 +652,10 @@ _mesa_init_constants(struct gl_context *ctx) ctx->Const.MinProgramTexelOffset = -8; ctx->Const.MaxProgramTexelOffset = 7; + /* GL_ARB_texture_gather */ + ctx->Const.MinProgramTextureGatherOffset = -8; + ctx->Const.MaxProgramTextureGatherOffset = 7; + /* GL_ARB_robustness */ ctx->Const.ResetStrategy = GL_NO_RESET_NOTIFICATION_ARB; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 51a8051e2e9..c0f17c5fd03 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -142,6 +142,7 @@ static const struct extension extension_table[] = { { "GL_ARB_texture_env_crossbar", o(ARB_texture_env_crossbar), GLL, 2001 }, { "GL_ARB_texture_env_dot3", o(ARB_texture_env_dot3), GLL, 2001 }, { "GL_ARB_texture_float", o(ARB_texture_float), GL, 2004 }, + { "GL_ARB_texture_gather", o(ARB_texture_gather), GL, 2009 }, { "GL_ARB_texture_mirrored_repeat", o(dummy_true), GLL, 2001 }, { "GL_ARB_texture_multisample", o(ARB_texture_multisample), GL, 2009 }, { "GL_ARB_texture_non_power_of_two", o(ARB_texture_non_power_of_two), GL, 2003 }, diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 7af5f5591a4..89b3bf09ddb 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -366,6 +366,7 @@ EXTRA_EXT(ARB_map_buffer_alignment); EXTRA_EXT(ARB_texture_cube_map_array); EXTRA_EXT(ARB_texture_buffer_range); EXTRA_EXT(ARB_texture_multisample); +EXTRA_EXT(ARB_texture_gather); static const int extra_ARB_color_buffer_float_or_glcore[] = { diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py index 8147dd0b857..29cad26ff28 100644 --- a/src/mesa/main/get_hash_params.py +++ b/src/mesa/main/get_hash_params.py @@ -716,6 +716,12 @@ descriptor=[ # GL_ARB_texture_cube_map_array [ "TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB", "LOC_CUSTOM, TYPE_INT, TEXTURE_CUBE_ARRAY_INDEX, extra_ARB_texture_cube_map_array" ], + +# GL_ARB_texture_gather + [ "MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB", "CONTEXT_INT(Const.MinProgramTextureGatherOffset), extra_ARB_texture_gather"], + [ "MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB", "CONTEXT_INT(Const.MaxProgramTextureGatherOffset), extra_ARB_texture_gather"], + [ "MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB", "CONTEXT_INT(Const.MaxProgramTextureGatherComponents), extra_ARB_texture_gather"], + ]}, # Enums restricted to OpenGL Core profile diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d82672dc99a..3d414d5e76e 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3081,6 +3081,11 @@ struct gl_constants /** GL_EXT_gpu_shader4 */ GLint MinProgramTexelOffset, MaxProgramTexelOffset; + /** GL_ARB_texture_gather */ + GLuint MinProgramTextureGatherOffset; + GLuint MaxProgramTextureGatherOffset; + GLuint MaxProgramTextureGatherComponents; + /* GL_ARB_robustness */ GLenum ResetStrategy; @@ -3210,6 +3215,7 @@ struct gl_extensions GLboolean ARB_texture_env_crossbar; GLboolean ARB_texture_env_dot3; GLboolean ARB_texture_float; + GLboolean ARB_texture_gather; GLboolean ARB_texture_multisample; GLboolean ARB_texture_non_power_of_two; GLboolean ARB_texture_query_lod; diff --git a/src/mesa/main/tests/enum_strings.cpp b/src/mesa/main/tests/enum_strings.cpp index c8df8195644..6994f79fee5 100644 --- a/src/mesa/main/tests/enum_strings.cpp +++ b/src/mesa/main/tests/enum_strings.cpp @@ -1770,6 +1770,8 @@ const struct enum_info everything[] = { { 0x8E51, "GL_SAMPLE_MASK" }, { 0x8E52, "GL_SAMPLE_MASK_VALUE" }, { 0x8E59, "GL_MAX_SAMPLE_MASK_WORDS" }, + { 0x8E5E, "GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET" }, + { 0x8E5F, "GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET" }, { 0x8F36, "GL_COPY_READ_BUFFER" }, { 0x8F37, "GL_COPY_WRITE_BUFFER" }, { 0x8F90, "GL_RED_SNORM" }, @@ -1787,6 +1789,7 @@ const struct enum_info everything[] = { { 0x8F9C, "GL_SIGNED_NORMALIZED" }, { 0x8F9D, "GL_PRIMITIVE_RESTART" }, { 0x8F9E, "GL_PRIMITIVE_RESTART_INDEX" }, + { 0x8F9F, "GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS" }, { 0x906F, "GL_RGB10_A2UI" }, { 0x9100, "GL_TEXTURE_2D_MULTISAMPLE" }, { 0x9101, "GL_PROXY_TEXTURE_2D_MULTISAMPLE" }, -- 2.30.2