Re: [Piglit] [PATCH] Add a test for instanced GS inputs.

2018-07-09 Thread andrey simiklit
Hello,

Thanks for review)

Regards,
Andrii.

On Wed, Jun 27, 2018 at 6:18 AM, Timothy Arceri 
wrote:

> On 22/06/18 18:36, andrii.simiklit wrote:
>
>> Hello,
>>
>> It would be great If somebody could take a look this test)
>> This test against following bug:
>> https://bugs.freedesktop.org/show_bug.cgi?id=96354
>>
>
> I've clean up the description, removed some trailing spaces and pushed
> this test.
>
> Thanks!
>
>
>> Regards,
>> Andrii.
>>
>> On 05.06.18 16:33, Andrii Simiklit wrote:
>>
>> All of our other tests for instanced geometry shaders don't actually
>>> transfer the vertices to the geometry shader
>>> from the vertex shader using gl_Position.
>>> This used to be broken with the i965 driver's in Mesa 12.1.0
>>> on revision d10ae20b9678f1a5b8a81716c68e612662665277.
>>> This test should give us ability to detect
>>> such kind of bugs like 96354 bug in future.
>>>
>>> Signed-off-by: Andrii Simiklit 
>>> ---
>>>   .../instanced-inputs-built-in-variable.shader_test | 68
>>> ++
>>>   1 file changed, 68 insertions(+)
>>>   create mode 100644 tests/spec/arb_gpu_shader5/exe
>>> cution/instanced-inputs-built-in-variable.shader_test
>>>
>>> diff --git 
>>> a/tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test
>>> b/tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test
>>>
>>> new file mode 100644
>>> index 000..86b2bbd
>>> --- /dev/null
>>> +++ 
>>> b/tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test
>>>
>>> @@ -0,0 +1,68 @@
>>> +#It seems as duplicate of the "instanced-inputs.shader_test" test but
>>> it could not detect the bug 96354.
>>> +#It could detect the 96354 bug if and only if vertices are transferred
>>> +#from vertex shader into geometry shader through built-in variable
>>> gl_Position.
>>> +#
>>> +#Specification permits us to do it "11.3.4.4 Geometry Shader Inputs:
>>> +#Structure member gl_Position holds the per-vertex position, as
>>> written
>>> +#by the vertex shader to its built-in output variable gl_Position.
>>> +#Note that writing to gl_Position from either the vertex or
>>> geometry shader is
>>> +#optional (also see section 7.1(“Built-In Variables”) of the OpenGL
>>> Shading Language Specification)"
>>> +
>>> +[require]
>>> +GL >= 2.0
>>> +GLSL >= 1.50
>>> +GL_ARB_gpu_shader5
>>> +
>>> +[vertex shader]
>>> +in vec4 vertex;
>>> +
>>> +void main()
>>> +{
>>> +   gl_Position = vertex;
>>> +}
>>> +
>>> +[geometry shader]
>>> +#extension GL_ARB_gpu_shader5 : require
>>> +layout(triangles) in;
>>> +layout(triangle_strip, max_vertices = 3) out;
>>> +layout(invocations = 4) in;
>>> +
>>> +void main()
>>> +{
>>> +   vec2 offset;
>>> +   if (gl_InvocationID == 0)
>>> +  offset.xy = vec2(-0.5, -0.5);
>>> +   else if (gl_InvocationID == 1)
>>> +  offset.xy = vec2( 0.5, -0.5);
>>> +   else if (gl_InvocationID == 2)
>>> +  offset.xy = vec2(-0.5,  0.5);
>>> +   else if (gl_InvocationID == 3)
>>> +  offset.xy = vec2( 0.5,  0.5);
>>> +
>>> +   for (int i = 0; i < 3; i++) {
>>> +   gl_Position = gl_in[i].gl_Position;
>>> +   gl_Position.xy += offset;
>>> +   EmitVertex();
>>> +   }
>>> +}
>>> +
>>> +[fragment shader]
>>> +void main()
>>> +{
>>> +   gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
>>> +}
>>> +
>>> +[vertex data]
>>> +vertex/float/2
>>> +-0.5 -0.5
>>> + 0.5 -0.5
>>> +-0.5  0.0
>>> + 0.5  0.0
>>> +-0.5  0.5
>>> + 0.5  0.5
>>> +
>>> +[test]
>>> +clear color 0.0 0.0 0.0 0.0
>>> +clear
>>> +draw arrays GL_TRIANGLE_STRIP 0 6
>>> +probe all rgba 0.0 1.0 0.0 1.0
>>> \ No newline at end of file
>>>
>>
>> ___
>> Piglit mailing list
>> Piglit@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/piglit
>>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] Add a test for instanced GS inputs.

