[Mesa-dev] [PATCH] Add support for GL_EXT_unpack_subimage on GLES2

Ian Romanick idr at freedesktop.org
Thu Mar 22 10:56:09 PDT 2012


On 03/21/2012 11:08 AM, Neil Roberts wrote:
> This extension just permits GL_UNPACK_ROW_LENGTH, GL_UNPACK_SKIP_ROWS
> and GL_UNPACK_SKIP_PIXELS to be passed to glPixelStore on GLES2 so it
> is trivial to implement.

I'm not a fan of the wrappers generated from APIspec.xml.  It allowed 
quick implementation of the extra enum rejection required by ES, but 
it's a real hassle.  Unfortunately, I think it will be a much larger 
effort, especially for some of the commands that take a lot of different 
enums, to kill it off completely.  Ugh.

Is there any chance you could code up a quick piglit test that verifies 
that 1, 2, 4, and 8 can be used if the extension is available but are 
rejected if it is not?

When planning some of our work for the next couple months we talked 
about enabling some desktop-GL-on-ES extensions, but we eventually 
tabled the idea.  Are there other of these extensions that you would 
find useful?

> ---
>   src/mesa/main/APIspec.xml  |   26 +++++++++++++++++++++-----
>   src/mesa/main/extensions.c |    1 +
>   2 files changed, 22 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/main/APIspec.xml b/src/mesa/main/APIspec.xml
> index eeae599..950ff22 100644
> --- a/src/mesa/main/APIspec.xml
> +++ b/src/mesa/main/APIspec.xml
> @@ -1174,15 +1174,30 @@
>
>   	<desc name="pname">
>   		<value name="GL_PACK_ALIGNMENT"/>
> +		<desc name="param" error="GL_INVALID_VALUE">
> +			<value name="1"/>
> +			<value name="2"/>
> +			<value name="4"/>
> +			<value name="8"/>
> +		</desc>

I want to make sure I understand this code.  This causes additional 
checks for 1, 2, 4, and 8 to be generated.  The assumption is that the 
other values are already invalid, and the core implementation will 
reject them (as it already does for desktop GL).  Is that right?

> +	</desc>
> +
> +	<desc name="pname">
>   		<value name="GL_UNPACK_ALIGNMENT"/>
> +		<desc name="param" error="GL_INVALID_VALUE">
> +			<value name="1"/>
> +			<value name="2"/>
> +			<value name="4"/>
> +			<value name="8"/>
> +		</desc>
>   	</desc>
>
> -	<desc name="param" error="GL_INVALID_VALUE">
> -		<value name="1"/>
> -		<value name="2"/>
> -		<value name="4"/>
> -		<value name="8"/>
> +	<desc name="pname" category="EXT_unpack_subimage">
> +		<value name="GL_UNPACK_ROW_LENGTH"/>
> +		<value name="GL_UNPACK_SKIP_PIXELS"/>
> +		<value name="GL_UNPACK_SKIP_ROWS"/>
>   	</desc>
> +
>   </template>
>
>   <template name="ReadPixels" direction="get">
> @@ -4129,6 +4144,7 @@
>   	<category name="EXT_multi_draw_arrays"/>
>   	<category name="OES_EGL_image"/>
>   	<category name="OES_EGL_image_external"/>
> +<category name="EXT_unpack_subimage"/>
>
>   	<category name="NV_draw_buffers"/>
>   	<function name="DrawBuffersNV" template="DrawBuffers"/>
> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
> index 732b9a6..a93081d 100644
> --- a/src/mesa/main/extensions.c
> +++ b/src/mesa/main/extensions.c
> @@ -212,6 +212,7 @@ static const struct extension extension_table[] = {
>      { "GL_EXT_texture_type_2_10_10_10_REV",         o(dummy_true),                                         ES2, 2008 },
>      { "GL_EXT_timer_query",                         o(EXT_timer_query),                         GL,             2006 },
>      { "GL_EXT_transform_feedback",                  o(EXT_transform_feedback),                  GL,             2011 },
> +   { "GL_EXT_unpack_subimage",                     o(dummy_true),                                         ES2, 2011 },
>      { "GL_EXT_vertex_array_bgra",                   o(EXT_vertex_array_bgra),                   GL,             2008 },
>      { "GL_EXT_vertex_array",                        o(dummy_true),                              GL,             1995 },
>


More information about the mesa-dev mailing list