Re: [Piglit] [PATCH] arb_transform_feedback_overflow_query: skip QBO subtests if unsupported

2017-02-21 Thread Ilia Mirkin
On Tue, Feb 21, 2017 at 7:56 PM, Kenneth Graunke  wrote:
> We need GL_ARB_query_buffer_object to run the GL_QUERY_BUFFER subtests.
>
> Signed-off-by: Kenneth Graunke 
> Cc: Rafael Antognolli 
> ---
>  tests/spec/arb_transform_feedback_overflow_query/basic.c | 6 ++
>  1 file changed, 6 insertions(+)
>
> diff --git a/tests/spec/arb_transform_feedback_overflow_query/basic.c 
> b/tests/spec/arb_transform_feedback_overflow_query/basic.c
> index 25c335578..0ca0afe6a 100644
> --- a/tests/spec/arb_transform_feedback_overflow_query/basic.c
> +++ b/tests/spec/arb_transform_feedback_overflow_query/basic.c
> @@ -244,6 +244,12 @@ run_subtest(int n_streams, int array_sizes[], int 
> stream, GLuint query_type,
> const char *gs_text;
> const char **gs_varyings;
>
> +   if (!strcmp(test_type, "buffer_object") &&
> +   !piglit_is_extension_supported("GL_ARB_query_buffer_object")) {
> +   piglit_loge("context does not support "
> +   "GL_ARB_query_buffer_object; skipping test");
> +   return PIGLIT_SKIP;

indent.

Reviewed-by: Ilia Mirkin 

> +   }
>
> if (n_streams > 1) {
> if (!check_multistream_extensions())
> --
> 2.11.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


[Piglit] [PATCH] primitive-restart: Delete more glDrawArrays tests.

2017-02-21 Thread Kenneth Graunke
This interprets the new GL 4.5 rules (don't do primitive restart for
non-indexed-draws) as a clarification, even for the old NV tests.

Mesa dropped support for this in commit 96cbc1ca29e0b1f4f4d6c868b844,
causing test regressions here.  Piglit dropped a bunch of related tests
in commit 85360e3564a12a367e115f167aec7284d69047b6, but left some.
I don't think anybody actually wants this behavior, so let's just drop
the remaining tests.

Cc: Marek Olšák 
---
 tests/general/primitive-restart.c | 120 --
 1 file changed, 120 deletions(-)

diff --git a/tests/general/primitive-restart.c 
b/tests/general/primitive-restart.c
index 83f494dd1..dfa180420 100644
--- a/tests/general/primitive-restart.c
+++ b/tests/general/primitive-restart.c
@@ -502,125 +502,6 @@ test_array_element(VBO_CFG vbo_cfg, GLenum primMode, 
GLenum indexType)
 }
 
 
-/**
- * Test glDrawArrayss() with glPrimitiveRestartIndexNV().
- * We only test a line strip.
- */
-static bool
-test_draw_arrays(VBO_CFG vbo_cfg)
-{
-#define NUM_VERTS 12
-   GLfloat verts[NUM_VERTS+2][2];
-   const GLfloat dx = 20.0;
-   GLfloat x;
-   GLuint restart_index;
-   bool pass = true;
-   const char *primStr = "GL_LINE_STRIP";
-   GLuint test;
-   const GLenum primMode = GL_LINE_STRIP;
-   GLuint vbo = 0;
-
-   x = 0.0;
-
-   /* setup vertices */
-   {
-  GLuint i;
-  const GLfloat y = 0.5 * piglit_height;
-
-  glLineWidth(5.0);
-
-  for (i = 0; i < NUM_VERTS; i++) {
- verts[i][0] = x;
- verts[i][1] = y;
- x += dx;
-  }
-   }
-
-   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
-
-   glColor4fv(green);
-
-   if ((vbo_cfg != DISABLE_VBO) && (vbo_cfg != VBO_INDEX_ONLY)) {
-  glGenBuffers(1, );
-  glBindBuffer(GL_ARRAY_BUFFER, vbo);
-  glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_STATIC_DRAW);
-  glVertexPointer(2, GL_FLOAT, 0, (void *)0);
-   } else {
-  glVertexPointer(2, GL_FLOAT, 2*sizeof(GLfloat), verts);
-   }
-
-   glEnableClientState(GL_VERTEX_ARRAY);
-   if (!piglit_check_gl_error(GL_NO_ERROR))
-  return false;
-
-   /*
-* Render and do checks.
-* Try three different restart indexes at start, end, middle.
-*/
-   for (test = 0; test < 3 && pass; test++) {
-  /* choose the restart index */
-  if (test == 0)
- restart_index = 0;
-  else if (test == 1)
- restart_index = NUM_VERTS - 1;
-  else
- restart_index = NUM_VERTS / 2;
-
-  /* draw */
-  glClear(GL_COLOR_BUFFER_BIT);
-  enable_restart(restart_index);
-  glDrawArrays(primMode, 0, NUM_VERTS);
-  disable_restart();
-
-  /* check */
-  {
- const GLfloat x0 = 0.0;
- const GLint iy = piglit_height / 2;
- GLint i;
-
- /* probe at midpoint of each line segment */
- for (i = 0; i < NUM_VERTS - 1 && pass; i++) {
-/* test midpoint of line to see if it was drawn */
-const float fx = x0 + 0.5 * dx + i * dx;
-const int ix = (int) fx;
-
-/* read pixel */
-if (restart_index == i || restart_index == i + 1) {
-   /* pixel should NOT be drawn here */
-   if (!piglit_probe_pixel_rgb(ix, iy, black)) {
-  if (0)
- fprintf(stderr, "bad pixel drawn\n");
-  pass = false;
-   }
-}
-else {
-   /* pixel should be drawn here */
-   if (!piglit_probe_pixel_rgb(ix, iy, green)) {
-  if (0)
- fprintf(stderr, "bad pixel drawn\n");
-  pass = false;
-   }
-}
- }
-  }
-   }
-
-   piglit_present_results();
-
-   if (vbo != 0) {
-  glBindBuffer(GL_ARRAY_BUFFER, 0);
-   }
-
-   if (!pass) {
-  fprintf(stderr, "%s: failure drawing with glDrawArrays(%s), "
-  "restart index = %u\n",
-  TestName, primStr, restart_index);
-   }
-
-   return pass;
-}
-
-
 bool
 primitive_restart_test(VBO_CFG vbo_cfg)
 {
@@ -642,7 +523,6 @@ primitive_restart_test(VBO_CFG vbo_cfg)
   pass = pass && test_array_element(vbo_cfg, GL_LINE_STRIP, 
GL_UNSIGNED_BYTE);
   pass = pass && test_array_element(vbo_cfg, GL_LINE_STRIP, 
GL_UNSIGNED_SHORT);
   pass = pass && test_array_element(vbo_cfg, GL_LINE_STRIP, 
GL_UNSIGNED_INT);
-  pass = pass && test_draw_arrays(vbo_cfg);
}
 
