[Mesa-dev] [PATCH 1/6] mesa: add texture gather changes

Chris Forbes chrisf at ijw.co.nz
Sun Mar 31 02:10:49 PDT 2013


From: Maxence Le Dore <maxence.ledore at gmail.com>

---
 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 0000000..cd331ac
--- /dev/null
+++ b/src/mapi/glapi/gen/ARB_texture_gather.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<OpenGLAPI>
+
+<category name="GL_ARB_texture_gather" number="72">
+
+ <enum name="MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB" value="0x8E5E"/>
+ <enum name="MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB" value="0x8E5F"/>
+ <enum name="MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB" value="0x8F9F"/>
+
+</category>
+
+</OpenGLAPI>
\ No newline at end of file
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 75957dc..9a957d1 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -8188,7 +8188,7 @@
 
 <!-- 70. GL_ARB_sample_shading -->
 <xi:include href="ARB_texture_cube_map_array.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
-<!-- 72. GL_ARB_texture_gather -->
+<xi:include href="ARB_texture_gather.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
 <!-- 73. GL_ARB_texture_query_lod -->
 
 <!-- ARB extension number 74 is a WGL extension. -->
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 0539934..d4e773b 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -647,6 +647,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 3116692..593ed1a 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -141,6 +141,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 582ef31..a182ab4 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -356,6 +356,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_NV_primitive_restart[] = {
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 7d4f7e2..1941d53 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -709,6 +709,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 e47e835..37e4b61 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2860,6 +2860,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;
 
@@ -2990,6 +2995,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 1dae60f..0c08be0 100644
--- a/src/mesa/main/tests/enum_strings.cpp
+++ b/src/mesa/main/tests/enum_strings.cpp
@@ -1790,6 +1790,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" },
@@ -1807,6 +1809,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" },
-- 
1.8.2



More information about the mesa-dev mailing list