Re: [Mesa-dev] [PATCH] mesa: add GL_OES_texture_border_clamp support

2016-02-16 Thread Ilia Mirkin
On Tue, Feb 16, 2016 at 11:24 AM, Ian Romanick  wrote:
> On 02/15/2016 04:14 PM, Ilia Mirkin wrote:
>> Only minor differences to the existing ARB_texture_border_clamp support.
>>
>> Signed-off-by: Ilia Mirkin 
>> ---
>>
>> I get 53 failures (and 548 passes) in the dEQP tests, they appear to expect
>> all-red for depth texturing while gallium apparently returns gray. Haven't
>> figured out if it's the fault of the tests or the implementation.
>
> This is a known change from compatibility profile desktop OpenGL to
> GLES3 and core profile.  In compatibility, the default color format for
> depth textures is GL_INTENSITY.  Since GL_INTENSITY is removed or
> deprecated everywhere else, the color format for depth textures is GL_RED.
>
> See commit 9db2098d.

Wow, thanks for that! Should hopefully be an easy fix then.

>
>> (I also had to claim it was the EXT version of the ext, and hack up dEQP to
>> pull the *OES functions instead of the *EXT ones.)
>
> I looked at the two specs.  Doing
>
>diff -wud gles/extensions/EXT/EXT_texture_border_clamp.txt <(sed
> 's/OES/EXT/g' < gles/extensions/OES/OES_texture_border_clamp.txt)
>
> showed basically no differences.  Maybe we should just expose both?  I
> could probably also be convinced that we should expose the NV extension.
>  The textual differences were quite a bit larger, but that appears to be
> because the EXT and OES extensions add interactions with GLES 3.0.

Happy to do whatever. I was under the impression that only OES exts
should be exposed, but like you said, it's identical to the EXT one.
Let me know.

>
> I haven't check the piglit list yet... are there any piglits for the OES
> version (or just dEQP)?

Just dEQP. I wasn't planning on writing piglit tests.

