[Piglit] [PATCH v3 0/4] Add a generator for testing GLSL defines
Dylan Baker
baker.dylan.c at gmail.com
Wed Apr 13 00:20:03 UTC 2016
This series adds a generator for testing preprocessor defines in GLSL.
IT generates both tests for defines that should be available, and those
that should not. If the driver implements an extension the 'enabled'
tests will run and the 'disabled' will skip, if the driver does not
implement an extension then the opposite will happen.
The first patch is a bug fix for the installer, the seoncd two patches
add some generic framework to help make writing generators easier. the
final patch adds the generator, and deletes tests that it replaces.
Patches 2 and 3 are quite large, but they include a pretty extensive set
of unit tests for the framework bits, since it's hoped that they're
generic enough that other generators could use them.
This series exposes a bug in mesa, it can be seen by the fact that in a
couple of cases the vert and frag disabled tests fail, and the other
stages pass in the enabled tests.
Changes since v1:
- add a template for testing that when an extension isn't available
it cannot be included. (Ilia)
Changes since v2:
- extend the minimum version helper to distinguish between minimum
version per stage in core and with extension. This simplifies the
generator, and fixes a bug in v1 were ES shaders would require desktop
extensions instead of the ES counterpart. (spotted by Ilia)
- rename 'profile' to 'core' and 'legacy' to 'compat' (Ilia)
- add an 'es' tag to es tests.
Dylan Baker (4):
CMakeLists.txt: install compute shaders in generated_tests
generators: Add helper classes for GLSL version numbers
generators: Add a minimum version helper.
generators: Add a simple generator for enabled and disabled defines
CMakeLists.txt | 2 +-
generated_tests/CMakeLists.txt | 8 +
generated_tests/gen_extensions_defined.py | 192 +++++++++
generated_tests/modules/__init__.py | 8 +
generated_tests/modules/glsl.py | 337 +++++++++++++++
.../gen_extensions_defined/disabled.glsl.mako | 40 ++
.../gen_extensions_defined/enabled.glsl.mako | 43 ++
.../undefined-require.glsl.mako | 37 ++
tests/all.py | 1 -
tests/shaders/CMakeLists.gl.txt | 1 -
.../glsl-arb-fragment-coord-conventions-define.c | 83 ----
...glsl-arb-fragment-coord-conventions-define.frag | 10 -
.../amd_shader_trinary_minmax/compiler/define.frag | 19 -
.../amd_shader_trinary_minmax/compiler/define.vert | 19 -
.../arb_derivative_control/compiler/define.frag | 29 --
.../compiler/instanceidarb-disabled.frag | 25 --
.../compiler/instanceidarb-disabled.vert | 25 --
.../compiler/instanceidarb-enabled.frag | 24 --
.../compiler/instanceidarb-enabled.vert | 24 --
.../preprocessor/feature-macro-disabled.frag | 12 -
.../preprocessor/feature-macro-disabled.vert | 12 -
.../preprocessor/feature-macro-enabled.frag | 15 -
.../preprocessor/feature-macro-enabled.vert | 15 -
.../spec/arb_enhanced_layouts/compiler/define.frag | 19 -
.../spec/arb_enhanced_layouts/compiler/define.vert | 19 -
.../1.10/preprocessor/define.frag | 19 -
.../1.10/preprocessor/define.vert | 19 -
.../1.20/preprocessor/define.frag | 19 -
.../1.20/preprocessor/define.vert | 19 -
.../1.30/preprocessor/define-130.frag | 19 -
.../1.30/preprocessor/define-130.vert | 19 -
.../preprocessor/define.frag | 20 -
.../preprocessor/define.vert | 20 -
.../arb_gpu_shader_fp64/preprocessor/define.frag | 19 -
.../arb_gpu_shader_fp64/preprocessor/define.vert | 19 -
.../compiler/1.10/define.frag | 18 -
.../compiler/1.10/define.vert | 18 -
.../compiler/1.20/define.frag | 18 -
.../compiler/1.20/define.vert | 18 -
.../compiler/1.30/define.frag | 18 -
.../compiler/1.30/define.vert | 18 -
.../compiler/1.40/define.frag | 18 -
.../compiler/1.40/define.vert | 18 -
.../compiler/1.50/define.frag | 18 -
.../compiler/1.50/define.geom | 18 -
.../compiler/1.50/define.vert | 18 -
.../preprocessor/define.frag | 19 -
.../preprocessor/define.vert | 19 -
.../preprocessor/define.frag | 19 -
.../preprocessor/define.vert | 19 -
.../compiler/define.vert | 19 -
.../preprocessor/define.frag | 19 -
.../preprocessor/define.vert | 19 -
.../arb_shader_subroutine/preprocessor/define.vert | 19 -
.../arb_tessellation_shader/compiler/define.tesc | 19 -
.../arb_tessellation_shader/compiler/define.tese | 19 -
.../preprocessor/define.frag | 19 -
.../preprocessor/define.vert | 19 -
.../preprocessor/define.frag | 19 -
.../preprocessor/define.vert | 19 -
.../glsl-1.10/preprocessor/define.frag | 19 -
.../glsl-1.10/preprocessor/define.vert | 19 -
.../glsl-1.50/preprocessor/define.geom | 18 -
.../glsl-es-3.10/preprocessor/define.frag | 19 -
.../glsl-es-3.10/preprocessor/define.vert | 19 -
tox.ini | 4 +-
.../modules => unittests/generators}/__init__.py | 0
unittests/generators/test_glsl.py | 473 +++++++++++++++++++++
68 files changed, 1141 insertions(+), 1105 deletions(-)
create mode 100644 generated_tests/gen_extensions_defined.py
create mode 100644 generated_tests/modules/glsl.py
create mode 100644 generated_tests/templates/gen_extensions_defined/disabled.glsl.mako
create mode 100644 generated_tests/templates/gen_extensions_defined/enabled.glsl.mako
create mode 100644 generated_tests/templates/gen_extensions_defined/undefined-require.glsl.mako
delete mode 100644 tests/shaders/glsl-arb-fragment-coord-conventions-define.c
delete mode 100644 tests/shaders/glsl-arb-fragment-coord-conventions-define.frag
delete mode 100644 tests/spec/amd_shader_trinary_minmax/compiler/define.frag
delete mode 100644 tests/spec/amd_shader_trinary_minmax/compiler/define.vert
delete mode 100644 tests/spec/arb_derivative_control/compiler/define.frag
delete mode 100644 tests/spec/arb_draw_instanced/compiler/instanceidarb-disabled.frag
delete mode 100644 tests/spec/arb_draw_instanced/compiler/instanceidarb-disabled.vert
delete mode 100644 tests/spec/arb_draw_instanced/compiler/instanceidarb-enabled.frag
delete mode 100644 tests/spec/arb_draw_instanced/compiler/instanceidarb-enabled.vert
delete mode 100644 tests/spec/arb_draw_instanced/preprocessor/feature-macro-disabled.frag
delete mode 100644 tests/spec/arb_draw_instanced/preprocessor/feature-macro-disabled.vert
delete mode 100644 tests/spec/arb_draw_instanced/preprocessor/feature-macro-enabled.frag
delete mode 100644 tests/spec/arb_draw_instanced/preprocessor/feature-macro-enabled.vert
delete mode 100644 tests/spec/arb_enhanced_layouts/compiler/define.frag
delete mode 100644 tests/spec/arb_enhanced_layouts/compiler/define.vert
delete mode 100644 tests/spec/arb_explicit_attrib_location/1.10/preprocessor/define.frag
delete mode 100644 tests/spec/arb_explicit_attrib_location/1.10/preprocessor/define.vert
delete mode 100644 tests/spec/arb_explicit_attrib_location/1.20/preprocessor/define.frag
delete mode 100644 tests/spec/arb_explicit_attrib_location/1.20/preprocessor/define.vert
delete mode 100644 tests/spec/arb_explicit_attrib_location/1.30/preprocessor/define-130.frag
delete mode 100644 tests/spec/arb_explicit_attrib_location/1.30/preprocessor/define-130.vert
delete mode 100644 tests/spec/arb_explicit_uniform_location/preprocessor/define.frag
delete mode 100644 tests/spec/arb_explicit_uniform_location/preprocessor/define.vert
delete mode 100644 tests/spec/arb_gpu_shader_fp64/preprocessor/define.frag
delete mode 100644 tests/spec/arb_gpu_shader_fp64/preprocessor/define.vert
delete mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.10/define.frag
delete mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.10/define.vert
delete mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.20/define.frag
delete mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.20/define.vert
delete mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.30/define.frag
delete mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.30/define.vert
delete mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.40/define.frag
delete mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.40/define.vert
delete mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.50/define.frag
delete mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.50/define.geom
delete mode 100644 tests/spec/arb_separate_shader_objects/compiler/1.50/define.vert
delete mode 100644 tests/spec/arb_shader_atomic_counter_ops/preprocessor/define.frag
delete mode 100644 tests/spec/arb_shader_atomic_counter_ops/preprocessor/define.vert
delete mode 100644 tests/spec/arb_shader_atomic_counters/preprocessor/define.frag
delete mode 100644 tests/spec/arb_shader_atomic_counters/preprocessor/define.vert
delete mode 100644 tests/spec/arb_shader_draw_parameters/compiler/define.vert
delete mode 100644 tests/spec/arb_shader_storage_buffer_object/preprocessor/define.frag
delete mode 100644 tests/spec/arb_shader_storage_buffer_object/preprocessor/define.vert
delete mode 100644 tests/spec/arb_shader_subroutine/preprocessor/define.vert
delete mode 100644 tests/spec/arb_tessellation_shader/compiler/define.tesc
delete mode 100644 tests/spec/arb_tessellation_shader/compiler/define.tese
delete mode 100644 tests/spec/arb_uniform_buffer_object/preprocessor/define.frag
delete mode 100644 tests/spec/arb_uniform_buffer_object/preprocessor/define.vert
delete mode 100644 tests/spec/arb_vertex_attrib_64bit/preprocessor/define.frag
delete mode 100644 tests/spec/arb_vertex_attrib_64bit/preprocessor/define.vert
delete mode 100644 tests/spec/ext_shader_samples_identical/glsl-1.10/preprocessor/define.frag
delete mode 100644 tests/spec/ext_shader_samples_identical/glsl-1.10/preprocessor/define.vert
delete mode 100644 tests/spec/ext_shader_samples_identical/glsl-1.50/preprocessor/define.geom
delete mode 100644 tests/spec/ext_shader_samples_identical/glsl-es-3.10/preprocessor/define.frag
delete mode 100644 tests/spec/ext_shader_samples_identical/glsl-es-3.10/preprocessor/define.vert
copy {generated_tests/modules => unittests/generators}/__init__.py (100%)
create mode 100644 unittests/generators/test_glsl.py
--
2.8.0
More information about the Piglit
mailing list