[Mesa-dev] [PATCH 11/14] mesa: add API dispatch for GL_ARB_get_texture_sub_image

Roland Scheidegger sroland at vmware.com
Wed Jul 15 19:14:18 PDT 2015


Am 16.07.2015 um 02:18 schrieb Ilia Mirkin:
> On Wed, Jul 15, 2015 at 7:40 PM, Brian Paul <brianp at vmware.com> wrote:
>> This adds the new glGetTextureSubImage() and
>> glGetCompressedTextureSubImage() functions.  Also update the
>> dispatch sanity test program.
>>
>> v2: remove stray brace, move xi:include line in gl_API.xml, fix extension
>> number typo, s/program/texture/ in xml file.
>> ---
>>  src/mapi/glapi/gen/ARB_get_texture_sub_image.xml | 40 ++++++++++++++++++++++++
>>  src/mapi/glapi/gen/Makefile.am                   |  1 +
>>  src/mapi/glapi/gen/gl_API.xml                    |  4 ++-
>>  src/mesa/main/tests/dispatch_sanity.cpp          |  5 +++
>>  4 files changed, 49 insertions(+), 1 deletion(-)
>>  create mode 100644 src/mapi/glapi/gen/ARB_get_texture_sub_image.xml
>>
>> diff --git a/src/mapi/glapi/gen/ARB_get_texture_sub_image.xml b/src/mapi/glapi/gen/ARB_get_texture_sub_image.xml
>> new file mode 100644
>> index 0000000..14e1c20
>> --- /dev/null
>> +++ b/src/mapi/glapi/gen/ARB_get_texture_sub_image.xml
>> @@ -0,0 +1,40 @@
>> +<?xml version="1.0"?>
>> +<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
>> +
>> +<!-- This is included by gl_and_es_API.xml.  Could be moved to gl_API.xml. -->
>> +
>> +<OpenGLAPI>
>> +
>> +<category name="GL_ARB_get_texture_sub_image" number="165">
>> +
>> +    <function name="GetTextureSubImage" offset="assign">
>> +        <param name="texture" type="GLuint"/>
>> +        <param name="level" type="GLint"/>
>> +        <param name="xoffset" type="GLint"/>
>> +        <param name="yoffset" type="GLint"/>
>> +        <param name="zoffset" type="GLint"/>
>> +        <param name="width" type="GLsizei"/>
>> +        <param name="height" type="GLsizei"/>
>> +        <param name="depth" type="GLsizei"/>
>> +        <param name="format" type="GLenum"/>
>> +        <param name="type" type="GLenum"/>
>> +        <param name="bufSize" type="GLsizei"/>
>> +        <param name="pixels" type="GLvoid *"/>
>> +    </function>
>> +
>> +    <function name="GetCompressedTextureSubImage" offset="assign">
>> +        <param name="texture" type="GLuint"/>
>> +        <param name="level" type="GLint"/>
>> +        <param name="xoffset" type="GLint"/>
>> +        <param name="yoffset" type="GLint"/>
>> +        <param name="zoffset" type="GLint"/>
>> +        <param name="width" type="GLsizei"/>
>> +        <param name="height" type="GLsizei"/>
>> +        <param name="depth" type="GLsizei"/>
>> +        <param name="bufSize" type="GLsizei"/>
>> +        <param name="pixels" type="GLvoid *"/>
>> +    </function>
>> +
>> +</category>
>> +
>> +</OpenGLAPI>
>> diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am
>> index 5b163b0..170898c 100644
>> --- a/src/mapi/glapi/gen/Makefile.am
>> +++ b/src/mapi/glapi/gen/Makefile.am
>> @@ -135,6 +135,7 @@ API_XML = \
>>         ARB_framebuffer_object.xml \
>>         ARB_geometry_shader4.xml \
>>         ARB_get_program_binary.xml \
>> +       ARB_get_texture_sub_image.xml \
>>         ARB_gpu_shader_fp64.xml \
>>         ARB_gpu_shader5.xml \
>>         ARB_instanced_arrays.xml \
>> diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
>> index 2f33075..eb8c72a 100644
>> --- a/src/mapi/glapi/gen/gl_API.xml
>> +++ b/src/mapi/glapi/gen/gl_API.xml
>> @@ -8253,7 +8253,9 @@
>>
>>  <xi:include href="ARB_direct_state_access.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
>>
>> -<!-- ARB extensions 165 - 166 -->
>> +<xi:include href="ARB_get_texture_sub_image.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
>> +
>> +<!-- ARB extension 166 -->
>>
>>  <xi:include href="ARB_texture_barrier.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
>>
>> diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
>> index 800720b..cc89acb 100644
>> --- a/src/mesa/main/tests/dispatch_sanity.cpp
>> +++ b/src/mesa/main/tests/dispatch_sanity.cpp
>> @@ -930,6 +930,11 @@ const struct function common_desktop_functions_possible[] = {
>>
>>     /* GL_EXT_polygon_offset_clamp */
>>     { "glPolygonOffsetClampEXT", 11, -1 },
>> +
>> +   /* GL_ARB_get_texture_sub_image */
>> +   { "glGetTextureSubImage", 12, -1 },
>> +   { "glGetCompressedTextureSubImage", 12, -1 },
> 
> That should be 20, not 12 -- the ext spec requires GL 2.0, and all
> your piglits do too.
> 
> With that fixed, this patch is
> 
> Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
> 
> [of course this does mean that it'll get exposed on drivers that don't
> expose GL 2.0 but... meh]

I don't actually see why it's a hard requirement (other than at this
point probably noone is interested in new extensions for pre-2.0
drivers). There's a couple of things in the extension which require at
least 1.3 (cube maps, compressed textures), but even those are waved
away by the dependency section (together with the array textures which
would require newer GL version). But I might be missing something why it
couldn't possibly work with older versions. But anyway, seems like a
pretty academical point indeed.

Roland



>> +
>>     { NULL, 0, -1 }
>>  };
>>
>> --
>> 1.9.1
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=Vjtt0vs_iqoI31UfJxBl7yv9I2FeiaeAYgMTLKRBc_I&m=Z4otm2Wbhybr5Zf7Qk4YsoT9tKDRKnsMQLxYYFLrAVI&s=8KIIR6NcN6WeDJXRhiwnvBOLEFesg1by-Oo6cHxhllg&e= 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=BQIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=Vjtt0vs_iqoI31UfJxBl7yv9I2FeiaeAYgMTLKRBc_I&m=Z4otm2Wbhybr5Zf7Qk4YsoT9tKDRKnsMQLxYYFLrAVI&s=8KIIR6NcN6WeDJXRhiwnvBOLEFesg1by-Oo6cHxhllg&e= 
> 



More information about the mesa-dev mailing list