>
>>  docs/GL3.txt|  2 +-
>>  src/mapi/glapi/gen/es_EXT.xml   | 58 
>> -
>>  src/mesa/main/extensions_table.h|  1 +
>>  src/mesa/main/samplerobj.c  |  6 ++--
>>  src/mesa/main/tests/dispatch_sanity.cpp | 10 ++
>>  src/mesa/main/texparam.c| 11 ---
>>  6 files changed, 80 insertions(+), 8 deletions(-)
>>
>> diff --git a/docs/GL3.txt b/docs/GL3.txt
>> index ea7ceef..0957247 100644
>> --- a/docs/GL3.txt
>> +++ b/docs/GL3.txt
>> @@ -253,7 +253,7 @@ GLES3.2, GLSL ES 3.2
>>GL_OES_shader_io_blocks  not started (based 
>> on parts of GLSL 1.50, which is done)
>>GL_OES_shader_multisample_interpolation  not started (based 
>> on parts of GL_ARB_gpu_shader5, which is done)
>>GL_OES_tessellation_shader   not started (based 
>> on GL_ARB_tessellation_shader, which is done for some drivers)
>> -  GL_OES_texture_border_clamp  not started (based 
>> on GL_ARB_texture_border_clamp, which is done)
>> +  GL_OES_texture_border_clamp  DONE (all drivers)
>>GL_OES_texture_buffernot started (based 
>> on GL_ARB_texture_buffer_object, GL_ARB_texture_buffer_range, and 
>> GL_ARB_texture_buffer_object_rgb32 that are all done)
>>GL_OES_texture_cube_map_arraynot started (based 
>> on GL_ARB_texture_cube_map_array, which is done for all drivers)
>>GL_OES_texture_stencil8  not started (based 
>> on GL_ARB_texture_stencil8, which is done for some drivers)
>> diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
>> index 86df980..fb0ef05 100644
>> --- a/src/mapi/glapi/gen/es_EXT.xml
>> +++ b/src/mapi/glapi/gen/es_EXT.xml
>> @@ -982,5 +982,61 @@
>>  
>>  
>>  
>> -  
>> +
>> +
>> +
>> +
>> +
>> +
>> +
>> +
>> +
>> +
>> +
>> +
>> +
>> +
>> +
>> +
>> +
>> +
>> +
>> +> alias="GetTexParameterIiv">
>> +
>> +
>> +
>> +
>> +
>> +> alias="GetTexParameterIuiv">
>> +
>> +
>> +
>> +
>> +
>> +> alias="SamplerParameterIiv">
>> +  
>> +  
>> +  
>> +
>> +
>> +> alias="SamplerParameterIuiv">
>> +  
>> +  
>> +  
>> +
>> +
>> +> alias="GetSamplerParameterIiv">
>> +  
>> +  
>> +  
>> +
>> +
>> +> alias="GetSamplerParameterIuiv">
>> +  
>> +  
>> +  
>> +
>> +
>> +
>> +
>>  
>> diff --git a/src/mesa/main/extensions_table.h 
>> b/src/mesa/main/extensions_table.h
>> index d1e3a99..b07d635 100644
>> --- a/src/mesa/main/extensions_table.h
>> +++ b/src/mesa/main/extensions_table.h
>> @@ -333,6 +333,7 @@ EXT(OES_stencil8, dummy_true
>>  EXT(OES_stencil_wrap, dummy_true
>>  ,  x ,  x , ES1,  x , 2002)
>>  EXT(OES_surfaceless_context , dummy_true
>>  ,  x ,  x , ES1, ES2, 2012)
>>  EXT(OES_texture_3D   

Re: [Mesa-dev] [PATCH] mesa: add GL_OES_texture_border_clamp support

2016-02-16 Thread Ian Romanick
On 02/15/2016 04:14 PM, Ilia Mirkin wrote:
> Only minor differences to the existing ARB_texture_border_clamp support.
> 
> Signed-off-by: Ilia Mirkin 
> ---
> 
> I get 53 failures (and 548 passes) in the dEQP tests, they appear to expect
> all-red for depth texturing while gallium apparently returns gray. Haven't
> figured out if it's the fault of the tests or the implementation.

This is a known change from compatibility profile desktop OpenGL to
GLES3 and core profile.  In compatibility, the default color format for
depth textures is GL_INTENSITY.  Since GL_INTENSITY is removed or
deprecated everywhere else, the color format for depth textures is GL_RED.

See commit 9db2098d.

> (I also had to claim it was the EXT version of the ext, and hack up dEQP to
> pull the *OES functions instead of the *EXT ones.)

I looked at the two specs.  Doing

   diff -wud gles/extensions/EXT/EXT_texture_border_clamp.txt <(sed
's/OES/EXT/g' < gles/extensions/OES/OES_texture_border_clamp.txt)

showed basically no differences.  Maybe we should just expose both?  I
could probably also be convinced that we should expose the NV extension.
 The textual differences were quite a bit larger, but that appears to be
because the EXT and OES extensions add interactions with GLES 3.0.

I haven't check the piglit list yet... are there any piglits for the OES
version (or just dEQP)?

>  docs/GL3.txt|  2 +-
>  src/mapi/glapi/gen/es_EXT.xml   | 58 
> -
>  src/mesa/main/extensions_table.h|  1 +
>  src/mesa/main/samplerobj.c  |  6 ++--
>  src/mesa/main/tests/dispatch_sanity.cpp | 10 ++
>  src/mesa/main/texparam.c| 11 ---
>  6 files changed, 80 insertions(+), 8 deletions(-)
> 
> diff --git a/docs/GL3.txt b/docs/GL3.txt
> index ea7ceef..0957247 100644
> --- a/docs/GL3.txt
> +++ b/docs/GL3.txt
> @@ -253,7 +253,7 @@ GLES3.2, GLSL ES 3.2
>GL_OES_shader_io_blocks  not started (based on 
> parts of GLSL 1.50, which is done)
>GL_OES_shader_multisample_interpolation  not started (based on 
> parts of GL_ARB_gpu_shader5, which is done)
>GL_OES_tessellation_shader   not started (based on 
> GL_ARB_tessellation_shader, which is done for some drivers)
> -  GL_OES_texture_border_clamp  not started (based on 
> GL_ARB_texture_border_clamp, which is done)
> +  GL_OES_texture_border_clamp  DONE (all drivers)
>GL_OES_texture_buffernot started (based on 
> GL_ARB_texture_buffer_object, GL_ARB_texture_buffer_range, and 
> GL_ARB_texture_buffer_object_rgb32 that are all done)
>GL_OES_texture_cube_map_arraynot started (based on 
> GL_ARB_texture_cube_map_array, which is done for all drivers)
>GL_OES_texture_stencil8  not started (based on 
> GL_ARB_texture_stencil8, which is done for some drivers)
> diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
> index 86df980..fb0ef05 100644
> --- a/src/mapi/glapi/gen/es_EXT.xml
> +++ b/src/mapi/glapi/gen/es_EXT.xml
> @@ -982,5 +982,61 @@
>  
>  
>  
> -  
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> + alias="GetTexParameterIiv">
> +
> +
> +
> +
> +
> + alias="GetTexParameterIuiv">
> +
> +
> +
> +
> +
> + alias="SamplerParameterIiv">
> +  
> +  
> +  
> +
> +
> + alias="SamplerParameterIuiv">
> +  
> +  
> +  
> +
> +
> + alias="GetSamplerParameterIiv">
> +  
> +  
> +  
> +
> +
> + alias="GetSamplerParameterIuiv">
> +  
> +  
> +  
> +
> +
> +
> +
>  
> diff --git a/src/mesa/main/extensions_table.h 
> b/src/mesa/main/extensions_table.h
> index d1e3a99..b07d635 100644
> --- a/src/mesa/main/extensions_table.h
> +++ b/src/mesa/main/extensions_table.h
> @@ -333,6 +333,7 @@ EXT(OES_stencil8, dummy_true
>  EXT(OES_stencil_wrap, dummy_true 
> ,  x ,  x , ES1,  x , 2002)
>  EXT(OES_surfaceless_context , dummy_true 
> ,  x ,  x , ES1, ES2, 2012)
>  EXT(OES_texture_3D  , dummy_true 
> ,  x ,  x ,  x , ES2, 2005)
> +EXT(OES_texture_border_clamp, ARB_texture_border_clamp   
> ,  x ,  x ,  x , ES2, 2014)
>  EXT(OES_texture_cube_map, ARB_texture_cube_map   
> ,  x ,  x , ES1,  x , 2007)
>  EXT(OES_texture_env_crossbar, ARB_texture_env_crossbar   
> ,  x ,  x , ES1,  x , 2005)
>  EXT(OES_texture_float   , 

[Mesa-dev] [PATCH] mesa: add GL_OES_texture_border_clamp support

2016-02-15 Thread Ilia Mirkin
Only minor differences to the existing ARB_texture_border_clamp support.

Signed-off-by: Ilia Mirkin 
---

I get 53 failures (and 548 passes) in the dEQP tests, they appear to expect
all-red for depth texturing while gallium apparently returns gray. Haven't
figured out if it's the fault of the tests or the implementation.

(I also had to claim it was the EXT version of the ext, and hack up dEQP to
pull the *OES functions instead of the *EXT ones.)

 docs/GL3.txt|  2 +-
 src/mapi/glapi/gen/es_EXT.xml   | 58 -
 src/mesa/main/extensions_table.h|  1 +
 src/mesa/main/samplerobj.c  |  6 ++--
 src/mesa/main/tests/dispatch_sanity.cpp | 10 ++
 src/mesa/main/texparam.c| 11 ---
 6 files changed, 80 insertions(+), 8 deletions(-)

diff --git a/docs/GL3.txt b/docs/GL3.txt
index ea7ceef..0957247 100644
--- a/docs/GL3.txt
+++ b/docs/GL3.txt
@@ -253,7 +253,7 @@ GLES3.2, GLSL ES 3.2
   GL_OES_shader_io_blocks  not started (based on 
parts of GLSL 1.50, which is done)
   GL_OES_shader_multisample_interpolation  not started (based on 
parts of GL_ARB_gpu_shader5, which is done)
   GL_OES_tessellation_shader   not started (based on 
GL_ARB_tessellation_shader, which is done for some drivers)
-  GL_OES_texture_border_clamp  not started (based on 
GL_ARB_texture_border_clamp, which is done)
+  GL_OES_texture_border_clamp  DONE (all drivers)
   GL_OES_texture_buffernot started (based on 
GL_ARB_texture_buffer_object, GL_ARB_texture_buffer_range, and 
GL_ARB_texture_buffer_object_rgb32 that are all done)
   GL_OES_texture_cube_map_arraynot started (based on 
GL_ARB_texture_cube_map_array, which is done for all drivers)
   GL_OES_texture_stencil8  not started (based on 
GL_ARB_texture_stencil8, which is done for some drivers)
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
index 86df980..fb0ef05 100644
--- a/src/mapi/glapi/gen/es_EXT.xml
+++ b/src/mapi/glapi/gen/es_EXT.xml
@@ -982,5 +982,61 @@
 
 
 
-  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+  
+  
+
+
+
+  
+  
+  
+
+
+
+  
+  
+  
+
+
+
+  
+  
+  
+
+
+
+
 
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index d1e3a99..b07d635 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -333,6 +333,7 @@ EXT(OES_stencil8, dummy_true
 EXT(OES_stencil_wrap, dummy_true   
  ,  x ,  x , ES1,  x , 2002)
 EXT(OES_surfaceless_context , dummy_true   
  ,  x ,  x , ES1, ES2, 2012)
 EXT(OES_texture_3D  , dummy_true   
  ,  x ,  x ,  x , ES2, 2005)
+EXT(OES_texture_border_clamp, ARB_texture_border_clamp 
  ,  x ,  x ,  x , ES2, 2014)
 EXT(OES_texture_cube_map, ARB_texture_cube_map 
  ,  x ,  x , ES1,  x , 2007)
 EXT(OES_texture_env_crossbar, ARB_texture_env_crossbar 
  ,  x ,  x , ES1,  x , 2005)
 EXT(OES_texture_float   , OES_texture_float
  ,  x ,  x ,  x , ES2, 2005)
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index fe15508..ca366d9 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -1518,7 +1518,8 @@ _mesa_GetSamplerParameterIiv(GLuint sampler, GLenum 
pname, GLint *params)
 
sampObj = _mesa_lookup_samplerobj(ctx, sampler);
if (!sampObj) {
-  _mesa_error(ctx, GL_INVALID_VALUE,
+  _mesa_error(ctx, (_mesa_is_gles(ctx) ?
+GL_INVALID_OPERATION : GL_INVALID_VALUE),
   "glGetSamplerParameterIiv(sampler %u)",
   sampler);
   return;
@@ -1593,7 +1594,8 @@ _mesa_GetSamplerParameterIuiv(GLuint sampler, GLenum 
pname, GLuint *params)
 
sampObj = _mesa_lookup_samplerobj(ctx, sampler);
if (!sampObj) {
-  _mesa_error(ctx, GL_INVALID_VALUE,
+  _mesa_error(ctx, (_mesa_is_gles(ctx) ?
+GL_INVALID_OPERATION : GL_INVALID_VALUE),
   "glGetSamplerParameterIuiv(sampler %u)",
   sampler);
   return;
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp 
b/src/mesa/main/tests/dispatch_sanity.cpp
index e641296..24e3d18 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -2436,6 +2436,16 @@ const struct