Re: [Piglit] [PATCH v4] tests: add nvidia conservative rasterization tests

2018-05-11 Thread Rhys Perry
Both approaches look like they would be more robust that the current one.

I think I'll create a new version of the patch using the first one.

On Fri, May 11, 2018 at 4:06 AM, Brian Paul  wrote:
> Reviewed-by: Brian Paul 
>
> Though, I can't help but think that we could do something better for the
> drawing test.
>
> My first approach would be to draw a triangle with conservative
> rasterization on then off and compare how many pixels are written.  The
> conservative rasterization should generate more fragments than the normal
> rasterization.  And the difference should, I think, be proportional to the
> perimeter of the triangle.  As long as there's no vertical/horizontal edges
> exactly on pixel bounds.
>
> Another approach would be to draw two adjacent gray triangles with blend-add
> mode and check that pixels along the shared edge are white (hit twice).
>
> What do you think?
>
> -Brian
>
>
>
> On 05/09/2018 02:05 PM, Rhys Perry wrote:
>>
>> Ping I guess?
>>
>> On Fri, Mar 30, 2018 at 10:56 PM, Rhys Perry 
>> wrote:
>>>
>>> Adds tests for GL_NV_conservative_raster,
>>> GL_NV_conservative_raster_dilate
>>> and GL_NV_conservative_raster_pre_snap_triangles.
>>>
>>> Changes in v2:
>>> - cleanup the tests
>>> - fix some test failures
>>> - remove the gles version of the dilation test as the extension is not
>>>exposed in gl.xml
>>> Changes in v3:
>>> - fix accidently luck-based pre-snap-triangles test
>>> Changes in v4:
>>> - apply formatting changes
>>> - elaborate on various comments describing the test source code files
>>>
>>> Signed-off-by: Rhys Perry 
>>> ---
>>> I am new to this project and don't have commit access.
>>>
>>>   tests/all.py   |  20 ++
>>>   tests/spec/CMakeLists.txt  |   3 +
>>>   .../spec/nv_conservative_raster/CMakeLists.gl.txt  |  13 +
>>>   .../nv_conservative_raster/CMakeLists.gles2.txt|   3 +
>>>   tests/spec/nv_conservative_raster/CMakeLists.txt   |   1 +
>>>   tests/spec/nv_conservative_raster/attrib.c | 107 +++
>>>   tests/spec/nv_conservative_raster/dlist.c  | 110 +++
>>>   tests/spec/nv_conservative_raster/draw.c   | 338
>>> +
>>>   .../CMakeLists.gl.txt  |  11 +
>>>   .../nv_conservative_raster_dilate/CMakeLists.txt   |   1 +
>>>   tests/spec/nv_conservative_raster_dilate/draw.c| 151 +
>>>   .../CMakeLists.gl.txt  |  11 +
>>>   .../CMakeLists.gles2.txt   |   3 +
>>>   .../CMakeLists.txt |   1 +
>>>   .../draw.c | 148 +
>>>   15 files changed, 921 insertions(+)
>>>   create mode 100644 tests/spec/nv_conservative_raster/CMakeLists.gl.txt
>>>   create mode 100644
>>> tests/spec/nv_conservative_raster/CMakeLists.gles2.txt
>>>   create mode 100644 tests/spec/nv_conservative_raster/CMakeLists.txt
>>>   create mode 100644 tests/spec/nv_conservative_raster/attrib.c
>>>   create mode 100644 tests/spec/nv_conservative_raster/dlist.c
>>>   create mode 100644 tests/spec/nv_conservative_raster/draw.c
>>>   create mode 100644
>>> tests/spec/nv_conservative_raster_dilate/CMakeLists.gl.txt
>>>   create mode 100644
>>> tests/spec/nv_conservative_raster_dilate/CMakeLists.txt
>>>   create mode 100644 tests/spec/nv_conservative_raster_dilate/draw.c
>>>   create mode 100644
>>> tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.gl.txt
>>>   create mode 100644
>>> tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.gles2.txt
>>>   create mode 100644
>>> tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.txt
>>>   create mode 100644
>>> tests/spec/nv_conservative_raster_pre_snap_triangles/draw.c
>>>
>>> diff --git a/tests/all.py b/tests/all.py
>>> index 7c8580ef0..5fa219ca0 100644
>>> --- a/tests/all.py
>>> +++ b/tests/all.py
>>> @@ -4995,5 +4995,25 @@ with profile.test_list.group_manager(
>>>   g(['arb_bindless_texture-uint64_attribs'], 'uint64_attribs')
>>>   g(['arb_bindless_texture-uniform'], 'uniform')
>>>
>>> +# Group NV_conservative_raster
>>> +with profile.test_list.group_manager(
>>> +   PiglitGLTest,
>>> +   grouptools.join('spec', 'NV_conservative_raster')) as g:
>>> +g(['nv_conservative_raster-draw'], 'draw')
>>> +g(['nv_conservative_raster-dlist'], 'dlist')
>>> +g(['nv_conservative_raster-attrib'], 'attrib')
>>> +
>>> +# Group NV_conservative_raster_dilate
>>> +with profile.test_list.group_manager(
>>> +   PiglitGLTest,
>>> +   grouptools.join('spec', 'NV_conservative_raster_dilate')) as g:
>>> +g(['nv_conservative_raster_dilate-draw'], 'draw')
>>> +
>>> +# Group NV_conservative_raster_pre_snap_triangles
>>> +with profile.test_list.group_manager(
>>> +   PiglitGLTest,
>>> +   grouptools.join('spec',
>>> 

Re: [Piglit] [PATCH v4] tests: add nvidia conservative rasterization tests

2018-05-10 Thread Brian Paul

Reviewed-by: Brian Paul 

Though, I can't help but think that we could do something better for the 
drawing test.


My first approach would be to draw a triangle with conservative 
rasterization on then off and compare how many pixels are written.  The 
conservative rasterization should generate more fragments than the 
normal rasterization.  And the difference should, I think, be 
proportional to the perimeter of the triangle.  As long as there's no 
vertical/horizontal edges exactly on pixel bounds.


Another approach would be to draw two adjacent gray triangles with 
blend-add mode and check that pixels along the shared edge are white 
(hit twice).


What do you think?

-Brian


On 05/09/2018 02:05 PM, Rhys Perry wrote:

Ping I guess?

On Fri, Mar 30, 2018 at 10:56 PM, Rhys Perry  wrote:

Adds tests for GL_NV_conservative_raster, GL_NV_conservative_raster_dilate
and GL_NV_conservative_raster_pre_snap_triangles.

Changes in v2:
- cleanup the tests
- fix some test failures
- remove the gles version of the dilation test as the extension is not
   exposed in gl.xml
Changes in v3:
- fix accidently luck-based pre-snap-triangles test
Changes in v4:
- apply formatting changes
- elaborate on various comments describing the test source code files

Signed-off-by: Rhys Perry 
---
I am new to this project and don't have commit access.

  tests/all.py   |  20 ++
  tests/spec/CMakeLists.txt  |   3 +
  .../spec/nv_conservative_raster/CMakeLists.gl.txt  |  13 +
  .../nv_conservative_raster/CMakeLists.gles2.txt|   3 +
  tests/spec/nv_conservative_raster/CMakeLists.txt   |   1 +
  tests/spec/nv_conservative_raster/attrib.c | 107 +++
  tests/spec/nv_conservative_raster/dlist.c  | 110 +++
  tests/spec/nv_conservative_raster/draw.c   | 338 +
  .../CMakeLists.gl.txt  |  11 +
  .../nv_conservative_raster_dilate/CMakeLists.txt   |   1 +
  tests/spec/nv_conservative_raster_dilate/draw.c| 151 +
  .../CMakeLists.gl.txt  |  11 +
  .../CMakeLists.gles2.txt   |   3 +
  .../CMakeLists.txt |   1 +
  .../draw.c | 148 +
  15 files changed, 921 insertions(+)
  create mode 100644 tests/spec/nv_conservative_raster/CMakeLists.gl.txt
  create mode 100644 tests/spec/nv_conservative_raster/CMakeLists.gles2.txt
  create mode 100644 tests/spec/nv_conservative_raster/CMakeLists.txt
  create mode 100644 tests/spec/nv_conservative_raster/attrib.c
  create mode 100644 tests/spec/nv_conservative_raster/dlist.c
  create mode 100644 tests/spec/nv_conservative_raster/draw.c
  create mode 100644 tests/spec/nv_conservative_raster_dilate/CMakeLists.gl.txt
  create mode 100644 tests/spec/nv_conservative_raster_dilate/CMakeLists.txt
  create mode 100644 tests/spec/nv_conservative_raster_dilate/draw.c
  create mode 100644 
tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.gl.txt
  create mode 100644 
tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.gles2.txt
  create mode 100644 
tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.txt
  create mode 100644 tests/spec/nv_conservative_raster_pre_snap_triangles/draw.c

diff --git a/tests/all.py b/tests/all.py
index 7c8580ef0..5fa219ca0 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4995,5 +4995,25 @@ with profile.test_list.group_manager(
  g(['arb_bindless_texture-uint64_attribs'], 'uint64_attribs')
  g(['arb_bindless_texture-uniform'], 'uniform')

+# Group NV_conservative_raster
+with profile.test_list.group_manager(
+   PiglitGLTest,
+   grouptools.join('spec', 'NV_conservative_raster')) as g:
+g(['nv_conservative_raster-draw'], 'draw')
+g(['nv_conservative_raster-dlist'], 'dlist')
+g(['nv_conservative_raster-attrib'], 'attrib')
+
+# Group NV_conservative_raster_dilate
+with profile.test_list.group_manager(
+   PiglitGLTest,
+   grouptools.join('spec', 'NV_conservative_raster_dilate')) as g:
+g(['nv_conservative_raster_dilate-draw'], 'draw')
+
+# Group NV_conservative_raster_pre_snap_triangles
+with profile.test_list.group_manager(
+   PiglitGLTest,
+   grouptools.join('spec', 'NV_conservative_raster_pre_snap_triangles')) 
as g:
+g(['nv_conservative_raster_pre_snap_triangles-draw'], 'draw')
+
  if platform.system() is 'Windows':
  profile.filters.append(lambda p, _: not p.startswith('glx'))
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index dc14beb4e..a0bc845c5 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -101,6 +101,9 @@ add_subdirectory (ext_texture_swizzle)
  add_subdirectory (ext_timer_query)
  add_subdirectory (ext_transform_feedback)
  add_subdirectory (nv_conditional_render)
+add_subdirectory 

Re: [Piglit] [PATCH v4] tests: add nvidia conservative rasterization tests

2018-05-09 Thread Rhys Perry
Ping I guess?

On Fri, Mar 30, 2018 at 10:56 PM, Rhys Perry  wrote:
> Adds tests for GL_NV_conservative_raster, GL_NV_conservative_raster_dilate
> and GL_NV_conservative_raster_pre_snap_triangles.
>
> Changes in v2:
> - cleanup the tests
> - fix some test failures
> - remove the gles version of the dilation test as the extension is not
>   exposed in gl.xml
> Changes in v3:
> - fix accidently luck-based pre-snap-triangles test
> Changes in v4:
> - apply formatting changes
> - elaborate on various comments describing the test source code files
>
> Signed-off-by: Rhys Perry 
> ---
> I am new to this project and don't have commit access.
>
>  tests/all.py   |  20 ++
>  tests/spec/CMakeLists.txt  |   3 +
>  .../spec/nv_conservative_raster/CMakeLists.gl.txt  |  13 +
>  .../nv_conservative_raster/CMakeLists.gles2.txt|   3 +
>  tests/spec/nv_conservative_raster/CMakeLists.txt   |   1 +
>  tests/spec/nv_conservative_raster/attrib.c | 107 +++
>  tests/spec/nv_conservative_raster/dlist.c  | 110 +++
>  tests/spec/nv_conservative_raster/draw.c   | 338 
> +
>  .../CMakeLists.gl.txt  |  11 +
>  .../nv_conservative_raster_dilate/CMakeLists.txt   |   1 +
>  tests/spec/nv_conservative_raster_dilate/draw.c| 151 +
>  .../CMakeLists.gl.txt  |  11 +
>  .../CMakeLists.gles2.txt   |   3 +
>  .../CMakeLists.txt |   1 +
>  .../draw.c | 148 +
>  15 files changed, 921 insertions(+)
>  create mode 100644 tests/spec/nv_conservative_raster/CMakeLists.gl.txt
>  create mode 100644 tests/spec/nv_conservative_raster/CMakeLists.gles2.txt
>  create mode 100644 tests/spec/nv_conservative_raster/CMakeLists.txt
>  create mode 100644 tests/spec/nv_conservative_raster/attrib.c
>  create mode 100644 tests/spec/nv_conservative_raster/dlist.c
>  create mode 100644 tests/spec/nv_conservative_raster/draw.c
>  create mode 100644 tests/spec/nv_conservative_raster_dilate/CMakeLists.gl.txt
>  create mode 100644 tests/spec/nv_conservative_raster_dilate/CMakeLists.txt
>  create mode 100644 tests/spec/nv_conservative_raster_dilate/draw.c
>  create mode 100644 
> tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.gl.txt
>  create mode 100644 
> tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.gles2.txt
>  create mode 100644 
> tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.txt
>  create mode 100644 
> tests/spec/nv_conservative_raster_pre_snap_triangles/draw.c
>
> diff --git a/tests/all.py b/tests/all.py
> index 7c8580ef0..5fa219ca0 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -4995,5 +4995,25 @@ with profile.test_list.group_manager(
>  g(['arb_bindless_texture-uint64_attribs'], 'uint64_attribs')
>  g(['arb_bindless_texture-uniform'], 'uniform')
>
> +# Group NV_conservative_raster
> +with profile.test_list.group_manager(
> +   PiglitGLTest,
> +   grouptools.join('spec', 'NV_conservative_raster')) as g:
> +g(['nv_conservative_raster-draw'], 'draw')
> +g(['nv_conservative_raster-dlist'], 'dlist')
> +g(['nv_conservative_raster-attrib'], 'attrib')
> +
> +# Group NV_conservative_raster_dilate
> +with profile.test_list.group_manager(
> +   PiglitGLTest,
> +   grouptools.join('spec', 'NV_conservative_raster_dilate')) as g:
> +g(['nv_conservative_raster_dilate-draw'], 'draw')
> +
> +# Group NV_conservative_raster_pre_snap_triangles
> +with profile.test_list.group_manager(
> +   PiglitGLTest,
> +   grouptools.join('spec', 'NV_conservative_raster_pre_snap_triangles')) 
> as g:
> +g(['nv_conservative_raster_pre_snap_triangles-draw'], 'draw')
> +
>  if platform.system() is 'Windows':
>  profile.filters.append(lambda p, _: not p.startswith('glx'))
> diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
> index dc14beb4e..a0bc845c5 100644
> --- a/tests/spec/CMakeLists.txt
> +++ b/tests/spec/CMakeLists.txt
> @@ -101,6 +101,9 @@ add_subdirectory (ext_texture_swizzle)
>  add_subdirectory (ext_timer_query)
>  add_subdirectory (ext_transform_feedback)
>  add_subdirectory (nv_conditional_render)
> +add_subdirectory (nv_conservative_raster)
> +add_subdirectory (nv_conservative_raster_dilate)
> +add_subdirectory (nv_conservative_raster_pre_snap_triangles)
>  add_subdirectory (nv_fill_rectangle)
>  add_subdirectory (nv_image_formats)
>  add_subdirectory (nv_texture_barrier)
> diff --git a/tests/spec/nv_conservative_raster/CMakeLists.gl.txt 
> b/tests/spec/nv_conservative_raster/CMakeLists.gl.txt
> new file mode 100644
> index 0..5f632c864
> --- /dev/null
> +++ b/tests/spec/nv_conservative_raster/CMakeLists.gl.txt
> @@ -0,0 +1,13 @@
> +include_directories(
> +   ${GLEXT_INCLUDE_DIR}
> +   ${OPENGL_INCLUDE_PATH}

Re: [Piglit] [PATCH v4] tests: add nvidia conservative rasterization tests

2018-03-31 Thread Pending Chaos
No, I do not.

I encountered a similar issue where the normal-line test renders differently
with and without -fbo when using nouveau. Looking at the differences, it
seemed the vertices were moved by a small, probably subpixel, amount.
I ended up just skipping the normal-line test when using -fbo (it was not
that important of a test anyways).

The nouveau driver and the nvidia driver also seem to render the triangle
slightly differently when the horizontal subpixel precision bias differs from
the vertical one. This was also worked around.

What exact subtest(s) fail?
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v4] tests: add nvidia conservative rasterization tests

2018-03-31 Thread Brian Paul

On 03/30/2018 03:56 PM, Rhys Perry wrote:

Adds tests for GL_NV_conservative_raster, GL_NV_conservative_raster_dilate
and GL_NV_conservative_raster_pre_snap_triangles.

Changes in v2:
- cleanup the tests
- fix some test failures
- remove the gles version of the dilation test as the extension is not
   exposed in gl.xml
Changes in v3:
- fix accidently luck-based pre-snap-triangles test
Changes in v4:
- apply formatting changes
- elaborate on various comments describing the test source code files

Signed-off-by: Rhys Perry 
---
I am new to this project and don't have commit access.


The code looks good to me.  Though, I discovered one issue: if I run:

bin/nv_conservative_raster-draw -auto

the test fails.  But if I add -fbo, then it passes.  Do you know why 
that is?


I'm testing w/ NVIDIA's driver and a GTX1050.

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


[Piglit] [PATCH v4] tests: add nvidia conservative rasterization tests

2018-03-30 Thread Rhys Perry
Adds tests for GL_NV_conservative_raster, GL_NV_conservative_raster_dilate
and GL_NV_conservative_raster_pre_snap_triangles.

Changes in v2:
- cleanup the tests
- fix some test failures
- remove the gles version of the dilation test as the extension is not
  exposed in gl.xml
Changes in v3:
- fix accidently luck-based pre-snap-triangles test
Changes in v4:
- apply formatting changes
- elaborate on various comments describing the test source code files

Signed-off-by: Rhys Perry 
---
I am new to this project and don't have commit access.

 tests/all.py   |  20 ++
 tests/spec/CMakeLists.txt  |   3 +
 .../spec/nv_conservative_raster/CMakeLists.gl.txt  |  13 +
 .../nv_conservative_raster/CMakeLists.gles2.txt|   3 +
 tests/spec/nv_conservative_raster/CMakeLists.txt   |   1 +
 tests/spec/nv_conservative_raster/attrib.c | 107 +++
 tests/spec/nv_conservative_raster/dlist.c  | 110 +++
 tests/spec/nv_conservative_raster/draw.c   | 338 +
 .../CMakeLists.gl.txt  |  11 +
 .../nv_conservative_raster_dilate/CMakeLists.txt   |   1 +
 tests/spec/nv_conservative_raster_dilate/draw.c| 151 +
 .../CMakeLists.gl.txt  |  11 +
 .../CMakeLists.gles2.txt   |   3 +
 .../CMakeLists.txt |   1 +
 .../draw.c | 148 +
 15 files changed, 921 insertions(+)
 create mode 100644 tests/spec/nv_conservative_raster/CMakeLists.gl.txt
 create mode 100644 tests/spec/nv_conservative_raster/CMakeLists.gles2.txt
 create mode 100644 tests/spec/nv_conservative_raster/CMakeLists.txt
 create mode 100644 tests/spec/nv_conservative_raster/attrib.c
 create mode 100644 tests/spec/nv_conservative_raster/dlist.c
 create mode 100644 tests/spec/nv_conservative_raster/draw.c
 create mode 100644 tests/spec/nv_conservative_raster_dilate/CMakeLists.gl.txt
 create mode 100644 tests/spec/nv_conservative_raster_dilate/CMakeLists.txt
 create mode 100644 tests/spec/nv_conservative_raster_dilate/draw.c
 create mode 100644 
tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.gl.txt
 create mode 100644 
tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.gles2.txt
 create mode 100644 
tests/spec/nv_conservative_raster_pre_snap_triangles/CMakeLists.txt
 create mode 100644 tests/spec/nv_conservative_raster_pre_snap_triangles/draw.c

diff --git a/tests/all.py b/tests/all.py
index 7c8580ef0..5fa219ca0 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4995,5 +4995,25 @@ with profile.test_list.group_manager(
 g(['arb_bindless_texture-uint64_attribs'], 'uint64_attribs')
 g(['arb_bindless_texture-uniform'], 'uniform')
 
+# Group NV_conservative_raster
+with profile.test_list.group_manager(
+   PiglitGLTest,
+   grouptools.join('spec', 'NV_conservative_raster')) as g:
+g(['nv_conservative_raster-draw'], 'draw')
+g(['nv_conservative_raster-dlist'], 'dlist')
+g(['nv_conservative_raster-attrib'], 'attrib')
+
+# Group NV_conservative_raster_dilate
+with profile.test_list.group_manager(
+   PiglitGLTest,
+   grouptools.join('spec', 'NV_conservative_raster_dilate')) as g:
+g(['nv_conservative_raster_dilate-draw'], 'draw')
+
+# Group NV_conservative_raster_pre_snap_triangles
+with profile.test_list.group_manager(
+   PiglitGLTest,
+   grouptools.join('spec', 'NV_conservative_raster_pre_snap_triangles')) 
as g:
+g(['nv_conservative_raster_pre_snap_triangles-draw'], 'draw')
+
 if platform.system() is 'Windows':
 profile.filters.append(lambda p, _: not p.startswith('glx'))
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index dc14beb4e..a0bc845c5 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -101,6 +101,9 @@ add_subdirectory (ext_texture_swizzle)
 add_subdirectory (ext_timer_query)
 add_subdirectory (ext_transform_feedback)
 add_subdirectory (nv_conditional_render)
+add_subdirectory (nv_conservative_raster)
+add_subdirectory (nv_conservative_raster_dilate)
+add_subdirectory (nv_conservative_raster_pre_snap_triangles)
 add_subdirectory (nv_fill_rectangle)
 add_subdirectory (nv_image_formats)
 add_subdirectory (nv_texture_barrier)
diff --git a/tests/spec/nv_conservative_raster/CMakeLists.gl.txt 
b/tests/spec/nv_conservative_raster/CMakeLists.gl.txt
new file mode 100644
index 0..5f632c864
--- /dev/null
+++ b/tests/spec/nv_conservative_raster/CMakeLists.gl.txt
@@ -0,0 +1,13 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (nv_conservative_raster-draw draw.c)
+piglit_add_executable (nv_conservative_raster-dlist dlist.c)
+piglit_add_executable (nv_conservative_raster-attrib attrib.c)
diff --git