2018-06-26 Thread Timothy Arceri

On 22/06/18 18:36, andrii.simiklit wrote:

Hello,

It would be great If somebody could take a look this test)
This test against following bug:
https://bugs.freedesktop.org/show_bug.cgi?id=96354


I've clean up the description, removed some trailing spaces and pushed 
this test.


Thanks!



Regards,
Andrii.

On 05.06.18 16:33, Andrii Simiklit wrote:


    All of our other tests for instanced geometry shaders don't actually
    transfer the vertices to the geometry shader
    from the vertex shader using gl_Position.
    This used to be broken with the i965 driver's in Mesa 12.1.0
    on revision d10ae20b9678f1a5b8a81716c68e612662665277.
    This test should give us ability to detect
    such kind of bugs like 96354 bug in future.

Signed-off-by: Andrii Simiklit 
---
  .../instanced-inputs-built-in-variable.shader_test | 68 
++

  1 file changed, 68 insertions(+)
  create mode 100644 
tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test 



diff --git 
a/tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test 
b/tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test 


new file mode 100644
index 000..86b2bbd
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test 


@@ -0,0 +1,68 @@
+#It seems as duplicate of the "instanced-inputs.shader_test" test but 
it could not detect the bug 96354.

+#It could detect the 96354 bug if and only if vertices are transferred
+#from vertex shader into geometry shader through built-in variable 
gl_Position.

+#
+#Specification permits us to do it "11.3.4.4 Geometry Shader Inputs:
+#    Structure member gl_Position holds the per-vertex position, as 
written

+#    by the vertex shader to its built-in output variable gl_Position.
+#    Note that writing to gl_Position from either the vertex or 
geometry shader is
+#    optional (also see section 7.1(“Built-In Variables”) of the 
OpenGL Shading Language Specification)"

+
+[require]
+GL >= 2.0
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader]
+in vec4 vertex;
+
+void main()
+{
+   gl_Position = vertex;
+}
+
+[geometry shader]
+#extension GL_ARB_gpu_shader5 : require
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+layout(invocations = 4) in;
+
+void main()
+{
+   vec2 offset;
+   if (gl_InvocationID == 0)
+  offset.xy = vec2(-0.5, -0.5);
+   else if (gl_InvocationID == 1)
+  offset.xy = vec2( 0.5, -0.5);
+   else if (gl_InvocationID == 2)
+  offset.xy = vec2(-0.5,  0.5);
+   else if (gl_InvocationID == 3)
+  offset.xy = vec2( 0.5,  0.5);
+
+   for (int i = 0; i < 3; i++) {
+   gl_Position = gl_in[i].gl_Position;
+   gl_Position.xy += offset;
+   EmitVertex();
+   }
+}
+
+[fragment shader]
+void main()
+{
+   gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2
+-0.5 -0.5
+ 0.5 -0.5
+-0.5  0.0
+ 0.5  0.0
+-0.5  0.5
+ 0.5  0.5
+
+[test]
+clear color 0.0 0.0 0.0 0.0
+clear
+draw arrays GL_TRIANGLE_STRIP 0 6
+probe all rgba 0.0 1.0 0.0 1.0
\ No newline at end of file


___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] Add a test for instanced GS inputs.