if (Have_31) {
-- 
2.11.1

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


[Piglit] [PATCH] arb_transform_feedback_overflow_query: skip QBO subtests if unsupported

2017-02-21 Thread Kenneth Graunke
We need GL_ARB_query_buffer_object to run the GL_QUERY_BUFFER subtests.

Signed-off-by: Kenneth Graunke 
Cc: Rafael Antognolli 
---
 tests/spec/arb_transform_feedback_overflow_query/basic.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/tests/spec/arb_transform_feedback_overflow_query/basic.c 
b/tests/spec/arb_transform_feedback_overflow_query/basic.c
index 25c335578..0ca0afe6a 100644
--- a/tests/spec/arb_transform_feedback_overflow_query/basic.c
+++ b/tests/spec/arb_transform_feedback_overflow_query/basic.c
@@ -244,6 +244,12 @@ run_subtest(int n_streams, int array_sizes[], int stream, 
GLuint query_type,
const char *gs_text;
const char **gs_varyings;
 
+   if (!strcmp(test_type, "buffer_object") &&
+   !piglit_is_extension_supported("GL_ARB_query_buffer_object")) {
+   piglit_loge("context does not support "
+   "GL_ARB_query_buffer_object; skipping test");
+   return PIGLIT_SKIP;
+   }
 
if (n_streams > 1) {
if (!check_multistream_extensions())
-- 
2.11.1

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