Re: [Piglit] [PATCH] ARB_shader_storage_buffer_object: check ssbo array optimizations

2019-02-22 Thread andrey simiklit
Thanks for reviewing and push)
Andrii.

On Fri, Feb 22, 2019 at 8:25 PM Ian Romanick  wrote:

> I made a couple small adjustments to the tests and pushed them.
>
> Thanks!
>
> On 2/15/19 5:43 AM, asimiklit.w...@gmail.com wrote:
> > From: Andrii Simiklit 
> >
> > The tests for a compiler which leads to mismatch between max_array_access
> > and the var type when the compiler tries to optimize unused ssbo
> instances.
> > This mismatch leads to crash because in some cases the type length is
> less
> > than the max_array_access field.
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109532
> > Signed-off-by: Andrii Simiklit 
> > ---
> >  .../compiler/unused-array-element.comp| 34 +++
> >  .../compiler/unused-array-element.frag| 32 +
> >  2 files changed, 66 insertions(+)
> >  create mode 100644
> tests/spec/arb_shader_storage_buffer_object/compiler/unused-array-element.comp
> >  create mode 100644
> tests/spec/arb_shader_storage_buffer_object/compiler/unused-array-element.frag
> >
> > diff --git
> a/tests/spec/arb_shader_storage_buffer_object/compiler/unused-array-element.comp
> b/tests/spec/arb_shader_storage_buffer_object/compiler/unused-array-element.comp
> > new file mode 100644
> > index 0..a5ec4d972
> > --- /dev/null
> > +++
> b/tests/spec/arb_shader_storage_buffer_object/compiler/unused-array-element.comp
> > @@ -0,0 +1,34 @@
> > +// [config]
> > +// expect_result: pass
> > +// glsl_version: 4.30
> > +// [end config]
> > +//
> > +//The tests for a compiler which leads to mismatch between
> max_array_access
> > +//and the var type when the compiler tries to optimize unused ssbo
> instances.
> > +//This mismatch leads to crash because in some cases the type length is
> less
> > +//than the max_array_access field.
> > +//
> > +#version 430
> > +
> > +layout(local_size_x = 1) in;
> > +
> > +layout(packed) buffer BlockA {
> > +   float a;
> > +} blockA[3];
> > +
> > +layout(packed) buffer BlockB {
> > +   float a;
> > +} blockB[2];
> > +
> > +layout(packed) buffer BlockC {
> > +   float a;
> > +} blockC[2];
> > +
> > +buffer Result {
> > +   float result;
> > +};
> > +
> > +void main()
> > +{
> > +   result = blockA[1].a + blockB[0].a + blockC[1].a;
> > +}
> > diff --git
> a/tests/spec/arb_shader_storage_buffer_object/compiler/unused-array-element.frag
> b/tests/spec/arb_shader_storage_buffer_object/compiler/unused-array-element.frag
> > new file mode 100644
> > index 0..8fdb1bf2e
> > --- /dev/null
> > +++
> b/tests/spec/arb_shader_storage_buffer_object/compiler/unused-array-element.frag
> > @@ -0,0 +1,32 @@
> > +// [config]
> > +// expect_result: pass
> > +// glsl_version: 3.20
> > +// [end config]
> > +//
> > +//The tests for a compiler which leads to mismatch between
> max_array_access
> > +//and the var type when the compiler tries to optimize unused ssbo
> instances.
> > +//This mismatch leads to crash because in some cases the type length is
> less
> > +//than the max_array_access field.
> > +//
> > +#version 320 es
> > +
> > +precision mediump float;
> > +
> > +layout(packed) buffer BlockA {
> > +   float a;
> > +} blockA[3];
> > +
> > +layout(packed) buffer BlockB {
> > +   float a;
> > +} blockB[2];
> > +
> > +layout(packed) buffer BlockC {
> > +   float a;
> > +} blockC[2];
> > +
> > +out vec4 color;
> > +
> > +void main()
> > +{
> > +   color = vec4(blockA[1].a, blockB[0].a, blockC[1].a, 1.0);
> > +}
> > \ No newline at end of file
> >
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH v2] primitive-restart: extend the test to catch regressions of bug-109451

2019-02-18 Thread andrey simiklit
Thanks.

On Mon, Feb 18, 2019 at 5:33 PM Lionel Landwerlin <
lionel.g.landwer...@intel.com> wrote:

> Pushed.
>
> On 18/02/2019 14:05, andrey simiklit wrote:
>
> Yes, it would be great.
>
> Thanks,
> Andrii.
>
> On Mon, Feb 18, 2019 at 4:03 PM Lionel Landwerlin <
> lionel.g.landwer...@intel.com> wrote:
>
>> Do you need me to push this change?
>>
>> -Lionel
>>
>> On 18/02/2019 14:00, asimiklit.w...@gmail.com wrote:
>> > From: Andrii Simiklit 
>> >
>> > Looks like this test should be able to catch this kind of the
>> regressions
>> > os I add it here.
>> > This test should draw green rectangle if everything is ok.
>> > But in case of bug which makes us unable to disable
>> > the primitive restart option it should draw just one triangle.
>> >
>> > The solution was suggested.
>> >
>> > v2: Added the link to the bug in the comment of the new function
>> >  ( Lionel Landwerlin  )
>> >
>> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109451
>> > Reviewed-by: Lionel Landwerlin 
>> > Signed-off-by: Andrii Simiklit 
>> > ---
>> >   tests/general/primitive-restart.c | 73 +++
>> >   1 file changed, 73 insertions(+)
>> >
>> > diff --git a/tests/general/primitive-restart.c
>> b/tests/general/primitive-restart.c
>> > index 4219a6c5b..941540451 100644
>> > --- a/tests/general/primitive-restart.c
>> > +++ b/tests/general/primitive-restart.c
>> > @@ -75,6 +75,11 @@ static bool Have_31;
>> >   static bool TestGL31;
>> >
>> >
>> > +static void
>> > +enable_restart(GLuint restart_index);
>> > +static void
>> > +disable_restart(void);
>> > +
>> >   static bool
>> >   check_rendering(void)
>> >   {
>> > @@ -184,6 +189,72 @@ test_begin_end(GLenum primMode)
>> >  return pass;
>> >   }
>> >
>> > +static void
>> > +write_vec2_value(GLfloat * verts, GLuint vidx, GLfloat x, GLfloat y)
>> > +{
>> > +   verts[(vidx * 2) + 0] = x;
>> > +   verts[(vidx * 2) + 1] = y;
>> > +}
>> > +/* This test should draw green rectangle if everything is ok.
>> > + * But in case of bug which makes us unable to disable
>> > + * the primitive restart option it should draw just one triangle.
>> > + * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109451
>> > + */
>> > +static bool
>> > +test_shared_ib_restart()
>> > +{
>> > +   bool pass = true;
>> > +   GLfloat verts[256 * 2];
>> > +   memset(, 0, sizeof(verts));
>> > +   //left-bottom
>> > +   write_vec2_value(verts, 0, 0.0f, 0.0f);
>> > +   //right-bottom
>> > +   write_vec2_value(verts, 1, piglit_width, 0.0f);
>> > +   //left-top
>> > +   write_vec2_value(verts, 2, 0.0f, piglit_height);
>> > +   //right-top
>> > +   write_vec2_value(verts, 255, piglit_width, piglit_height);
>> > +
>> > +   const GLubyte indices[] = { 0, 1, 2, 255, 0 };
>> > +   const GLfloat expected[3] = { 0.0f, 1.0f, 0.0f };
>> > +   GLuint vbo1, vbo2;
>> > +
>> > +   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
>> > +
>> > +   glClear(GL_COLOR_BUFFER_BIT);
>> > +
>> > +   glColor4fv(green);
>> > +
>> > +   glGenBuffers(1, );
>> > +   glBindBuffer(GL_ARRAY_BUFFER, vbo1);
>> > +   glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts,
>> GL_DYNAMIC_DRAW);
>> > +   glVertexPointer(2, GL_FLOAT, 0, (void *)0);
>> > +
>> > +   glGenBuffers(1, );
>> > +   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo2);
>> > +   glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices,
>> GL_STATIC_DRAW);
>> > +   glEnableClientState(GL_VERTEX_ARRAY);
>> > +
>> > +   //We should draw something with an enabled restart option to check
>> that
>> > +   //it could be correctly disabled
>> > +   enable_restart(0xff);
>> > +   glDrawElements(GL_LINE_STRIP, ARRAY_SIZE(indices),
>> GL_UNSIGNED_BYTE, (void*)0);
>> > +   disable_restart();
>> > +
>> > +   //Draw full screen rectangle
>> > +   glDrawElements(GL_TRIANGLE_STRIP, ARRAY_SIZE(indices) - 1,
>> GL_UNSIGNED_BYTE, (void*)0);
>> > +
>> > +   glDisableClientState(GL_VERTEX_ARRAY);
>> > +   glBindBuffer(GL_ARRAY_BUFFER, 0);
>> > +   glBind

Re: [Piglit] [PATCH v2] primitive-restart: extend the test to catch regressions of bug-109451

2019-02-18 Thread andrey simiklit
Yes, it would be great.

Thanks,
Andrii.

On Mon, Feb 18, 2019 at 4:03 PM Lionel Landwerlin <
lionel.g.landwer...@intel.com> wrote:

> Do you need me to push this change?
>
> -Lionel
>
> On 18/02/2019 14:00, asimiklit.w...@gmail.com wrote:
> > From: Andrii Simiklit 
> >
> > Looks like this test should be able to catch this kind of the regressions
> > os I add it here.
> > This test should draw green rectangle if everything is ok.
> > But in case of bug which makes us unable to disable
> > the primitive restart option it should draw just one triangle.
> >
> > The solution was suggested.
> >
> > v2: Added the link to the bug in the comment of the new function
> >  ( Lionel Landwerlin  )
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109451
> > Reviewed-by: Lionel Landwerlin 
> > Signed-off-by: Andrii Simiklit 
> > ---
> >   tests/general/primitive-restart.c | 73 +++
> >   1 file changed, 73 insertions(+)
> >
> > diff --git a/tests/general/primitive-restart.c
> b/tests/general/primitive-restart.c
> > index 4219a6c5b..941540451 100644
> > --- a/tests/general/primitive-restart.c
> > +++ b/tests/general/primitive-restart.c
> > @@ -75,6 +75,11 @@ static bool Have_31;
> >   static bool TestGL31;
> >
> >
> > +static void
> > +enable_restart(GLuint restart_index);
> > +static void
> > +disable_restart(void);
> > +
> >   static bool
> >   check_rendering(void)
> >   {
> > @@ -184,6 +189,72 @@ test_begin_end(GLenum primMode)
> >  return pass;
> >   }
> >
> > +static void
> > +write_vec2_value(GLfloat * verts, GLuint vidx, GLfloat x, GLfloat y)
> > +{
> > +   verts[(vidx * 2) + 0] = x;
> > +   verts[(vidx * 2) + 1] = y;
> > +}
> > +/* This test should draw green rectangle if everything is ok.
> > + * But in case of bug which makes us unable to disable
> > + * the primitive restart option it should draw just one triangle.
> > + * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109451
> > + */
> > +static bool
> > +test_shared_ib_restart()
> > +{
> > +   bool pass = true;
> > +   GLfloat verts[256 * 2];
> > +   memset(, 0, sizeof(verts));
> > +   //left-bottom
> > +   write_vec2_value(verts, 0, 0.0f, 0.0f);
> > +   //right-bottom
> > +   write_vec2_value(verts, 1, piglit_width, 0.0f);
> > +   //left-top
> > +   write_vec2_value(verts, 2, 0.0f, piglit_height);
> > +   //right-top
> > +   write_vec2_value(verts, 255, piglit_width, piglit_height);
> > +
> > +   const GLubyte indices[] = { 0, 1, 2, 255, 0 };
> > +   const GLfloat expected[3] = { 0.0f, 1.0f, 0.0f };
> > +   GLuint vbo1, vbo2;
> > +
> > +   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
> > +
> > +   glClear(GL_COLOR_BUFFER_BIT);
> > +
> > +   glColor4fv(green);
> > +
> > +   glGenBuffers(1, );
> > +   glBindBuffer(GL_ARRAY_BUFFER, vbo1);
> > +   glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_DYNAMIC_DRAW);
> > +   glVertexPointer(2, GL_FLOAT, 0, (void *)0);
> > +
> > +   glGenBuffers(1, );
> > +   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo2);
> > +   glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices,
> GL_STATIC_DRAW);
> > +   glEnableClientState(GL_VERTEX_ARRAY);
> > +
> > +   //We should draw something with an enabled restart option to check
> that
> > +   //it could be correctly disabled
> > +   enable_restart(0xff);
> > +   glDrawElements(GL_LINE_STRIP, ARRAY_SIZE(indices), GL_UNSIGNED_BYTE,
> (void*)0);
> > +   disable_restart();
> > +
> > +   //Draw full screen rectangle
> > +   glDrawElements(GL_TRIANGLE_STRIP, ARRAY_SIZE(indices) - 1,
> GL_UNSIGNED_BYTE, (void*)0);
> > +
> > +   glDisableClientState(GL_VERTEX_ARRAY);
> > +   glBindBuffer(GL_ARRAY_BUFFER, 0);
> > +   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
> > +   glDeleteBuffers(1, );
> > +   glDeleteBuffers(1, );
> > +   glFinish();
> > +   pass = (piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height,
> expected) != 0) && pass;
> > +   piglit_present_results();
> > +   return pass;
> > +}
> > +
> >
> >   static void
> >   enable_restart(GLuint restart_index)
> > @@ -503,6 +574,7 @@ primitive_restart_test(VBO_CFG vbo_cfg)
> >
> >  if (Have_NV) {
> > TestGL31 = false;
> > +  pass = test_shared_ib_restart() && pass;
> > pass = test_begin_end(GL_TRIANGLE_STRIP) && pass;
> > pass = test_begin_end(GL_LINE_STRIP) && pass;
> > pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP,
> GL_UNSIGNED_BYTE) && pass;
> > @@ -521,6 +593,7 @@ primitive_restart_test(VBO_CFG vbo_cfg)
> >
> >  if (Have_31) {
> > TestGL31 = true;
> > +  pass = test_shared_ib_restart() && pass;
> > pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP,
> GL_UNSIGNED_BYTE) && pass;
> > pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP,
> GL_UNSIGNED_SHORT) && pass;
> > pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP,
> GL_UNSIGNED_INT) && pass;
>
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org