2018-06-22 Thread andrii.simiklit

Hello,

It would be great If somebody could take a look this test)
This test against following bug:
https://bugs.freedesktop.org/show_bug.cgi?id=96354

Regards,
Andrii.

On 05.06.18 16:33, Andrii Simiklit wrote:


All of our other tests for instanced geometry shaders don't actually
transfer the vertices to the geometry shader
from the vertex shader using gl_Position.
This used to be broken with the i965 driver's in Mesa 12.1.0
on revision d10ae20b9678f1a5b8a81716c68e612662665277.
This test should give us ability to detect
such kind of bugs like 96354 bug in future.

Signed-off-by: Andrii Simiklit 
---
  .../instanced-inputs-built-in-variable.shader_test | 68 ++
  1 file changed, 68 insertions(+)
  create mode 100644 
tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test

diff --git 
a/tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test
 
b/tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test
new file mode 100644
index 000..86b2bbd
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test
@@ -0,0 +1,68 @@
+#It seems as duplicate of the "instanced-inputs.shader_test" test but it could 
not detect the bug 96354.
+#It could detect the 96354 bug if and only if vertices are transferred
+#from vertex shader into geometry shader through built-in variable gl_Position.
+#
+#Specification permits us to do it "11.3.4.4 Geometry Shader Inputs:
+#Structure member gl_Position holds the per-vertex position, as written
+#by the vertex shader to its built-in output variable gl_Position.
+#Note that writing to gl_Position from either the vertex or geometry 
shader is
+#optional (also see section 7.1(“Built-In Variables”) of the OpenGL Shading 
Language Specification)"
+
+[require]
+GL >= 2.0
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader]
+in vec4 vertex;
+
+void main()
+{
+   gl_Position = vertex;
+}
+
+[geometry shader]
+#extension GL_ARB_gpu_shader5 : require
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+layout(invocations = 4) in;
+
+void main()
+{
+   vec2 offset;
+   if (gl_InvocationID == 0)
+  offset.xy = vec2(-0.5, -0.5);
+   else if (gl_InvocationID == 1)
+  offset.xy = vec2( 0.5, -0.5);
+   else if (gl_InvocationID == 2)
+  offset.xy = vec2(-0.5,  0.5);
+   else if (gl_InvocationID == 3)
+  offset.xy = vec2( 0.5,  0.5);
+
+   for (int i = 0; i < 3; i++) {
+   gl_Position = gl_in[i].gl_Position;
+   gl_Position.xy += offset;
+   EmitVertex();
+   }
+}
+
+[fragment shader]
+void main()
+{
+   gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2
+-0.5 -0.5
+ 0.5 -0.5
+-0.5  0.0
+ 0.5  0.0
+-0.5  0.5
+ 0.5  0.5
+
+[test]
+clear color 0.0 0.0 0.0 0.0
+clear
+draw arrays GL_TRIANGLE_STRIP 0 6
+probe all rgba 0.0 1.0 0.0 1.0
\ No newline at end of file


___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Add a test for instanced GS inputs.

2018-06-05 Thread Andrii Simiklit
   All of our other tests for instanced geometry shaders don't actually
   transfer the vertices to the geometry shader
   from the vertex shader using gl_Position.
   This used to be broken with the i965 driver's in Mesa 12.1.0
   on revision d10ae20b9678f1a5b8a81716c68e612662665277.
   This test should give us ability to detect
   such kind of bugs like 96354 bug in future.

Signed-off-by: Andrii Simiklit 
---
 .../instanced-inputs-built-in-variable.shader_test | 68 ++
 1 file changed, 68 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test

diff --git 
a/tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test
 
b/tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test
new file mode 100644
index 000..86b2bbd
--- /dev/null
+++ 
b/tests/spec/arb_gpu_shader5/execution/instanced-inputs-built-in-variable.shader_test
@@ -0,0 +1,68 @@
+#It seems as duplicate of the "instanced-inputs.shader_test" test but it could 
not detect the bug 96354.
+#It could detect the 96354 bug if and only if vertices are transferred 
+#from vertex shader into geometry shader through built-in variable 
gl_Position. 
+#
+#Specification permits us to do it "11.3.4.4 Geometry Shader Inputs:
+#Structure member gl_Position holds the per-vertex position, as written
+#by the vertex shader to its built-in output variable gl_Position. 
+#Note that writing to gl_Position from either the vertex or geometry 
shader is 
+#optional (also see section 7.1(“Built-In Variables”) of the OpenGL 
Shading Language Specification)"
+
+[require]
+GL >= 2.0
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader]
+in vec4 vertex;
+
+void main()
+{   
+   gl_Position = vertex;
+}
+
+[geometry shader]
+#extension GL_ARB_gpu_shader5 : require
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+layout(invocations = 4) in;
+
+void main()
+{
+   vec2 offset;
+   if (gl_InvocationID == 0)
+  offset.xy = vec2(-0.5, -0.5);
+   else if (gl_InvocationID == 1)
+  offset.xy = vec2( 0.5, -0.5);
+   else if (gl_InvocationID == 2)
+  offset.xy = vec2(-0.5,  0.5);
+   else if (gl_InvocationID == 3)
+  offset.xy = vec2( 0.5,  0.5);
+   
+   for (int i = 0; i < 3; i++) {
+   gl_Position = gl_in[i].gl_Position;
+   gl_Position.xy += offset;
+   EmitVertex();
+   }
+}
+
+[fragment shader]
+void main()
+{
+   gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2
+-0.5 -0.5
+ 0.5 -0.5
+-0.5  0.0
+ 0.5  0.0
+-0.5  0.5
+ 0.5  0.5
+
+[test]
+clear color 0.0 0.0 0.0 0.0
+clear
+draw arrays GL_TRIANGLE_STRIP 0 6
+probe all rgba 0.0 1.0 0.0 1.0
\ No newline at end of file
-- 
2.7.4

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] Add a test for instanced GS inputs.