Re: [Piglit] [PATCH v2] primitive-restart: extend the test to catch regressions of bug-109451

2019-02-18 Thread andrey simiklit
I added the link.
Thanks a lot for review)

On Mon, Feb 18, 2019 at 4:00 PM  wrote:

> From: Andrii Simiklit 
>
> Looks like this test should be able to catch this kind of the regressions
> os I add it here.
> This test should draw green rectangle if everything is ok.
> But in case of bug which makes us unable to disable
> the primitive restart option it should draw just one triangle.
>
> The solution was suggested.
>
> v2: Added the link to the bug in the comment of the new function
> ( Lionel Landwerlin  )
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109451
> Reviewed-by: Lionel Landwerlin 
> Signed-off-by: Andrii Simiklit 
> ---
>  tests/general/primitive-restart.c | 73 +++
>  1 file changed, 73 insertions(+)
>
> diff --git a/tests/general/primitive-restart.c
> b/tests/general/primitive-restart.c
> index 4219a6c5b..941540451 100644
> --- a/tests/general/primitive-restart.c
> +++ b/tests/general/primitive-restart.c
> @@ -75,6 +75,11 @@ static bool Have_31;
>  static bool TestGL31;
>
>
> +static void
> +enable_restart(GLuint restart_index);
> +static void
> +disable_restart(void);
> +
>  static bool
>  check_rendering(void)
>  {
> @@ -184,6 +189,72 @@ test_begin_end(GLenum primMode)
> return pass;
>  }
>
> +static void
> +write_vec2_value(GLfloat * verts, GLuint vidx, GLfloat x, GLfloat y)
> +{
> +   verts[(vidx * 2) + 0] = x;
> +   verts[(vidx * 2) + 1] = y;
> +}
> +/* This test should draw green rectangle if everything is ok.
> + * But in case of bug which makes us unable to disable
> + * the primitive restart option it should draw just one triangle.
> + * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109451
> + */
> +static bool
> +test_shared_ib_restart()
> +{
> +   bool pass = true;
> +   GLfloat verts[256 * 2];
> +   memset(, 0, sizeof(verts));
> +   //left-bottom
> +   write_vec2_value(verts, 0, 0.0f, 0.0f);
> +   //right-bottom
> +   write_vec2_value(verts, 1, piglit_width, 0.0f);
> +   //left-top
> +   write_vec2_value(verts, 2, 0.0f, piglit_height);
> +   //right-top
> +   write_vec2_value(verts, 255, piglit_width, piglit_height);
> +
> +   const GLubyte indices[] = { 0, 1, 2, 255, 0 };
> +   const GLfloat expected[3] = { 0.0f, 1.0f, 0.0f };
> +   GLuint vbo1, vbo2;
> +
> +   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
> +
> +   glClear(GL_COLOR_BUFFER_BIT);
> +
> +   glColor4fv(green);
> +
> +   glGenBuffers(1, );
> +   glBindBuffer(GL_ARRAY_BUFFER, vbo1);
> +   glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_DYNAMIC_DRAW);
> +   glVertexPointer(2, GL_FLOAT, 0, (void *)0);
> +
> +   glGenBuffers(1, );
> +   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo2);
> +   glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices,
> GL_STATIC_DRAW);
> +   glEnableClientState(GL_VERTEX_ARRAY);
> +
> +   //We should draw something with an enabled restart option to check that
> +   //it could be correctly disabled
> +   enable_restart(0xff);
> +   glDrawElements(GL_LINE_STRIP, ARRAY_SIZE(indices), GL_UNSIGNED_BYTE,
> (void*)0);
> +   disable_restart();
> +
> +   //Draw full screen rectangle
> +   glDrawElements(GL_TRIANGLE_STRIP, ARRAY_SIZE(indices) - 1,
> GL_UNSIGNED_BYTE, (void*)0);
> +
> +   glDisableClientState(GL_VERTEX_ARRAY);
> +   glBindBuffer(GL_ARRAY_BUFFER, 0);
> +   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
> +   glDeleteBuffers(1, );
> +   glDeleteBuffers(1, );
> +   glFinish();
> +   pass = (piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height,
> expected) != 0) && pass;
> +   piglit_present_results();
> +   return pass;
> +}
> +
>
>  static void
>  enable_restart(GLuint restart_index)
> @@ -503,6 +574,7 @@ primitive_restart_test(VBO_CFG vbo_cfg)
>
> if (Have_NV) {
>TestGL31 = false;
> +  pass = test_shared_ib_restart() && pass;
>pass = test_begin_end(GL_TRIANGLE_STRIP) && pass;
>pass = test_begin_end(GL_LINE_STRIP) && pass;
>pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP,
> GL_UNSIGNED_BYTE) && pass;
> @@ -521,6 +593,7 @@ primitive_restart_test(VBO_CFG vbo_cfg)
>
> if (Have_31) {
>TestGL31 = true;
> +  pass = test_shared_ib_restart() && pass;
>pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP,
> GL_UNSIGNED_BYTE) && pass;
>pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP,
> GL_UNSIGNED_SHORT) && pass;
>pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP,
> GL_UNSIGNED_INT) && pass;
> --
> 2.17.1
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH] primitive-restart: extend the test to catch regressions of bug-109451

2019-02-18 Thread andrey simiklit
ping

On Fri, Feb 1, 2019 at 11:27 AM  wrote:

> From: Andrii Simiklit 
>
> Looks like this test should be able to catch this kind of the regressions
> os I add it here.
> This test should draw green rectangle if everything is ok.
> But in case of bug which makes us unable to disable
> the primitive restart option it should draw just one triangle.
>
> The possible solution was suggested.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109451
> Signed-off-by: Andrii Simiklit 
> ---
>  tests/general/primitive-restart.c | 72 +++
>  1 file changed, 72 insertions(+)
>
> diff --git a/tests/general/primitive-restart.c
> b/tests/general/primitive-restart.c
> index 4219a6c5b..aef9bed41 100644
> --- a/tests/general/primitive-restart.c
> +++ b/tests/general/primitive-restart.c
> @@ -75,6 +75,11 @@ static bool Have_31;
>  static bool TestGL31;
>
>
> +static void
> +enable_restart(GLuint restart_index);
> +static void
> +disable_restart(void);
> +
>  static bool
>  check_rendering(void)
>  {
> @@ -184,6 +189,71 @@ test_begin_end(GLenum primMode)
> return pass;
>  }
>
> +static void
> +write_vec2_value(GLfloat * verts, GLuint vidx, GLfloat x, GLfloat y)
> +{
> +   verts[(vidx * 2) + 0] = x;
> +   verts[(vidx * 2) + 1] = y;
> +}
> +/* This test should draw green rectangle if everything is ok.
> + * But in case of bug which makes us unable to disable
> + * the primitive restart option it should draw just one triangle.
> + */
> +static bool
> +test_shared_ib_restart()
> +{
> +   bool pass = true;
> +   GLfloat verts[256 * 2];
> +   memset(, 0, sizeof(verts));
> +   //left-bottom
> +   write_vec2_value(verts, 0, 0.0f, 0.0f);
> +   //right-bottom
> +   write_vec2_value(verts, 1, piglit_width, 0.0f);
> +   //left-top
> +   write_vec2_value(verts, 2, 0.0f, piglit_height);
> +   //right-top
> +   write_vec2_value(verts, 255, piglit_width, piglit_height);
> +
> +   const GLubyte indices[] = { 0, 1, 2, 255, 0 };
> +   const GLfloat expected[3] = { 0.0f, 1.0f, 0.0f };
> +   GLuint vbo1, vbo2;
> +
> +   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
> +
> +   glClear(GL_COLOR_BUFFER_BIT);
> +
> +   glColor4fv(green);
> +
> +   glGenBuffers(1, );
> +   glBindBuffer(GL_ARRAY_BUFFER, vbo1);
> +   glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_DYNAMIC_DRAW);
> +   glVertexPointer(2, GL_FLOAT, 0, (void *)0);
> +
> +   glGenBuffers(1, );
> +   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo2);
> +   glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices,
> GL_STATIC_DRAW);
> +   glEnableClientState(GL_VERTEX_ARRAY);
> +
> +   //We should draw something with an enabled restart option to check that
> +   //it could be correctly disabled
> +   enable_restart(0xff);
> +   glDrawElements(GL_LINE_STRIP, ARRAY_SIZE(indices), GL_UNSIGNED_BYTE,
> (void*)0);
> +   disable_restart();
> +
> +   //Draw full screen rectangle
> +   glDrawElements(GL_TRIANGLE_STRIP, ARRAY_SIZE(indices) - 1,
> GL_UNSIGNED_BYTE, (void*)0);
> +
> +   glDisableClientState(GL_VERTEX_ARRAY);
> +   glBindBuffer(GL_ARRAY_BUFFER, 0);
> +   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
> +   glDeleteBuffers(1, );
> +   glDeleteBuffers(1, );
> +   glFinish();
> +   pass = (piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height,
> expected) != 0) && pass;
> +   piglit_present_results();
> +   return pass;
> +}
> +
>
>  static void
>  enable_restart(GLuint restart_index)
> @@ -503,6 +573,7 @@ primitive_restart_test(VBO_CFG vbo_cfg)
>
> if (Have_NV) {
>TestGL31 = false;
> +  pass = test_shared_ib_restart() && pass;
>pass = test_begin_end(GL_TRIANGLE_STRIP) && pass;
>pass = test_begin_end(GL_LINE_STRIP) && pass;
>pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP,
> GL_UNSIGNED_BYTE) && pass;
> @@ -521,6 +592,7 @@ primitive_restart_test(VBO_CFG vbo_cfg)
>
> if (Have_31) {
>TestGL31 = true;
> +  pass = test_shared_ib_restart() && pass;
>pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP,
> GL_UNSIGNED_BYTE) && pass;
>pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP,
> GL_UNSIGNED_SHORT) && pass;
>pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP,
> GL_UNSIGNED_INT) && pass;
> --
> 2.17.1
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH v3] miptree: test ability to use upside down miptree

2019-01-14 Thread andrey simiklit
On Mon, Jan 14, 2019 at 1:35 PM Emil Velikov 
wrote:

> On Fri, 11 Jan 2019 at 15:28, andrey simiklit 
> wrote:
> >
> > Hello,
> >
> > Thanks for review.
> > Could somebody help me with a push?
> >
> Done.
>

Thanks a lot.


> > @Emil:
> > Yes, you are right about missing 'in-' in 'git send-email
> --in-reply-to='.
> > So v3 wasn't added to the patchwork(
> > Hope it isn't really mandatory and the push can be performed)
> >
> It's all good. Might need to follow-up manually and update PW.
>

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


Re: [Piglit] [PATCH v3] miptree: test ability to use upside down miptree

2019-01-11 Thread andrey simiklit
Hello,

Thanks for review.
Could somebody help me with a push?

@Emil:
Yes, you are right about missing 'in-' in 'git send-email --in-reply-to='.
So v3 wasn't added to the patchwork(
Hope it isn't really mandatory and the push can be performed)

Thanks,
Andrii.

On Fri, Jan 11, 2019 at 3:14 PM Emil Velikov 
wrote:

> On 2018/12/12, asimiklit.w...@gmail.com wrote:
> > From: Andrii Simiklit 
> >
> > Test that usage of upside down miptree doesn't cause assertion
> >
> > The miptree:
> >
> > level 0 = 1x1
> > level 1 = 2x2
> > level 2 = 4x4
> > ...
> > level n = NxN
> >
> > should be acceptable for case when we don't use a min filter.
> >
> > v2: - Unnecessary function calls were removed
> > - The 'glClearColor' call was moved to 'piglit_display' function
> > - The program creation was moved to 'piglit_init' function
> > - The requirements check was moved to 'piglit_init' function
> >( Erik Faye-Lund  )
> >
> > - Fixed a leak of texture which is created in 'setup_texture'
> >
> > v3: - Defined a constant for the test color instead of a hardcoded
> variant
> > - Removed unused variable 'pos' which is always was 0
> > - Implemented more effective number of levels calculator
> > - Removed a stop when one of tests fails
> > - Fixed two style issues
> >( Emil Velikov  )
> Looks great, thank you.
>
> Reviewed-by: Emil Velikov 
>
> -Emil
>
> P.S. Seems like you're missing "in-" from the git send-email
> --in-reply-to="old-thread-id" ...
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v3] miptree: test ability to use upside down miptree

2019-01-08 Thread andrey simiklit
Hi all,

Could somebody help me with a push if it is acceptable for everyone?

Thanks,
Andrii.


On Wed, Dec 12, 2018 at 1:11 PM  wrote:

> From: Andrii Simiklit 
>
> Test that usage of upside down miptree doesn't cause assertion
>
> The miptree:
>
> level 0 = 1x1
> level 1 = 2x2
> level 2 = 4x4
> ...
> level n = NxN
>
> should be acceptable for case when we don't use a min filter.
>
> v2: - Unnecessary function calls were removed
> - The 'glClearColor' call was moved to 'piglit_display' function
> - The program creation was moved to 'piglit_init' function
> - The requirements check was moved to 'piglit_init' function
>( Erik Faye-Lund  )
>
> - Fixed a leak of texture which is created in 'setup_texture'
>
> v3: - Defined a constant for the test color instead of a hardcoded variant
> - Removed unused variable 'pos' which is always was 0
> - Implemented more effective number of levels calculator
> - Removed a stop when one of tests fails
> - Fixed two style issues
>( Emil Velikov  )
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
> Signed-off-by: Andrii Simiklit 
> Reviewed-by: Erik Faye-Lund 
> ---
>  tests/opengl.py   |   1 +
>  tests/texturing/CMakeLists.gl.txt |   1 +
>  tests/texturing/tex-upside-down-miptree.c | 162 ++
>  3 files changed, 164 insertions(+)
>  create mode 100644 tests/texturing/tex-upside-down-miptree.c
>
> diff --git a/tests/opengl.py b/tests/opengl.py
> index f7e408cd5..f6a38e40e 100644
> --- a/tests/opengl.py
> +++ b/tests/opengl.py
> @@ -704,6 +704,7 @@ with profile.test_list.group_manager(
>  g(['getteximage-targets', '1D'])
>  g(['getteximage-targets', '2D'])
>  g(['teximage-scale-bias'])
> +g(['tex-upside-down-miptree'])
>  add_msaa_visual_plain_tests(g, ['draw-pixels'])
>  add_msaa_visual_plain_tests(g, ['read-front'], run_concurrent=False)
>  add_msaa_visual_plain_tests(g, ['read-front', 'clear-front-first'],
> diff --git a/tests/texturing/CMakeLists.gl.txt
> b/tests/texturing/CMakeLists.gl.txt
> index e5d41e432..02b572c79 100644
> --- a/tests/texturing/CMakeLists.gl.txt
> +++ b/tests/texturing/CMakeLists.gl.txt
> @@ -98,5 +98,6 @@ piglit_add_executable (texture-al texture-al.c)
>  piglit_add_executable (texture-rg texture-rg.c)
>  piglit_add_executable (teximage-colors teximage-colors.c)
>  piglit_add_executable (zero-tex-coord zero-tex-coord.c)
> +piglit_add_executable (tex-upside-down-miptree tex-upside-down-miptree.c)
>
>  # vim: ft=cmake:
> diff --git a/tests/texturing/tex-upside-down-miptree.c
> b/tests/texturing/tex-upside-down-miptree.c
> new file mode 100644
> index 0..c70fc8058
> --- /dev/null
> +++ b/tests/texturing/tex-upside-down-miptree.c
> @@ -0,0 +1,162 @@
> +/*
> + * Copyright (c) 2018 Andrii Simiklit
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the
> "Software"),
> + * to deal in the Software without restriction, including without
> limitation
> + * the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the
> next
> + * paragraph) shall be included in all copies or substantial portions of
> the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
> SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> DEALINGS
> + * IN THE SOFTWARE.
> + *
> + * Authors:
> + *Andrii Simiklit 
> + *
> + */
> +
> +/**
> + * Test what there no an assertion when we use upside down miptree and
> + * GL_TEXTURE_MIN_FILTER is GL_LINEAR, base level is not 0
> + * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
> + */
> +
> +#include "piglit-util-gl.h"
> +#include 
> +
> +#define TW 64
> +#define TH 64
> +#define MINIMUM(X, Y)  ((X) < (Y) ? (X) : (Y))
> +#define LEVELS (log2(MINIMUM(TW,TH)) + 1)
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> +   config.supports_gl_compat_version = 10;
> +
> +   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
> PIGLIT_GL_VISUAL_DOUBLE;
> +   config.khr_no_error_support = PIGLIT_NO_ERRORS;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +GLuint prog = 0;
> +GLuint texture = 0;
> +static const GLubyte fancy_pixel[4] = { 255, 128, 64, 32 };
> +static const char *fragShaderText =
> +   "uniform sampler2D tex;\n"
> +   "void main()\n"
> + 

Re: [Piglit] [PATCH v2] miptree: test ability to use upside down miptree

2018-12-12 Thread andrey simiklit
Hello,

I will fix it.
Thanks for review.

Regards,
Andrii.

On Tue, Dec 11, 2018 at 5:04 PM Emil Velikov 
wrote:

> Hi Andrii,
>
> Pardon for joining so late. The patch looks ok, although a few bits I'm
> unsure
> about - see the "Note" below.
>
> There's a bunch of cosmetic suggestions as well - I won't read too much
> into
> them though.
>
> On Mon, 3 Dec 2018 at 15:07,  wrote:
>
> [snip]
> > +#define TW 64
> > +#define TH 64
> #define LEVELS 7 // aka log2(min(TW,TH)) + 1 ?
> Then swap nlevels with LEVELS throughout the file.
>
> static const GLubyte fancy_pixel = [255, 128, 64, 32];
>




>
> > +static void
> > +get_rect_bounds(int pos, int *x, int *y, int *w, int *h)
> > +{
> > +   *x = pos * (piglit_width / 3) + 5;
> > +   *y = 5;
> > +   *w = piglit_width / 3 - 10;
> > +   *h = piglit_height - 10;
> > +}
> Note: The variable "pos" is always 0. If that's intentional - I'd just
> drop and simplify.
> Alternatively
>
>
> > +   const GLfloat expected[4] = { oneby255 * 255.0,
> > +
>oneby255 * 128.0,
> > +
>oneby255 * 64.0,
> > +
>oneby255 * 32.0 };
> Use fancy_pixel for expected[]
>
>
> [snip]
> > +   for(level = 1; level < nlevels && pass; ++level)
> > +   {
> Style nits: space after "for", "{" should be trailing on previous
> line, post increment
>
> > +   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL,
> level);
> > +   glClear(GL_COLOR_BUFFER_BIT);
> > +   /* If we the draw_rect function doesn't cause
> crash/assertion
> > +   * it means everything is okay and test will be marked
> > +   * as pass
> > +   */
> > +   draw_rect(pos);
> > +   /** Just in case we check it
> > +*/
> > +   pass = pass && probe_pos(pos, expected);
>
> Note: In piglit we try to run all the tests, even if one fails. Some tests
> could
> be doing it wrong though :-(
>
> Personally I would drop the "&& pass" from the loop condition and use:
> pass = foo() && pass;
>
> [snip]
> > +   for (i = 0; i < TH; i++) {
> > +   for (j = 0; j < TW; j++) {
> > +   img[i][j][0] = 255;
> > +   img[i][j][1] = 128;
> > +   img[i][j][2] = 64;
> > +   img[i][j][3] = 32;
>
> for (i = 0; i < TH; i++)
> for (j = 0; j < TW; j++)
> img[i][j] = fancy_pixel;
>
>
> [snip]
>
> > +   w = TW;
> > +   h = TH;
> > +   for (nlevels = 0; w > 0 && h > 0; nlevels++) {
> > +   w /= 2;
> > +   h /= 2;
> > +   }
> > +   w = TW;
> > +   h = TH;
> > +   for (i = 0; w > 0 && h > 0; i++) {
> > +   glTexImage2D(GL_TEXTURE_2D, nlevels - 1 - i, GL_RGBA, w,
> h, 0,
> > +GL_RGBA, GL_UNSIGNED_BYTE, img);
> > +   w /= 2;
> > +   h /= 2;
> > +   }
> > +
> With the LEVELS, all the above becomes:
>
>for (i = 0; i < LEVELS; i++) {
>glTexImage2D(GL_TEXTURE_2D, nlevels - 1 - i, GL_RGBA, w, h,
> 0,
> GL_RGBA, GL_UNSIGNED_BYTE, img);
>w /= 2;
>h /= 2;
>}
>
>
> HTH
> Emil
> ___
> 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 v2] miptree: test ability to use upside down miptree

2018-12-10 Thread andrey simiklit
Hello,

Could I ask you for a push if this patch looks good for you?

Thanks,
Andrii.

On Mon, Dec 3, 2018 at 8:01 PM Mark Janes  wrote:

> It's preferable to push piglit tests first, and produce the CI test
> failure.  CI staff will track the failure, and attribute it to the
> piglit patch.  When the subsequent mesa patch is pushed, we track the
> resolution.  The process gives us artifacts in git that help to analyze
> driver differences between stable releases.
>
> -Mark
>
> andrey simiklit  writes:
>
> > Hello,
> >
> > If this patch is acceptable by everybody then
> > I guess that we need to push the following mesa patch before this one
> > to avoid errors from Intel CI because the fix for an issue which is
> tested
> > by this test is still there.
> >
> > https://patchwork.freedesktop.org/patch/254397/
> > One of the last comment from Kenneth Graunke :
> >
> >>".
> >> So, back to Reviewed-by.  I think once we get a Piglit test, I'm
> happy
> >> to land this patch.
> >>
> >>--Ken"
> >>
> >
> > Thanks,
> > Andrii.
> >
> > On Mon, Dec 3, 2018 at 5:07 PM  wrote:
> >
> >> From: Andrii Simiklit 
> >>
> >> Test that usage of upside down miptree doesn't cause assertion
> >>
> >> The miptree:
> >>
> >> level 0 = 1x1
> >> level 1 = 2x2
> >> level 2 = 4x4
> >> ...
> >> level n = NxN
> >>
> >> should be acceptable for case when we don't use a min filter.
> >>
> >> v2: - Unnecessary function calls were removed
> >> - The 'glClearColor' call was moved to 'piglit_display' function
> >> - The program creation was moved to 'piglit_init' function
> >> - The requirements check was moved to 'piglit_init' function
> >>( Erik Faye-Lund  )
> >>
> >> - Fixed a leak of texture which is created in 'setup_texture'
> >>
> >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
> >> Signed-off-by: Andrii Simiklit 
> >> Reviewed-by: Erik Faye-Lund 
> >> ---
> >>  tests/opengl.py   |   1 +
> >>  tests/texturing/CMakeLists.gl.txt |   1 +
> >>  tests/texturing/tex-upside-down-miptree.c | 171 ++
> >>  3 files changed, 173 insertions(+)
> >>  create mode 100644 tests/texturing/tex-upside-down-miptree.c
> >>
> >> diff --git a/tests/opengl.py b/tests/opengl.py
> >> index f7e408cd5..f6a38e40e 100644
> >> --- a/tests/opengl.py
> >> +++ b/tests/opengl.py
> >> @@ -704,6 +704,7 @@ with profile.test_list.group_manager(
> >>  g(['getteximage-targets', '1D'])
> >>  g(['getteximage-targets', '2D'])
> >>  g(['teximage-scale-bias'])
> >> +g(['tex-upside-down-miptree'])
> >>  add_msaa_visual_plain_tests(g, ['draw-pixels'])
> >>  add_msaa_visual_plain_tests(g, ['read-front'],
> run_concurrent=False)
> >>  add_msaa_visual_plain_tests(g, ['read-front', 'clear-front-first'],
> >> diff --git a/tests/texturing/CMakeLists.gl.txt
> >> b/tests/texturing/CMakeLists.gl.txt
> >> index e5d41e432..02b572c79 100644
> >> --- a/tests/texturing/CMakeLists.gl.txt
> >> +++ b/tests/texturing/CMakeLists.gl.txt
> >> @@ -98,5 +98,6 @@ piglit_add_executable (texture-al texture-al.c)
> >>  piglit_add_executable (texture-rg texture-rg.c)
> >>  piglit_add_executable (teximage-colors teximage-colors.c)
> >>  piglit_add_executable (zero-tex-coord zero-tex-coord.c)
> >> +piglit_add_executable (tex-upside-down-miptree
> tex-upside-down-miptree.c)
> >>
> >>  # vim: ft=cmake:
> >> diff --git a/tests/texturing/tex-upside-down-miptree.c
> >> b/tests/texturing/tex-upside-down-miptree.c
> >> new file mode 100644
> >> index 0..8e8f7154b
> >> --- /dev/null
> >> +++ b/tests/texturing/tex-upside-down-miptree.c
> >> @@ -0,0 +1,171 @@
> >> +/*
> >> + * Copyright (c) 2018 Andrii Simiklit
> >> + *
> >> + * Permission is hereby granted, free of charge, to any person
> obtaining a
> >> + * copy of this software and associated documentation files (the
> >> "Software"),
> >> + * to deal in the Software without restriction, including without
> >> limitation
> >> + * the rights to use, copy, modify, merge, publish, distribute,
> >> sublicense,
> >> + * and/or se

Re: [Piglit] [PATCH v2] miptree: test ability to use upside down miptree

2018-12-04 Thread andrey simiklit
Hello,

Didn't know it, thanks for clarification :)

Regards,
Andrii.


On Mon, Dec 3, 2018 at 8:01 PM Mark Janes  wrote:

> It's preferable to push piglit tests first, and produce the CI test
> failure.  CI staff will track the failure, and attribute it to the
> piglit patch.  When the subsequent mesa patch is pushed, we track the
> resolution.  The process gives us artifacts in git that help to analyze
> driver differences between stable releases.
>
> -Mark
>
> andrey simiklit  writes:
>
> > Hello,
> >
> > If this patch is acceptable by everybody then
> > I guess that we need to push the following mesa patch before this one
> > to avoid errors from Intel CI because the fix for an issue which is
> tested
> > by this test is still there.
> >
> > https://patchwork.freedesktop.org/patch/254397/
> > One of the last comment from Kenneth Graunke :
> >
> >>".
> >> So, back to Reviewed-by.  I think once we get a Piglit test, I'm
> happy
> >> to land this patch.
> >>
> >>--Ken"
> >>
> >
> > Thanks,
> > Andrii.
> >
> > On Mon, Dec 3, 2018 at 5:07 PM  wrote:
> >
> >> From: Andrii Simiklit 
> >>
> >> Test that usage of upside down miptree doesn't cause assertion
> >>
> >> The miptree:
> >>
> >> level 0 = 1x1
> >> level 1 = 2x2
> >> level 2 = 4x4
> >> ...
> >> level n = NxN
> >>
> >> should be acceptable for case when we don't use a min filter.
> >>
> >> v2: - Unnecessary function calls were removed
> >> - The 'glClearColor' call was moved to 'piglit_display' function
> >> - The program creation was moved to 'piglit_init' function
> >> - The requirements check was moved to 'piglit_init' function
> >>( Erik Faye-Lund  )
> >>
> >> - Fixed a leak of texture which is created in 'setup_texture'
> >>
> >> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
> >> Signed-off-by: Andrii Simiklit 
> >> Reviewed-by: Erik Faye-Lund 
> >> ---
> >>  tests/opengl.py   |   1 +
> >>  tests/texturing/CMakeLists.gl.txt |   1 +
> >>  tests/texturing/tex-upside-down-miptree.c | 171 ++
> >>  3 files changed, 173 insertions(+)
> >>  create mode 100644 tests/texturing/tex-upside-down-miptree.c
> >>
> >> diff --git a/tests/opengl.py b/tests/opengl.py
> >> index f7e408cd5..f6a38e40e 100644
> >> --- a/tests/opengl.py
> >> +++ b/tests/opengl.py
> >> @@ -704,6 +704,7 @@ with profile.test_list.group_manager(
> >>  g(['getteximage-targets', '1D'])
> >>  g(['getteximage-targets', '2D'])
> >>  g(['teximage-scale-bias'])
> >> +g(['tex-upside-down-miptree'])
> >>  add_msaa_visual_plain_tests(g, ['draw-pixels'])
> >>  add_msaa_visual_plain_tests(g, ['read-front'],
> run_concurrent=False)
> >>  add_msaa_visual_plain_tests(g, ['read-front', 'clear-front-first'],
> >> diff --git a/tests/texturing/CMakeLists.gl.txt
> >> b/tests/texturing/CMakeLists.gl.txt
> >> index e5d41e432..02b572c79 100644
> >> --- a/tests/texturing/CMakeLists.gl.txt
> >> +++ b/tests/texturing/CMakeLists.gl.txt
> >> @@ -98,5 +98,6 @@ piglit_add_executable (texture-al texture-al.c)
> >>  piglit_add_executable (texture-rg texture-rg.c)
> >>  piglit_add_executable (teximage-colors teximage-colors.c)
> >>  piglit_add_executable (zero-tex-coord zero-tex-coord.c)
> >> +piglit_add_executable (tex-upside-down-miptree
> tex-upside-down-miptree.c)
> >>
> >>  # vim: ft=cmake:
> >> diff --git a/tests/texturing/tex-upside-down-miptree.c
> >> b/tests/texturing/tex-upside-down-miptree.c
> >> new file mode 100644
> >> index 0..8e8f7154b
> >> --- /dev/null
> >> +++ b/tests/texturing/tex-upside-down-miptree.c
> >> @@ -0,0 +1,171 @@
> >> +/*
> >> + * Copyright (c) 2018 Andrii Simiklit
> >> + *
> >> + * Permission is hereby granted, free of charge, to any person
> obtaining a
> >> + * copy of this software and associated documentation files (the
> >> "Software"),
> >> + * to deal in the Software without restriction, including without
> >> limitation
> >> + * the rights to use, copy, modify, merge, publish, distribute,
> >> sublicense,
> >> + * and/or sell copies of the Software

Re: [Piglit] [PATCH v2] miptree: test ability to use upside down miptree

2018-12-03 Thread andrey simiklit
Hello,

If this patch is acceptable by everybody then
I guess that we need to push the following mesa patch before this one
to avoid errors from Intel CI because the fix for an issue which is tested
by this test is still there.

https://patchwork.freedesktop.org/patch/254397/
One of the last comment from Kenneth Graunke :

>".
> So, back to Reviewed-by.  I think once we get a Piglit test, I'm happy
> to land this patch.
>
>--Ken"
>

Thanks,
Andrii.

On Mon, Dec 3, 2018 at 5:07 PM  wrote:

> From: Andrii Simiklit 
>
> Test that usage of upside down miptree doesn't cause assertion
>
> The miptree:
>
> level 0 = 1x1
> level 1 = 2x2
> level 2 = 4x4
> ...
> level n = NxN
>
> should be acceptable for case when we don't use a min filter.
>
> v2: - Unnecessary function calls were removed
> - The 'glClearColor' call was moved to 'piglit_display' function
> - The program creation was moved to 'piglit_init' function
> - The requirements check was moved to 'piglit_init' function
>( Erik Faye-Lund  )
>
> - Fixed a leak of texture which is created in 'setup_texture'
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
> Signed-off-by: Andrii Simiklit 
> Reviewed-by: Erik Faye-Lund 
> ---
>  tests/opengl.py   |   1 +
>  tests/texturing/CMakeLists.gl.txt |   1 +
>  tests/texturing/tex-upside-down-miptree.c | 171 ++
>  3 files changed, 173 insertions(+)
>  create mode 100644 tests/texturing/tex-upside-down-miptree.c
>
> diff --git a/tests/opengl.py b/tests/opengl.py
> index f7e408cd5..f6a38e40e 100644
> --- a/tests/opengl.py
> +++ b/tests/opengl.py
> @@ -704,6 +704,7 @@ with profile.test_list.group_manager(
>  g(['getteximage-targets', '1D'])
>  g(['getteximage-targets', '2D'])
>  g(['teximage-scale-bias'])
> +g(['tex-upside-down-miptree'])
>  add_msaa_visual_plain_tests(g, ['draw-pixels'])
>  add_msaa_visual_plain_tests(g, ['read-front'], run_concurrent=False)
>  add_msaa_visual_plain_tests(g, ['read-front', 'clear-front-first'],
> diff --git a/tests/texturing/CMakeLists.gl.txt
> b/tests/texturing/CMakeLists.gl.txt
> index e5d41e432..02b572c79 100644
> --- a/tests/texturing/CMakeLists.gl.txt
> +++ b/tests/texturing/CMakeLists.gl.txt
> @@ -98,5 +98,6 @@ piglit_add_executable (texture-al texture-al.c)
>  piglit_add_executable (texture-rg texture-rg.c)
>  piglit_add_executable (teximage-colors teximage-colors.c)
>  piglit_add_executable (zero-tex-coord zero-tex-coord.c)
> +piglit_add_executable (tex-upside-down-miptree tex-upside-down-miptree.c)
>
>  # vim: ft=cmake:
> diff --git a/tests/texturing/tex-upside-down-miptree.c
> b/tests/texturing/tex-upside-down-miptree.c
> new file mode 100644
> index 0..8e8f7154b
> --- /dev/null
> +++ b/tests/texturing/tex-upside-down-miptree.c
> @@ -0,0 +1,171 @@
> +/*
> + * Copyright (c) 2018 Andrii Simiklit
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the
> "Software"),
> + * to deal in the Software without restriction, including without
> limitation
> + * the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the
> next
> + * paragraph) shall be included in all copies or substantial portions of
> the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
> SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> DEALINGS
> + * IN THE SOFTWARE.
> + *
> + * Authors:
> + *Andrii Simiklit 
> + *
> + */
> +
> +/**
> + * Test what there no an assertion when we use upside down miptree and
> + * GL_TEXTURE_MIN_FILTER is GL_LINEAR, base level is not 0
> + * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
> + */
> +
> +#include "piglit-util-gl.h"
> +#define TW 64
> +#define TH 64
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> +   config.supports_gl_compat_version = 10;
> +
> +   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
> PIGLIT_GL_VISUAL_DOUBLE;
> +   config.khr_no_error_support = PIGLIT_NO_ERRORS;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +GLuint prog = 0;
> +GLuint texture = 0;
> +static unsigned nlevels = 0;
> +static const char *fragShaderText =
> +   "uniform sampler2D tex;\n"
> +   "void main()\n"
> +   "{\n"
> +   "   gl_FragColor = texture2D(tex, 

Re: [Piglit] [PATCH] miptree: test ability to use upside down miptree

2018-12-03 Thread andrey simiklit
Hello,

I think that I found one more issue (small but anyway issue) in my patch.
The texture which is created in 'setup_texture' function is never released (
I would like to delete it at end of the 'piglit_display'.

Regards,
Andrii.

On Mon, Dec 3, 2018 at 4:14 PM andrey simiklit 
wrote:

> On Mon, Dec 3, 2018 at 1:50 PM Erik Faye-Lund <
> erik.faye-l...@collabora.com> wrote:
>
>> On Mon, 2018-12-03 at 13:31 +0200, andrey simiklit wrote:
>> > Hello,
>> >
>> > Thanks for review.
>> > I will fix all these issues and provide v2 shortly :)
>> >
>> > Thanks,
>> > Andrii.
>> >
>> > On Mon, Dec 3, 2018 at 12:37 PM Erik Faye-Lund <
>> > erik.faye-l...@collabora.com> wrote:
>> > > Just a few nits, do with them as you like. The test itself looks
>> > > good
>> > > to me :)
>> > >
>> > > Reviewed-by: Erik Faye-Lund 
>> > >
>> > > On Tue, 2018-10-23 at 16:44 +0300, asimiklit.w...@gmail.com wrote:
>> > > > From: Andrii Simiklit 
>> > > >
>> > > > Test that usage of upside down miptree doesn't cause assertion
>> > > >
>> > > > The miptree:
>> > > >
>> > > > level 0 = 1x1
>> > > > level 1 = 2x2
>> > > > level 2 = 4x4
>> > > > ...
>> > > > level n = NxN
>> > > >
>> > > > should be acceptable for case when we don't use a min filter.
>> > > >
>> > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
>> > > > Signed-off-by: Andrii Simiklit 
>> > > > ---
>> > > >  tests/opengl.py   |   1 +
>> > > >  tests/texturing/CMakeLists.gl.txt |   1 +
>> > > >  tests/texturing/tex-upside-down-miptree.c | 171
>> > > > ++
>> > > >  3 files changed, 173 insertions(+)
>> > > >  create mode 100644 tests/texturing/tex-upside-down-miptree.c
>> > > >
>> > > > diff --git a/tests/opengl.py b/tests/opengl.py
>> > > > index f7e408cd5..f6a38e40e 100644
>> > > > --- a/tests/opengl.py
>> > > > +++ b/tests/opengl.py
>> > > > @@ -704,6 +704,7 @@ with profile.test_list.group_manager(
>> > > >  g(['getteximage-targets', '1D'])
>> > > >  g(['getteximage-targets', '2D'])
>> > > >  g(['teximage-scale-bias'])
>> > > > +g(['tex-upside-down-miptree'])
>> > > >  add_msaa_visual_plain_tests(g, ['draw-pixels'])
>> > > >  add_msaa_visual_plain_tests(g, ['read-front'],
>> > > > run_concurrent=False)
>> > > >  add_msaa_visual_plain_tests(g, ['read-front', 'clear-front-
>> > > > first'],
>> > > > diff --git a/tests/texturing/CMakeLists.gl.txt
>> > > > b/tests/texturing/CMakeLists.gl.txt
>> > > > index e5d41e432..02b572c79 100644
>> > > > --- a/tests/texturing/CMakeLists.gl.txt
>> > > > +++ b/tests/texturing/CMakeLists.gl.txt
>> > > > @@ -98,5 +98,6 @@ piglit_add_executable (texture-al texture-al.c)
>> > > >  piglit_add_executable (texture-rg texture-rg.c)
>> > > >  piglit_add_executable (teximage-colors teximage-colors.c)
>> > > >  piglit_add_executable (zero-tex-coord zero-tex-coord.c)
>> > > > +piglit_add_executable (tex-upside-down-miptree tex-upside-down-
>> > > > miptree.c)
>> > > >
>> > > >  # vim: ft=cmake:
>> > > > diff --git a/tests/texturing/tex-upside-down-miptree.c
>> > > > b/tests/texturing/tex-upside-down-miptree.c
>> > > > new file mode 100644
>> > > > index 0..2d10fb49a
>> > > > --- /dev/null
>> > > > +++ b/tests/texturing/tex-upside-down-miptree.c
>> > > > @@ -0,0 +1,171 @@
>> > > > +/*
>> > > > + * Copyright (c) 2018 Andrii Simiklit
>> > > > + *
>> > > > + * Permission is hereby granted, free of charge, to any person
>> > > > obtaining a
>> > > > + * copy of this software and associated documentation files (the
>> > > > "Software"),
>> > > > + * to deal in the Software without restriction, including
>> > > without
>> > > > limitation
>> > > > + * the rights to use, copy, modify, merge, publish, distribute,
>> > > &

Re: [Piglit] [PATCH] miptree: test ability to use upside down miptree

2018-12-03 Thread andrey simiklit
On Mon, Dec 3, 2018 at 1:50 PM Erik Faye-Lund 
wrote:

> On Mon, 2018-12-03 at 13:31 +0200, andrey simiklit wrote:
> > Hello,
> >
> > Thanks for review.
> > I will fix all these issues and provide v2 shortly :)
> >
> > Thanks,
> > Andrii.
> >
> > On Mon, Dec 3, 2018 at 12:37 PM Erik Faye-Lund <
> > erik.faye-l...@collabora.com> wrote:
> > > Just a few nits, do with them as you like. The test itself looks
> > > good
> > > to me :)
> > >
> > > Reviewed-by: Erik Faye-Lund 
> > >
> > > On Tue, 2018-10-23 at 16:44 +0300, asimiklit.w...@gmail.com wrote:
> > > > From: Andrii Simiklit 
> > > >
> > > > Test that usage of upside down miptree doesn't cause assertion
> > > >
> > > > The miptree:
> > > >
> > > > level 0 = 1x1
> > > > level 1 = 2x2
> > > > level 2 = 4x4
> > > > ...
> > > > level n = NxN
> > > >
> > > > should be acceptable for case when we don't use a min filter.
> > > >
> > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
> > > > Signed-off-by: Andrii Simiklit 
> > > > ---
> > > >  tests/opengl.py   |   1 +
> > > >  tests/texturing/CMakeLists.gl.txt |   1 +
> > > >  tests/texturing/tex-upside-down-miptree.c | 171
> > > > ++
> > > >  3 files changed, 173 insertions(+)
> > > >  create mode 100644 tests/texturing/tex-upside-down-miptree.c
> > > >
> > > > diff --git a/tests/opengl.py b/tests/opengl.py
> > > > index f7e408cd5..f6a38e40e 100644
> > > > --- a/tests/opengl.py
> > > > +++ b/tests/opengl.py
> > > > @@ -704,6 +704,7 @@ with profile.test_list.group_manager(
> > > >  g(['getteximage-targets', '1D'])
> > > >  g(['getteximage-targets', '2D'])
> > > >  g(['teximage-scale-bias'])
> > > > +g(['tex-upside-down-miptree'])
> > > >  add_msaa_visual_plain_tests(g, ['draw-pixels'])
> > > >  add_msaa_visual_plain_tests(g, ['read-front'],
> > > > run_concurrent=False)
> > > >  add_msaa_visual_plain_tests(g, ['read-front', 'clear-front-
> > > > first'],
> > > > diff --git a/tests/texturing/CMakeLists.gl.txt
> > > > b/tests/texturing/CMakeLists.gl.txt
> > > > index e5d41e432..02b572c79 100644
> > > > --- a/tests/texturing/CMakeLists.gl.txt
> > > > +++ b/tests/texturing/CMakeLists.gl.txt
> > > > @@ -98,5 +98,6 @@ piglit_add_executable (texture-al texture-al.c)
> > > >  piglit_add_executable (texture-rg texture-rg.c)
> > > >  piglit_add_executable (teximage-colors teximage-colors.c)
> > > >  piglit_add_executable (zero-tex-coord zero-tex-coord.c)
> > > > +piglit_add_executable (tex-upside-down-miptree tex-upside-down-
> > > > miptree.c)
> > > >
> > > >  # vim: ft=cmake:
> > > > diff --git a/tests/texturing/tex-upside-down-miptree.c
> > > > b/tests/texturing/tex-upside-down-miptree.c
> > > > new file mode 100644
> > > > index 0..2d10fb49a
> > > > --- /dev/null
> > > > +++ b/tests/texturing/tex-upside-down-miptree.c
> > > > @@ -0,0 +1,171 @@
> > > > +/*
> > > > + * Copyright (c) 2018 Andrii Simiklit
> > > > + *
> > > > + * Permission is hereby granted, free of charge, to any person
> > > > obtaining a
> > > > + * copy of this software and associated documentation files (the
> > > > "Software"),
> > > > + * to deal in the Software without restriction, including
> > > without
> > > > limitation
> > > > + * the rights to use, copy, modify, merge, publish, distribute,
> > > > sublicense,
> > > > + * and/or sell copies of the Software, and to permit persons to
> > > whom
> > > > the
> > > > + * Software is furnished to do so, subject to the following
> > > > conditions:
> > > > + *
> > > > + * The above copyright notice and this permission notice
> > > (including
> > > > the next
> > > > + * paragraph) shall be included in all copies or substantial
> > > > portions of the
> > > > + * Software.
> > > > + *
> > > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
> >

Re: [Piglit] [PATCH] miptree: test ability to use upside down miptree

2018-12-03 Thread andrey simiklit
Hello,

Thanks for review.
I will fix all these issues and provide v2 shortly :)

Thanks,
Andrii.

On Mon, Dec 3, 2018 at 12:37 PM Erik Faye-Lund 
wrote:

> Just a few nits, do with them as you like. The test itself looks good
> to me :)
>
> Reviewed-by: Erik Faye-Lund 
>
> On Tue, 2018-10-23 at 16:44 +0300, asimiklit.w...@gmail.com wrote:
> > From: Andrii Simiklit 
> >
> > Test that usage of upside down miptree doesn't cause assertion
> >
> > The miptree:
> >
> > level 0 = 1x1
> > level 1 = 2x2
> > level 2 = 4x4
> > ...
> > level n = NxN
> >
> > should be acceptable for case when we don't use a min filter.
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
> > Signed-off-by: Andrii Simiklit 
> > ---
> >  tests/opengl.py   |   1 +
> >  tests/texturing/CMakeLists.gl.txt |   1 +
> >  tests/texturing/tex-upside-down-miptree.c | 171
> > ++
> >  3 files changed, 173 insertions(+)
> >  create mode 100644 tests/texturing/tex-upside-down-miptree.c
> >
> > diff --git a/tests/opengl.py b/tests/opengl.py
> > index f7e408cd5..f6a38e40e 100644
> > --- a/tests/opengl.py
> > +++ b/tests/opengl.py
> > @@ -704,6 +704,7 @@ with profile.test_list.group_manager(
> >  g(['getteximage-targets', '1D'])
> >  g(['getteximage-targets', '2D'])
> >  g(['teximage-scale-bias'])
> > +g(['tex-upside-down-miptree'])
> >  add_msaa_visual_plain_tests(g, ['draw-pixels'])
> >  add_msaa_visual_plain_tests(g, ['read-front'],
> > run_concurrent=False)
> >  add_msaa_visual_plain_tests(g, ['read-front', 'clear-front-
> > first'],
> > diff --git a/tests/texturing/CMakeLists.gl.txt
> > b/tests/texturing/CMakeLists.gl.txt
> > index e5d41e432..02b572c79 100644
> > --- a/tests/texturing/CMakeLists.gl.txt
> > +++ b/tests/texturing/CMakeLists.gl.txt
> > @@ -98,5 +98,6 @@ piglit_add_executable (texture-al texture-al.c)
> >  piglit_add_executable (texture-rg texture-rg.c)
> >  piglit_add_executable (teximage-colors teximage-colors.c)
> >  piglit_add_executable (zero-tex-coord zero-tex-coord.c)
> > +piglit_add_executable (tex-upside-down-miptree tex-upside-down-
> > miptree.c)
> >
> >  # vim: ft=cmake:
> > diff --git a/tests/texturing/tex-upside-down-miptree.c
> > b/tests/texturing/tex-upside-down-miptree.c
> > new file mode 100644
> > index 0..2d10fb49a
> > --- /dev/null
> > +++ b/tests/texturing/tex-upside-down-miptree.c
> > @@ -0,0 +1,171 @@
> > +/*
> > + * Copyright (c) 2018 Andrii Simiklit
> > + *
> > + * Permission is hereby granted, free of charge, to any person
> > obtaining a
> > + * copy of this software and associated documentation files (the
> > "Software"),
> > + * to deal in the Software without restriction, including without
> > limitation
> > + * the rights to use, copy, modify, merge, publish, distribute,
> > sublicense,
> > + * and/or sell copies of the Software, and to permit persons to whom
> > the
> > + * Software is furnished to do so, subject to the following
> > conditions:
> > + *
> > + * The above copyright notice and this permission notice (including
> > the next
> > + * paragraph) shall be included in all copies or substantial
> > portions of the
> > + * Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> > EXPRESS OR
> > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> > MERCHANTABILITY,
> > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO
> > EVENT SHALL
> > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
> > OR OTHER
> > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
> > ARISING
> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> > OTHER DEALINGS
> > + * IN THE SOFTWARE.
> > + *
> > + * Authors:
> > + *Andrii Simiklit 
> > + *
> > + */
> > +
> > +/**
> > + * Test what there no an assertion when we use upside down miptree
> > and
> > + * GL_TEXTURE_MIN_FILTER is GL_LINEAR, base level is not 0
> > + * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
> > + */
> > +
> > +#include "piglit-util-gl.h"
> > +#define TW 64
> > +#define TH 64
> > +
> > +PIGLIT_GL_TEST_CONFIG_BEGIN
> > +
> > + config.supports_gl_compat_version = 10;
>
> Just a suggestion:
>
> Since you already did the hassle of using shaders, perhaps you could
> get this text to work on GLES 2?
>
> > +
> > + config.window_visual = PIGLIT_GL_VISUAL_RGBA |
> > PIGLIT_GL_VISUAL_DOUBLE;
> > + config.khr_no_error_support = PIGLIT_NO_ERRORS;
> > +
> > +PIGLIT_GL_TEST_CONFIG_END
> > +
> > +static unsigned nlevels = 0;
> > +
> > +static void
> > +get_rect_bounds(int pos, int *x, int *y, int *w, int *h)
> > +{
> > + *x = pos * (piglit_width / 3) + 5;
> > + *y = 5;
> > + *w = piglit_width / 3 - 10;
> > + *h = piglit_height - 10;
> > +}
> > +
> > +
> > +static void
> > +draw_rect(int pos)
> > +{
> > + int x, y, w, h;
> > + get_rect_bounds(pos, , , , );
> > + piglit_draw_rect_tex(x, y, w, h, 

Re: [Piglit] [PATCH] miptree: test ability to use upside down miptree

2018-11-30 Thread andrey simiklit
Hello,

Could somebody take a look at this patch?

Thanks a lot,
Andrii.

On Tue, Nov 6, 2018 at 12:33 PM andrey simiklit 
wrote:

> Hi all,
>
> Have somebody some suggestions for this test?
> This patch is needed to test an issue (assertion in mesa) which will be
> fixed by this mesa patch:
> https://patchwork.freedesktop.org/patch/254397/
>
> Regards,
> Andrii.
>
> On Tue, Oct 23, 2018 at 4:44 PM  wrote:
>
>> From: Andrii Simiklit 
>>
>> Test that usage of upside down miptree doesn't cause assertion
>>
>> The miptree:
>>
>> level 0 = 1x1
>> level 1 = 2x2
>> level 2 = 4x4
>> ...
>> level n = NxN
>>
>> should be acceptable for case when we don't use a min filter.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
>> Signed-off-by: Andrii Simiklit 
>> ---
>>  tests/opengl.py   |   1 +
>>  tests/texturing/CMakeLists.gl.txt |   1 +
>>  tests/texturing/tex-upside-down-miptree.c | 171 ++
>>  3 files changed, 173 insertions(+)
>>  create mode 100644 tests/texturing/tex-upside-down-miptree.c
>>
>> diff --git a/tests/opengl.py b/tests/opengl.py
>> index f7e408cd5..f6a38e40e 100644
>> --- a/tests/opengl.py
>> +++ b/tests/opengl.py
>> @@ -704,6 +704,7 @@ with profile.test_list.group_manager(
>>  g(['getteximage-targets', '1D'])
>>  g(['getteximage-targets', '2D'])
>>  g(['teximage-scale-bias'])
>> +g(['tex-upside-down-miptree'])
>>  add_msaa_visual_plain_tests(g, ['draw-pixels'])
>>  add_msaa_visual_plain_tests(g, ['read-front'], run_concurrent=False)
>>  add_msaa_visual_plain_tests(g, ['read-front', 'clear-front-first'],
>> diff --git a/tests/texturing/CMakeLists.gl.txt
>> b/tests/texturing/CMakeLists.gl.txt
>> index e5d41e432..02b572c79 100644
>> --- a/tests/texturing/CMakeLists.gl.txt
>> +++ b/tests/texturing/CMakeLists.gl.txt
>> @@ -98,5 +98,6 @@ piglit_add_executable (texture-al texture-al.c)
>>  piglit_add_executable (texture-rg texture-rg.c)
>>  piglit_add_executable (teximage-colors teximage-colors.c)
>>  piglit_add_executable (zero-tex-coord zero-tex-coord.c)
>> +piglit_add_executable (tex-upside-down-miptree tex-upside-down-miptree.c)
>>
>>  # vim: ft=cmake:
>> diff --git a/tests/texturing/tex-upside-down-miptree.c
>> b/tests/texturing/tex-upside-down-miptree.c
>> new file mode 100644
>> index 0..2d10fb49a
>> --- /dev/null
>> +++ b/tests/texturing/tex-upside-down-miptree.c
>> @@ -0,0 +1,171 @@
>> +/*
>> + * Copyright (c) 2018 Andrii Simiklit
>> + *
>> + * Permission is hereby granted, free of charge, to any person obtaining
>> a
>> + * copy of this software and associated documentation files (the
>> "Software"),
>> + * to deal in the Software without restriction, including without
>> limitation
>> + * the rights to use, copy, modify, merge, publish, distribute,
>> sublicense,
>> + * and/or sell copies of the Software, and to permit persons to whom the
>> + * Software is furnished to do so, subject to the following conditions:
>> + *
>> + * The above copyright notice and this permission notice (including the
>> next
>> + * paragraph) shall be included in all copies or substantial portions of
>> the
>> + * Software.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>> EXPRESS OR
>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
>> MERCHANTABILITY,
>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
>> SHALL
>> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
>> OTHER
>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
>> ARISING
>> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>> DEALINGS
>> + * IN THE SOFTWARE.
>> + *
>> + * Authors:
>> + *Andrii Simiklit 
>> + *
>> + */
>> +
>> +/**
>> + * Test what there no an assertion when we use upside down miptree and
>> + * GL_TEXTURE_MIN_FILTER is GL_LINEAR, base level is not 0
>> + * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
>> + */
>> +
>> +#include "piglit-util-gl.h"
>> +#define TW 64
>> +#define TH 64
>> +
>> +PIGLIT_GL_TEST_CONFIG_BEGIN
>> +
>> +   config.supports_gl_compat_version = 10;
>> +
>> +   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
>> PIGLIT_GL_VISUAL_DOUBLE;
>

Re: [Piglit] [PATCH] program_interface_query: don't expect a valid location for TCS output

2018-11-27 Thread andrey simiklit
Hello,

Thanks a lot for review.

Regards,
Andrii.

On Tue, Nov 27, 2018 at 11:23 AM Tapani Pälli 
wrote:

> Hi;
>
> On 10/31/18 5:05 PM, asimiklit.w...@gmail.com wrote:
> > From: Andrii Simiklit 
> >
> > I guess we should not expect a valid location for:
> > "patch out vec4 tcs_patch;"
> > because this output variable is declareted
> > without "layout (location=X)" and according to spec:
> > "Not all active variables are assigned valid locations; the
> >  following variables will have an effective location of -1:
> >
> >* uniforms declared as atomic counters;
> >
> >* members of a uniform block;
> >
> >* built-in inputs, outputs, and uniforms (starting with "gl_");
> and
> >
> >* inputs or outputs not declared with a "location" layout
> qualifier,
> >  except for vertex shader inputs and fragment shader outputs."
>
>
> I've verified that this is the way it is. It took me a while to digest
> this since the test uses PROGRAM_SEPARABLE here and the rules of the
> extension are quite complicated.
>
> However, I'm convinced now and this LGTM :)
>
> Reviewed-by: Tapani Pälli 
>
>
> > Also I fixed some conflicting comments.
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108612
> > Signed-off-by: Andrii Simiklit 
> > ---
> >   .../getprogramresourceiv.c   | 16 
> >   1 file changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git
> a/tests/spec/arb_program_interface_query/getprogramresourceiv.c
> b/tests/spec/arb_program_interface_query/getprogramresourceiv.c
> > index 2727a6c87..70212350e 100755
> > --- a/tests/spec/arb_program_interface_query/getprogramresourceiv.c
> > +++ b/tests/spec/arb_program_interface_query/getprogramresourceiv.c
> > @@ -360,7 +360,7 @@ static const struct subtest_t subtests[] = {
> >   { GL_REFERENCED_BY_GEOMETRY_SHADER, 1, { 0 } },
> >   { GL_REFERENCED_BY_FRAGMENT_SHADER, 1, { 0 } },
> >   { GL_REFERENCED_BY_COMPUTE_SHADER, 1, { 0 } },
> > - { GL_LOCATION, 1, { -1 } }, /* valid index == anything but -1 */
> > + { GL_LOCATION, 1, { -1 } }, /* invalid index */
> >   { 0, 0, { 0 } }}
> >},
> >{ _loc, GL_PROGRAM_INPUT, "input0", NULL, {
> > @@ -396,12 +396,12 @@ static const struct subtest_t subtests[] = {
> >   { GL_NAME_LENGTH, 1, { 6 } },
> >   { GL_TYPE, 1, { GL_FLOAT_VEC4 } },
> >   { GL_ARRAY_SIZE, 1, { 1 } },
> > - { GL_OFFSET, 1, { -1 } }, /* valid index == anything but -1 */
> > + { GL_OFFSET, 1, { -1 } }, /* invalid index */
> >   { GL_BLOCK_INDEX, 1, { -1 } }, /* invalid index */
> > - { GL_ARRAY_STRIDE, 1, { -1 } }, /* valid index == anything but -1
> */
> > + { GL_ARRAY_STRIDE, 1, { -1 } }, /* invalid index */
> >   { GL_MATRIX_STRIDE, 1, { -1 } },
> >   { GL_IS_ROW_MAJOR, 1, { 0 } },
> > - { GL_ATOMIC_COUNTER_BUFFER_INDEX, 1, { -1 } }, /* valid index ==
> anything but -1 */
> > + { GL_ATOMIC_COUNTER_BUFFER_INDEX, 1, { -1 } }, /* invalid index */
> >   { GL_REFERENCED_BY_VERTEX_SHADER, 1, { 0 } },
> >   { GL_REFERENCED_BY_TESS_CONTROL_SHADER, 1, { 0 } },
> >   { GL_REFERENCED_BY_TESS_EVALUATION_SHADER, 1, { 0 } },
> > @@ -421,8 +421,8 @@ static const struct subtest_t subtests[] = {
> >  { GL_REFERENCED_BY_GEOMETRY_SHADER, 1, { 0 } },
> >  { GL_REFERENCED_BY_FRAGMENT_SHADER, 1, { 0 } },
> >  { GL_REFERENCED_BY_COMPUTE_SHADER, 1, { 0 } },
> > -   { GL_LOCATION, 1, { 0 } }, /* valid index == anything but -1 */
> > -   { GL_LOCATION_INDEX, 1, { -1 } }, /* valid index == anything but
> -1 */
> > +   { GL_LOCATION, 1, { -1 } }, /* invalid index */
> > +   { GL_LOCATION_INDEX, 1, { -1 } }, /* invalid index */
> >  { GL_IS_PER_PATCH, 1, { 1 } },
> >  { 0, 0, { 0 } }}
> >   },
> > @@ -435,14 +435,14 @@ static const struct subtest_t subtests[] = {
> >   { GL_ARRAY_STRIDE, 1, { 0 } }, /* valid index == anything but -1 */
> >   { GL_MATRIX_STRIDE, 1, { 0 } },
> >   { GL_IS_ROW_MAJOR, 1, { 0 } },
> > - { GL_ATOMIC_COUNTER_BUFFER_INDEX, 1, { -1 } }, /* valid index ==
> anything but -1 */
> > + { GL_ATOMIC_COUNTER_BUFFER_INDEX, 1, { -1 } }, /* invalid index */
> >   { GL_REFERENCED_BY_VERTEX_SHADER, 1, { 0 } },
> >   { GL_REFERENCED_BY_TESS_CONTROL_SHADER, 1, { 0 } },
> >   { GL_REFERENCED_BY_TESS_EVALUATION_SHADER, 1, { 0 } },
> >   { GL_REFERENCED_BY_GEOMETRY_SHADER, 1, { 0 } },
> >   { GL_REFERENCED_BY_FRAGMENT_SHADER, 1, { 1 } },
> >   { GL_REFERENCED_BY_COMPUTE_SHADER, 1, { 0 } },
> > - { GL_LOCATION, 1, { -1 } }, /* valid index == anything but -1 */
> > + { GL_LOCATION, 1, { -1 } }, /* invalid index */
> >   { 0, 0, { 0 } }}
> >},
> >{ _std, GL_UNIFORM_BLOCK, "fs_uniform_block",
> fs_std_fs_uniform_blk, {
> >
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2] egl: doesn't allow egl to create a forward-compatible context with req ver < 3

2018-11-06 Thread andrey simiklit
Hello,

Any updates here? :-)
This test is needed to check issue which should be fixed by the following
mesa patch:
https://patchwork.freedesktop.org/patch/256063/

This issue mentioned in this bug by Ian Romanick :
https://bugzilla.freedesktop.org/show_bug.cgi?id=92552#c9

Regards,
Andrii.

On Fri, Oct 12, 2018 at 3:11 PM  wrote:

> From: Andrii Simiklit 
>
> EGL_KHR_create_context spec says:
>"The default values for EGL_CONTEXT_MAJOR_VERSION_KHR and
> EGL_CONTEXT_MINOR_VERSION_KHR are 1 and 0 respectively."
>
> requesting a forward-compatible context for OpenGL
> versions less than 3.0 will generate an error.
>
>  "* If an OpenGL context is requested and the values for attributes
> EGL_CONTEXT_MAJOR_VERSION_KHR and EGL_CONTEXT_MINOR_VERSION_KHR,
> when considered together with the value for attribute
> EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR, specify an OpenGL
> version and feature set that are not defined, than an
> EGL_BAD_MATCH error is generated.
>
> The defined versions of OpenGL at the time of writing are OpenGL
> 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 2.0, 2.1, 3.0, 3.1, 3.2, 4.0, 4.1,
> 4.2, and 4.3. Feature deprecation was introduced with OpenGL
> 3.0, so forward-compatible contexts may only be requested for
> OpenGL 3.0 and above. Thus, examples of invalid combinations of
> attributes include:
>
>   - Major version < 1 or > 4
>   - Major version == 1 and minor version < 0 or > 5
>   - Major version == 2 and minor version < 0 or > 1
>   - Major version == 3 and minor version < 0 or > 2
>   - Major version == 4 and minor version < 0 or > 3
>   - Forward-compatible flag set and major version < 3
>
> Because the purpose of forward-compatible contexts is to allow
> application development on a specific OpenGL version with the
> knowledge that the app will run on a future version, context
> creation will fail if
> EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR is set and the
> context version returned cannot implement exactly the requested
> version."
>
> v2: (Matt Turner) - The 'piglit_report_result' calls are moved to 'main'
>   - The variable oresult => result
>   - Fixed whitespace errors
>   - Fixed missing spaces after 'for'
>
> Signed-off-by: Andrii Simiklit 
> ---
>  .../valid-flag-forward-compatible-gl.c| 74 +++
>  1 file changed, 59 insertions(+), 15 deletions(-)
>
> diff --git
> a/tests/egl/spec/egl_khr_create_context/valid-flag-forward-compatible-gl.c
> b/tests/egl/spec/egl_khr_create_context/valid-flag-forward-compatible-gl.c
> index 42feb54d6..6d2bd0d9f 100644
> ---
> a/tests/egl/spec/egl_khr_create_context/valid-flag-forward-compatible-gl.c
> +++
> b/tests/egl/spec/egl_khr_create_context/valid-flag-forward-compatible-gl.c
> @@ -23,16 +23,30 @@
>  #include "piglit-util-egl.h"
>  #include "common.h"
>
> -int gl_version;
> +int gl_version = 0;
>
> -static bool try_flag(int flag)
> +static bool try_flag(int req_version, int flag)
>  {
> -   const EGLint attribs[] = {
> -   EGL_CONTEXT_FLAGS_KHR, flag,
> -   EGL_NONE
> -   };
> +   bool result = true;
> +   const unsigned vidx = req_version < 0 ? 0 : (req_version == 0) ? 1
> : 2;
> +   const bool is_forward_compatible =
> +   (0 != (flag &
> EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR));
>
> -   ctx = eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, attribs);
> +   const EGLint attribs[][5] = {
> +   /*req_version-before-case*/
> +   { EGL_CONTEXT_MAJOR_VERSION_KHR, abs(req_version),
> + EGL_CONTEXT_FLAGS_KHR, flag,
> + EGL_NONE },
> +   /*no-req_version-case*/
> +   { EGL_CONTEXT_FLAGS_KHR, flag,
> + EGL_NONE },
> +   /*req_version-after-case-*/
> +   { EGL_CONTEXT_FLAGS_KHR, flag,
> + EGL_CONTEXT_MAJOR_VERSION_KHR, abs(req_version),
> + EGL_NONE }
> +   };
> +   assert(vidx < 3);
> +   ctx = eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT,
> attribs[vidx]);
> if (ctx != NULL) {
> /* Get GL version in order to know whether we can test
>  * EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR.
> @@ -47,6 +61,17 @@ static bool try_flag(int flag)
>
> gl_version = piglit_get_gl_version();
> }
> +   if (abs(req_version) < 3 && is_forward_compatible) {
> +   /* The EGL_KHR_create_context spec says:
> +*
> +* requesting a forward-compatible context for
> OpenGL
> +  

Re: [Piglit] [PATCH] miptree: test ability to use upside down miptree

2018-11-06 Thread andrey simiklit
Hi all,

Have somebody some suggestions for this test?
This patch is needed to test an issue (assertion in mesa) which will be
fixed by this mesa patch:
https://patchwork.freedesktop.org/patch/254397/

Regards,
Andrii.

On Tue, Oct 23, 2018 at 4:44 PM  wrote:

> From: Andrii Simiklit 
>
> Test that usage of upside down miptree doesn't cause assertion
>
> The miptree:
>
> level 0 = 1x1
> level 1 = 2x2
> level 2 = 4x4
> ...
> level n = NxN
>
> should be acceptable for case when we don't use a min filter.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
> Signed-off-by: Andrii Simiklit 
> ---
>  tests/opengl.py   |   1 +
>  tests/texturing/CMakeLists.gl.txt |   1 +
>  tests/texturing/tex-upside-down-miptree.c | 171 ++
>  3 files changed, 173 insertions(+)
>  create mode 100644 tests/texturing/tex-upside-down-miptree.c
>
> diff --git a/tests/opengl.py b/tests/opengl.py
> index f7e408cd5..f6a38e40e 100644
> --- a/tests/opengl.py
> +++ b/tests/opengl.py
> @@ -704,6 +704,7 @@ with profile.test_list.group_manager(
>  g(['getteximage-targets', '1D'])
>  g(['getteximage-targets', '2D'])
>  g(['teximage-scale-bias'])
> +g(['tex-upside-down-miptree'])
>  add_msaa_visual_plain_tests(g, ['draw-pixels'])
>  add_msaa_visual_plain_tests(g, ['read-front'], run_concurrent=False)
>  add_msaa_visual_plain_tests(g, ['read-front', 'clear-front-first'],
> diff --git a/tests/texturing/CMakeLists.gl.txt
> b/tests/texturing/CMakeLists.gl.txt
> index e5d41e432..02b572c79 100644
> --- a/tests/texturing/CMakeLists.gl.txt
> +++ b/tests/texturing/CMakeLists.gl.txt
> @@ -98,5 +98,6 @@ piglit_add_executable (texture-al texture-al.c)
>  piglit_add_executable (texture-rg texture-rg.c)
>  piglit_add_executable (teximage-colors teximage-colors.c)
>  piglit_add_executable (zero-tex-coord zero-tex-coord.c)
> +piglit_add_executable (tex-upside-down-miptree tex-upside-down-miptree.c)
>
>  # vim: ft=cmake:
> diff --git a/tests/texturing/tex-upside-down-miptree.c
> b/tests/texturing/tex-upside-down-miptree.c
> new file mode 100644
> index 0..2d10fb49a
> --- /dev/null
> +++ b/tests/texturing/tex-upside-down-miptree.c
> @@ -0,0 +1,171 @@
> +/*
> + * Copyright (c) 2018 Andrii Simiklit
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the
> "Software"),
> + * to deal in the Software without restriction, including without
> limitation
> + * the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the
> next
> + * paragraph) shall be included in all copies or substantial portions of
> the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
> SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> DEALINGS
> + * IN THE SOFTWARE.
> + *
> + * Authors:
> + *Andrii Simiklit 
> + *
> + */
> +
> +/**
> + * Test what there no an assertion when we use upside down miptree and
> + * GL_TEXTURE_MIN_FILTER is GL_LINEAR, base level is not 0
> + * Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987
> + */
> +
> +#include "piglit-util-gl.h"
> +#define TW 64
> +#define TH 64
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> +   config.supports_gl_compat_version = 10;
> +
> +   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
> PIGLIT_GL_VISUAL_DOUBLE;
> +   config.khr_no_error_support = PIGLIT_NO_ERRORS;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +static unsigned nlevels = 0;
> +
> +static void
> +get_rect_bounds(int pos, int *x, int *y, int *w, int *h)
> +{
> +   *x = pos * (piglit_width / 3) + 5;
> +   *y = 5;
> +   *w = piglit_width / 3 - 10;
> +   *h = piglit_height - 10;
> +}
> +
> +
> +static void
> +draw_rect(int pos)
> +{
> +   int x, y, w, h;
> +   get_rect_bounds(pos, , , , );
> +   piglit_draw_rect_tex(x, y, w, h, 0, 0, 1, 1);
> +}
> +
> +
> +static GLboolean
> +probe_pos(int pos, const GLfloat expected[4])
> +{
> +   int x, y, w, h;
> +   get_rect_bounds(pos, , , , );
> +   return piglit_probe_rect_rgba(x, y, w, h, expected);
> +}
> +
> +
> +enum piglit_result
> +piglit_display(void)
> +{
> +   GLboolean pass = GL_TRUE;
> +   unsigned level;
> +   static const char *fragShaderText =
> +   "uniform sampler2D tex;\n"
> +   "void main()\n"
> +

Re: [Piglit] [PATCH] glsl/frexp: fix the incorrect expected values

2018-11-06 Thread andrey simiklit
Hello,

Thanks a lot

Andrii.

On Mon, Nov 5, 2018 at 11:03 PM Marek Olšák  wrote:

> Pushed, thanks!
>
> Marek
>
> On Wed, Oct 31, 2018 at 7:35 AM andrey simiklit 
> wrote:
>
>> Hello,
>>
>> Could you please help me with a push.
>>
>> Thanks,
>> Andrii.
>>
>> On Fri, Oct 26, 2018 at 5:50 PM andrey simiklit 
>> wrote:
>>
>>> Hello,
>>>
>>> Thanks a lot for reviewing.
>>>
>>> Regards,
>>> Andrii.
>>>
>>> On Fri, Oct 26, 2018 at 3:23 PM Haehnle, Nicolai <
>>> nicolai.haeh...@amd.com> wrote:
>>>
>>>> On 24.10.18 14:52, asimiklit.w...@gmail.com wrote:
>>>> > From: Andrii Simiklit 
>>>> >
>>>> > I guess that this test has the incorrect expected values.
>>>> > For instance the test expects that exponent for a value 2 will be 1
>>>> > But it contradicts to spec because in this case
>>>> > the value of 'significand' must be 1.0:
>>>> > 2.0 = 1.0 * 2 ^ 1
>>>> >
>>>> > GLSL spec says (about 'frexp'):
>>>> >"Splits x into a floating-point significand in the range
>>>> > [0.5, 1.0) and an integral exponent of two, such that:
>>>> >
>>>> >x = significand * 2 ^ exponent
>>>> >
>>>> > The significand is returned by the function and the
>>>> > exponent is returned in the parameter exp. For a
>>>> > floating-point value of zero, the significant and exponent
>>>> > are both zero. For a floating-point value that is an
>>>> > infinity or is not a number, the results are undefined.
>>>>
>>>> You're absolutely right. It seems like radeonsi is currently passing
>>>> this incorrectly, because a bunch of other things surrounding frexp are
>>>> broken.
>>>>
>>>> The test change is correct.
>>>>
>>>> Reviewed-by: Nicolai Hähnle 
>>>>
>>>> >
>>>> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108537
>>>> > Signed-off-by: Andrii Simiklit 
>>>> > ---
>>>> >   .../fs-frexp-dvec4-only-exponent.shader_test| 13
>>>> -
>>>> >   1 file changed, 12 insertions(+), 1 deletion(-)
>>>> >
>>>> > diff --git
>>>> a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
>>>> b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
>>>> > index d7dc64032..c4a7555ff 100644
>>>> > ---
>>>> a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
>>>> > +++
>>>> b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
>>>> > @@ -31,7 +31,18 @@ clear color 0 0 0 1
>>>> >   clear
>>>> >
>>>> >   uniform dvec4 u_in 2 3 4 9
>>>> > -uniform ivec4 u_exponent 1 1 2 3
>>>> > +
>>>> > +# The function frexp() splits each single-precision floating-point
>>>> number in
>>>> > +#  into a binary significand, a floating-point number in the
>>>> range [0.5,
>>>> > +# 1.0), and an integral exponent of two, such that:
>>>> > +#
>>>> > +#x = significand * 2 ^ exponent
>>>> > +#
>>>> > +# 2 = 0.5 * 2^2
>>>> > +# 3 = 0.75 * 2^2
>>>> > +# 4 = 0.5 * 2^3
>>>> > +# 9 = 0.5625 * 2^4
>>>> > +uniform ivec4 u_exponent 2 2 3 4
>>>> >
>>>> >   draw rect -1 -1 2 2
>>>> >   probe all rgba 0 1 0 1
>>>> >
>>>>
>>>> ___
>> 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] glsl/frexp: fix the incorrect expected values

2018-10-31 Thread andrey simiklit
Hello,

Could you please help me with a push.

Thanks,
Andrii.

On Fri, Oct 26, 2018 at 5:50 PM andrey simiklit 
wrote:

> Hello,
>
> Thanks a lot for reviewing.
>
> Regards,
> Andrii.
>
> On Fri, Oct 26, 2018 at 3:23 PM Haehnle, Nicolai 
> wrote:
>
>> On 24.10.18 14:52, asimiklit.w...@gmail.com wrote:
>> > From: Andrii Simiklit 
>> >
>> > I guess that this test has the incorrect expected values.
>> > For instance the test expects that exponent for a value 2 will be 1
>> > But it contradicts to spec because in this case
>> > the value of 'significand' must be 1.0:
>> > 2.0 = 1.0 * 2 ^ 1
>> >
>> > GLSL spec says (about 'frexp'):
>> >"Splits x into a floating-point significand in the range
>> > [0.5, 1.0) and an integral exponent of two, such that:
>> >
>> >x = significand * 2 ^ exponent
>> >
>> > The significand is returned by the function and the
>> > exponent is returned in the parameter exp. For a
>> > floating-point value of zero, the significant and exponent
>> > are both zero. For a floating-point value that is an
>> > infinity or is not a number, the results are undefined.
>>
>> You're absolutely right. It seems like radeonsi is currently passing
>> this incorrectly, because a bunch of other things surrounding frexp are
>> broken.
>>
>> The test change is correct.
>>
>> Reviewed-by: Nicolai Hähnle 
>>
>> >
>> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108537
>> > Signed-off-by: Andrii Simiklit 
>> > ---
>> >   .../fs-frexp-dvec4-only-exponent.shader_test| 13 -
>> >   1 file changed, 12 insertions(+), 1 deletion(-)
>> >
>> > diff --git
>> a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
>> b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
>> > index d7dc64032..c4a7555ff 100644
>> > ---
>> a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
>> > +++
>> b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
>> > @@ -31,7 +31,18 @@ clear color 0 0 0 1
>> >   clear
>> >
>> >   uniform dvec4 u_in 2 3 4 9
>> > -uniform ivec4 u_exponent 1 1 2 3
>> > +
>> > +# The function frexp() splits each single-precision floating-point
>> number in
>> > +#  into a binary significand, a floating-point number in the range
>> [0.5,
>> > +# 1.0), and an integral exponent of two, such that:
>> > +#
>> > +#x = significand * 2 ^ exponent
>> > +#
>> > +# 2 = 0.5 * 2^2
>> > +# 3 = 0.75 * 2^2
>> > +# 4 = 0.5 * 2^3
>> > +# 9 = 0.5625 * 2^4
>> > +uniform ivec4 u_exponent 2 2 3 4
>> >
>> >   draw rect -1 -1 2 2
>> >   probe all rgba 0 1 0 1
>> >
>>
>>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] glsl/frexp: fix the incorrect expected values

2018-10-26 Thread andrey simiklit
Hello,

Thanks a lot for reviewing.

Regards,
Andrii.

On Fri, Oct 26, 2018 at 3:23 PM Haehnle, Nicolai 
wrote:

> On 24.10.18 14:52, asimiklit.w...@gmail.com wrote:
> > From: Andrii Simiklit 
> >
> > I guess that this test has the incorrect expected values.
> > For instance the test expects that exponent for a value 2 will be 1
> > But it contradicts to spec because in this case
> > the value of 'significand' must be 1.0:
> > 2.0 = 1.0 * 2 ^ 1
> >
> > GLSL spec says (about 'frexp'):
> >"Splits x into a floating-point significand in the range
> > [0.5, 1.0) and an integral exponent of two, such that:
> >
> >x = significand * 2 ^ exponent
> >
> > The significand is returned by the function and the
> > exponent is returned in the parameter exp. For a
> > floating-point value of zero, the significant and exponent
> > are both zero. For a floating-point value that is an
> > infinity or is not a number, the results are undefined.
>
> You're absolutely right. It seems like radeonsi is currently passing
> this incorrectly, because a bunch of other things surrounding frexp are
> broken.
>
> The test change is correct.
>
> Reviewed-by: Nicolai Hähnle 
>
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108537
> > Signed-off-by: Andrii Simiklit 
> > ---
> >   .../fs-frexp-dvec4-only-exponent.shader_test| 13 -
> >   1 file changed, 12 insertions(+), 1 deletion(-)
> >
> > diff --git
> a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
> b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
> > index d7dc64032..c4a7555ff 100644
> > ---
> a/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
> > +++
> b/tests/spec/arb_gpu_shader_fp64/execution/built-in-functions/fs-frexp-dvec4-only-exponent.shader_test
> > @@ -31,7 +31,18 @@ clear color 0 0 0 1
> >   clear
> >
> >   uniform dvec4 u_in 2 3 4 9
> > -uniform ivec4 u_exponent 1 1 2 3
> > +
> > +# The function frexp() splits each single-precision floating-point
> number in
> > +#  into a binary significand, a floating-point number in the range
> [0.5,
> > +# 1.0), and an integral exponent of two, such that:
> > +#
> > +#x = significand * 2 ^ exponent
> > +#
> > +# 2 = 0.5 * 2^2
> > +# 3 = 0.75 * 2^2
> > +# 4 = 0.5 * 2^3
> > +# 9 = 0.5625 * 2^4
> > +uniform ivec4 u_exponent 2 2 3 4
> >
> >   draw rect -1 -1 2 2
> >   probe all rgba 0 1 0 1
> >
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] egl: doesn't allow egl to create a forward-compatible context with req ver < 3

2018-10-12 Thread andrey simiklit
Hello,

Thanks for reviewing.
Please find my comments below:

(I will be on vacation from 13.10.2018 till 20.10.2018.
I can't say for sure that I will have a time to finish it today :-) )

On Thu, Oct 11, 2018 at 7:55 PM Matt Turner  wrote:

> Hello,
>
> Thanks for the patch.
>
> I notice that there are a lot of whitespace errors in this patch. I
> would fix them myself when I commit, but I have some questions that
> might require other changes. They should be pretty apparent.
>

Yes you are right the other changes are required so I will fix whitespace
errors too.


>
> On Thu, Oct 11, 2018 at 4:35 AM  wrote:
> >
> > From: Andrii Simiklit 
> >
> > EGL_KHR_create_context spec says:
> >"The default values for EGL_CONTEXT_MAJOR_VERSION_KHR and
> > EGL_CONTEXT_MINOR_VERSION_KHR are 1 and 0 respectively."
> >
> > requesting a forward-compatible context for OpenGL
> > versions less than 3.0 will generate an error.
> >
> >  "* If an OpenGL context is requested and the values for
> attributes
> > EGL_CONTEXT_MAJOR_VERSION_KHR and EGL_CONTEXT_MINOR_VERSION_KHR,
> > when considered together with the value for attribute
> > EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR, specify an OpenGL
> > version and feature set that are not defined, than an
> > EGL_BAD_MATCH error is generated.
> >
> > The defined versions of OpenGL at the time of writing are OpenGL
> > 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 2.0, 2.1, 3.0, 3.1, 3.2, 4.0, 4.1,
> > 4.2, and 4.3. Feature deprecation was introduced with OpenGL
> > 3.0, so forward-compatible contexts may only be requested for
> > OpenGL 3.0 and above. Thus, examples of invalid combinations of
> > attributes include:
> >
> >   - Major version < 1 or > 4
> >   - Major version == 1 and minor version < 0 or > 5
> >   - Major version == 2 and minor version < 0 or > 1
> >   - Major version == 3 and minor version < 0 or > 2
> >   - Major version == 4 and minor version < 0 or > 3
> >   - Forward-compatible flag set and major version < 3
> >
> > Because the purpose of forward-compatible contexts is to allow
> > application development on a specific OpenGL version with the
> > knowledge that the app will run on a future version, context
> > creation will fail if
> > EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR is set and the
> > context version returned cannot implement exactly the requested
> > version."
> >
> > Additionally this patch checks and an independence of the attributes
> order in list.
> >
> > Signed-off-by: Andrii Simiklit 
> > ---
> >  .../valid-flag-forward-compatible-gl.c| 70 +++
> >  1 file changed, 57 insertions(+), 13 deletions(-)
> >
> > diff --git
> a/tests/egl/spec/egl_khr_create_context/valid-flag-forward-compatible-gl.c
> b/tests/egl/spec/egl_khr_create_context/valid-flag-forward-compatible-gl.c
> > index 42feb54d6..ea00ef595 100644
> > ---
> a/tests/egl/spec/egl_khr_create_context/valid-flag-forward-compatible-gl.c
> > +++
> b/tests/egl/spec/egl_khr_create_context/valid-flag-forward-compatible-gl.c
> > @@ -23,16 +23,30 @@
> >  #include "piglit-util-egl.h"
> >  #include "common.h"
> >
> > -int gl_version;
> > +int gl_version = 0;
> >
> > -static bool try_flag(int flag)
> > +static bool try_flag(int req_version, int flag)
>
> This function has become strange, both returning a bool and also
> calling piglit_report_result(PIGLIT_FAIL).
>

Yes you are right.
The 'piglit_report_result' rather should be
called in 'main' based on 'piglit_report_result' call result.
I will fix it.


> >  {
> > -   const EGLint attribs[] = {
> > -   EGL_CONTEXT_FLAGS_KHR, flag,
> > -   EGL_NONE
> > -   };
> > +   bool oresult = true;
>
> What does the 'o' mean here? Why not just call it result?
>

Yes this just reduction of 'output result' : -)  I will rename it to
'result'


>
> > +   const unsigned vidx = req_version < 0 ? 0 : (req_version == 0) ?
> 1 : 2;
> > +   const bool is_forward_compatible =
> > +   (0 != (flag &
> EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR));
> >
> > -   ctx = eglCreateContext(egl_dpy, cfg, EGL_NO_CONTEXT, attribs);
> > +   const EGLint attribs[][5] = {
> > +   /*req_version-before-case*/
> > +   { EGL_CONTEXT_MAJOR_VERSION_KHR, abs(req_version),
> > + EGL_CONTEXT_FLAGS_KHR, flag,
> > + EGL_NONE },
> > +   /*no-req_version-case*/
> > +   { EGL_CONTEXT_FLAGS_KHR, flag,
> > + EGL_NONE },
> > +   /*req_version-after-case-*/
> > +   { EGL_CONTEXT_FLAGS_KHR, flag,
> > + EGL_CONTEXT_MAJOR_VERSION_KHR, abs(req_version),
> > +   

Re: [Piglit] [PATCH] i965/glsl: don't add unused aoa elements to the program resource list

2018-08-31 Thread andrey simiklit
Hi all,

Sorry wrong mailing list.
Just ignore this message.

Regards,
Andrii.
On Fri, Aug 31, 2018 at 5:08 PM  wrote:

> From: Andrii Simiklit 
>
> It fixes a bit incorrectly implemented ARB_program_interface_query.
> If input aoa element is unused in shader program
> the 'glGetProgramResourceIndex' function shouldn't
> return a valid resource index for it according to:
> ARB_program_interface_query spec:
> " For an active variable declared as an array of an aggregate data type
> (structures or arrays), a separate entry will be generated for each
> active array element"
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92822
> Signed-off-by: Andrii Simiklit 
> ---
>  src/compiler/Makefile.sources  |   4 +-
>  .../glsl/ir_collect_active_aoa_elements.cpp| 148
> +
>  src/compiler/glsl/ir_collect_active_aoa_elements.h |  49 +++
>  src/compiler/glsl/linker.cpp   |  75 +--
>  src/compiler/glsl/meson.build  |   2 +
>  5 files changed, 265 insertions(+), 13 deletions(-)
>  create mode 100644 src/compiler/glsl/ir_collect_active_aoa_elements.cpp
>  create mode 100644 src/compiler/glsl/ir_collect_active_aoa_elements.h
>
> diff --git a/src/compiler/Makefile.sources b/src/compiler/Makefile.sources
> index d3b0656..a2ba3e3 100644
> --- a/src/compiler/Makefile.sources
> +++ b/src/compiler/Makefile.sources
> @@ -154,7 +154,9 @@ LIBGLSL_FILES = \
> glsl/serialize.cpp \
> glsl/serialize.h \
> glsl/string_to_uint_map.cpp \
> -   glsl/string_to_uint_map.h
> +   glsl/string_to_uint_map.h \
> +   glsl/ir_collect_active_aoa_elements.cpp \
> +   glsl/ir_collect_active_aoa_elements.h
>
>  LIBGLSL_SHADER_CACHE_FILES = \
> glsl/shader_cache.cpp \
> diff --git a/src/compiler/glsl/ir_collect_active_aoa_elements.cpp
> b/src/compiler/glsl/ir_collect_active_aoa_elements.cpp
> new file mode 100644
> index 000..50042c7
> --- /dev/null
> +++ b/src/compiler/glsl/ir_collect_active_aoa_elements.cpp
> @@ -0,0 +1,148 @@
> +/*
> + * Copyright © 2018 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the
> "Software"),
> + * to deal in the Software without restriction, including without
> limitation
> + * the rights to use, copy, modify, merge, publish, distribute,
> sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the
> next
> + * paragraph) shall be included in all copies or substantial portions of
> the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
> SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
> OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + */
> +
> +#include "ir_collect_active_aoa_elements.h"
> +#include "program.h"
> +#include "linker_util.h"
> +#include "util/set.h"
> +#include "util/u_dynarray.h"
> +
> +namespace
> +{
> +/***
> + * Helps to collect the names of used aoa elements
> + * to the accessed_elements set
> + ***/
> +struct elem_inserter
> +{
> +elem_inserter(struct set *accessed_elements_)
> +: accessed_elements(accessed_elements_)
> +{}
> +void operator ()(const char *name)
> +{
> +if (NULL == _mesa_set_search(accessed_elements, name)) {
> +_mesa_set_add(accessed_elements, name);
> +}
> +}
> +struct set *accessed_elements;
> +};
> +
> +bool
> +ir_is_array_deref(ir_rvalue *const ir)
> +{
> +return (ir_type_dereference_array == ir->ir_type);
> +}
> +
> +ir_variable *
> +base_ir_dereference_var(ir_dereference_array *const ir)
> +{
> +ir_dereference_array const *base_ir = ir;
> +while (ir_type_dereference_array == base_ir->array->ir_type) {
> +base_ir = base_ir->array->as_dereference_array();
> +assert(NULL != base_ir);
> +}
> +
> +ir_dereference_variable *const d =
> +base_ir->array->as_dereference_variable();
> +return (NULL == d) ? NULL : d->var;
> +}
> +}
> +/**
> + * Helps to produce all combinations of used aoa elements
> + * for cases with constant and variable index.
> + **/
> +template 
> +inline void enumiramte_active_elements(void *memctx,
> +ir_dereference_array **first,
> + 

Re: [Piglit] [PATCH] arb_program_interface_query: fix array of arrays case

2018-08-21 Thread andrey simiklit
Hi,

> On 21/08/18 21:38, asimiklit.w...@gmail.com wrote:
>
> From: Andrii Simiklit  
> 
>
> According to spec:
>"For an active variable declared as an array of an aggregate data type
> (structures or arrays), a separate entry will be generated for each
> active array element, unless noted immediately below ..."
> Mesa should return valid index for 'vs_input2[1][0]' cases.
>
> I believe the key word above is "active" yes they are separate but if I'm
> remembering this problem correctly they are not all active.
>
> I believe this is a Mesa bug not a piglit bug, it was just tricky to fix and 
> always a low priority.
>
> See: https://bugs.freedesktop.org/show_bug.cgi?id=92822#c7
>
> Thanks for your fast reply.
Yes you are right I missed it in my investigation.

Regards,
Andrii.

On Tue, Aug 21, 2018 at 3:46 PM, Timothy Arceri 
wrote:

> On 21/08/18 21:38, asimiklit.w...@gmail.com wrote:
>
> From: Andrii Simiklit  
> 
>
> According to spec:
>"For an active variable declared as an array of an aggregate data type
> (structures or arrays), a separate entry will be generated for each
> active array element, unless noted immediately below ..."
> Mesa should return valid index for 'vs_input2[1][0]' cases.
>
> I believe the key word above is "active" yes they are separate but if I'm
> remembering this problem correctly they are not all active.
>
> I believe this is a Mesa bug not a piglit bug, it was just tricky to fix and 
> always a low priority.
>
> See: https://bugs.freedesktop.org/show_bug.cgi?id=92822#c7
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107639
> Signed-off-by: Andrii Simiklit  
> 
> ---
>  tests/spec/arb_program_interface_query/getprogramresourceindex.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/spec/arb_program_interface_query/getprogramresourceindex.c 
> b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
> index 16b38e2..92d9a90 100755
> --- a/tests/spec/arb_program_interface_query/getprogramresourceindex.c
> +++ b/tests/spec/arb_program_interface_query/getprogramresourceindex.c
> @@ -167,8 +167,9 @@ static const struct subtest_index_t index_subtests[] = {
>   {   vs_aofa,  GL_PROGRAM_INPUT,  "vs_input2", 
> false, -1, GL_NO_ERROR },
>   {   vs_aofa,  GL_PROGRAM_INPUT,   "vs_input2[0]",  
> true, -1, GL_NO_ERROR },
>   {   vs_aofa,  GL_PROGRAM_INPUT,"vs_input2[0][0]",  
> true, -1, GL_NO_ERROR },
> - {   vs_aofa,  GL_PROGRAM_INPUT,"vs_input2[1][0]", 
> false, -1, GL_NO_ERROR },
> + {   vs_aofa,  GL_PROGRAM_INPUT,"vs_input2[1][0]",  
> true, -1, GL_NO_ERROR },
>   {   vs_aofa,  GL_PROGRAM_INPUT,"vs_input2[0][1]", 
> false, -1, GL_NO_ERROR },
> + {   vs_aofa,  GL_PROGRAM_INPUT,"vs_input2[1][1]", 
> false, -1, GL_NO_ERROR },
>   {vs_sub,  GL_VERTEX_SUBROUTINE,"vss",  
> true, -1, GL_NO_ERROR },
>   {vs_sub,  GL_VERTEX_SUBROUTINE,   "vss2",  
> true, -1, GL_NO_ERROR },
>   { vs_subidx,  GL_VERTEX_SUBROUTINE,"vss_idx",  
> true,  5, GL_NO_ERROR },
>
>
>
___
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-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