2016-05-08 Thread Kenneth Graunke
On Sunday, May 8, 2016 10:55:11 AM PDT Ilia Mirkin wrote:
> On Sun, May 8, 2016 at 8:33 AM, Kenneth Graunke  
wrote:
> > All of our other tests for instanced geometry shaders don't actually
> > read input variables.  This is currently broken with the i965 driver's
> > INTEL_SCALAR_GS=1 backend; I have patches to fix it.
> > ---
> >  .../execution/instanced-inputs.shader_test | 60 +
+
> >  1 file changed, 60 insertions(+)
> >  create mode 100644 tests/spec/arb_gpu_shader5/execution/instanced-
inputs.shader_test
> >
> > diff --git a/tests/spec/arb_gpu_shader5/execution/instanced-
inputs.shader_test b/tests/spec/arb_gpu_shader5/execution/instanced-
inputs.shader_test
> > new file mode 100644
> > index 000..eceb6c3
> > --- /dev/null
> > +++ b/tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test
> > @@ -0,0 +1,60 @@
> > +[require]
> > +GL >= 2.0
> > +GLSL >= 1.50
> 
> Should probably list the GL_ARB_gpu_shader5 require in here, no?
> Otherwise this will fail on GPUs that don't support gs5.

D'oh!  Thanks!  I was hacking up a bunch of tests in the same afternoon,
and added it to the wrong one by mistake.  I've fixed that locally.


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] Add a test for instanced GS inputs.

2016-05-08 Thread Ilia Mirkin
On Sun, May 8, 2016 at 8:33 AM, Kenneth Graunke  wrote:
> All of our other tests for instanced geometry shaders don't actually
> read input variables.  This is currently broken with the i965 driver's
> INTEL_SCALAR_GS=1 backend; I have patches to fix it.
> ---
>  .../execution/instanced-inputs.shader_test | 60 
> ++
>  1 file changed, 60 insertions(+)
>  create mode 100644 
> tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test
>
> diff --git 
> a/tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test 
> b/tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test
> new file mode 100644
> index 000..eceb6c3
> --- /dev/null
> +++ b/tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test
> @@ -0,0 +1,60 @@
> +[require]
> +GL >= 2.0
> +GLSL >= 1.50

Should probably list the GL_ARB_gpu_shader5 require in here, no?
Otherwise this will fail on GPUs that don't support gs5.

> +
> +[vertex shader]
> +in vec4 vertex;
> +out vec4 vertex_to_gs;
> +
> +void main()
> +{
> +vertex_to_gs = vertex;
> +}
> +
> +[geometry shader]
> +#extension GL_ARB_gpu_shader5 : require
> +layout(triangles) in;
> +layout(triangle_strip, max_vertices = 3) out;
> +layout(invocations = 4) in;
> +
> +in vec4 vertex_to_gs[3];
> +
> +void main()
> +{
> +vec2 offset;
> +if (gl_InvocationID == 0)
> +offset.xy = vec2(-0.5, -0.5);
> +else if (gl_InvocationID == 1)
> +offset.xy = vec2( 0.5, -0.5);
> +else if (gl_InvocationID == 2)
> +offset.xy = vec2(-0.5,  0.5);
> +else if (gl_InvocationID == 3)
> +offset.xy = vec2( 0.5,  0.5);
> +
> +for (int i = 0; i < 3; i++) {
> +gl_Position = vertex_to_gs[i];
> +gl_Position.xy += offset;
> +EmitVertex();
> +}
> +}
> +
> +[fragment shader]
> +void main()
> +{
> +gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
> +}
> +
> +[vertex data]
> +vertex/float/2
> +-0.5 -0.5
> + 0.5 -0.5
> +-0.5  0.0
> + 0.5  0.0
> +-0.5  0.5
> + 0.5  0.5
> +
> +[test]
> +clear color 0.0 0.0 0.0 0.0
> +clear
> +draw arrays GL_TRIANGLE_STRIP 0 6
> +probe all rgba 0.0 1.0 0.0 1.0
> --
> 2.8.2
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Add a test for instanced GS inputs.

2016-05-08 Thread Kenneth Graunke
All of our other tests for instanced geometry shaders don't actually
read input variables.  This is currently broken with the i965 driver's
INTEL_SCALAR_GS=1 backend; I have patches to fix it.
---
 .../execution/instanced-inputs.shader_test | 60 ++
 1 file changed, 60 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test

diff --git a/tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test 
b/tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test
new file mode 100644
index 000..eceb6c3
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test
@@ -0,0 +1,60 @@
+[require]
+GL >= 2.0
+GLSL >= 1.50
+
+[vertex shader]
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#extension GL_ARB_gpu_shader5 : require
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+layout(invocations = 4) in;
+
+in vec4 vertex_to_gs[3];
+
+void main()
+{
+vec2 offset;
+if (gl_InvocationID == 0)
+offset.xy = vec2(-0.5, -0.5);
+else if (gl_InvocationID == 1)
+offset.xy = vec2( 0.5, -0.5);
+else if (gl_InvocationID == 2)
+offset.xy = vec2(-0.5,  0.5);
+else if (gl_InvocationID == 3)
+offset.xy = vec2( 0.5,  0.5);
+
+for (int i = 0; i < 3; i++) {
+gl_Position = vertex_to_gs[i];
+gl_Position.xy += offset;
+EmitVertex();
+}
+}
+
+[fragment shader]
+void main()
+{
+gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2
+-0.5 -0.5
+ 0.5 -0.5
+-0.5  0.0
+ 0.5  0.0
+-0.5  0.5
+ 0.5  0.5
+
+[test]
+clear color 0.0 0.0 0.0 0.0
+clear
+draw arrays GL_TRIANGLE_STRIP 0 6
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.8.2

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit