[Piglit] [PATCH 1/1] cl: Enable required extension before using double type
Fixes failures on OCL-1.1 implementations that provide cl_khr_fp64 Signed-off-by: Jan Vesely --- generated_tests/cl/store/store-kernels-global.inc | 4 ++-- generated_tests/cl/store/store-kernels-local.inc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generated_tests/cl/store/store-kernels-global.inc b/generated_tests/cl/store/store-kernels-global.inc index b6220d0..ae9b74e 100644 --- a/generated_tests/cl/store/store-kernels-global.inc +++ b/generated_tests/cl/store/store-kernels-global.inc @@ -1,9 +1,9 @@ -typedef TYPE type_t; - #if TYPE == double #pragma OPENCL EXTENSION cl_khr_fp64 : enable #endif +typedef TYPE type_t; + kernel void store_global(global type_t *out, global type_t *in) { out[0] = in[0]; out[1] = in[1]; diff --git a/generated_tests/cl/store/store-kernels-local.inc b/generated_tests/cl/store/store-kernels-local.inc index b3265f4..6692e37 100644 --- a/generated_tests/cl/store/store-kernels-local.inc +++ b/generated_tests/cl/store/store-kernels-local.inc @@ -1,9 +1,9 @@ -typedef TYPE type_t; - #if TYPE == double #pragma OPENCL EXTENSION cl_khr_fp64 : enable #endif +typedef TYPE type_t; + kernel void store_local(global type_t *out, global type_t *in) { local type_t local_data[8]; size_t id = get_local_id(0); -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 0/4] Replace bash generator with python generator
On Fri, Mar 27, 2015 at 09:07:07PM +, Emil Velikov wrote: > On 27 March 2015 at 19:48, Dylan Baker wrote: > > Apparently patch 1 is almost a 1Mb, so... > > > > This is available at my github: > > https://github.com/dcbaker/piglit submit/generate-variable-index-read > > > As usual a couple of trivial suggestions from me :-) > > s/gen_variable_index_read_tests.list/variable_index_read_tests.list/ Fixed > s/the follwing/The following/ Line removed, because of the change below. > > About diffstat - the series contains some 100+ lines of copyright > headers. So even if one ignores the generated artefacts, there is > still some improvement in the LOC count. I added a function to the helpers.mako for adding the copyright header, so, that saves a few lines of code. > > -Emil signature.asc Description: Digital signature ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 0/4] Replace bash generator with python generator
On 27 March 2015 at 19:48, Dylan Baker wrote: > Apparently patch 1 is almost a 1Mb, so... > > This is available at my github: > https://github.com/dcbaker/piglit submit/generate-variable-index-read > As usual a couple of trivial suggestions from me :-) s/gen_variable_index_read_tests.list/variable_index_read_tests.list/ s/the follwing/The following/ About diffstat - the series contains some 100+ lines of copyright headers. So even if one ignores the generated artefacts, there is still some improvement in the LOC count. -Emil ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] glsl-1.50: check read only interfaces are read only
Reviewed-by: Mark Janes Timothy Arceri writes: > Test results: > > AMD Radeon HD 6670 - Catalyst 14.501.1003 OpenGL 4.4 > > interface-block-instance-name-input-read-only.frag - pass > interface-block-input-read-only.frag - pass > interface-block-instance-name-uniform-read-only.frag - fail > interface-block-uniform-read-only.frag - fail > --- > .../compiler/interface-block-input-read-only.frag| 20 > > ...nterface-block-instance-name-input-read-only.frag | 20 > > ...erface-block-instance-name-uniform-read-only.frag | 20 > > .../compiler/interface-block-uniform-read-only.frag | 20 > > 4 files changed, 80 insertions(+) > create mode 100644 > tests/spec/glsl-1.50/compiler/interface-block-input-read-only.frag > create mode 100644 > tests/spec/glsl-1.50/compiler/interface-block-instance-name-input-read-only.frag > create mode 100644 > tests/spec/glsl-1.50/compiler/interface-block-instance-name-uniform-read-only.frag > create mode 100644 > tests/spec/glsl-1.50/compiler/interface-block-uniform-read-only.frag > > diff --git > a/tests/spec/glsl-1.50/compiler/interface-block-input-read-only.frag > b/tests/spec/glsl-1.50/compiler/interface-block-input-read-only.frag > new file mode 100644 > index 000..304aacf > --- /dev/null > +++ b/tests/spec/glsl-1.50/compiler/interface-block-input-read-only.frag > @@ -0,0 +1,20 @@ > +// [config] > +// expect_result: fail > +// glsl_version: 1.50 > +// check_link: false > +// [end config] > +// > +// Check that an error is generated when trying > +// to change the value of a shader input. > + > +#version 150 > + > +in Block { > + vec4 invar; > +}; > + > +void main() > +{ > + invar = vec4(1.0); > + gl_FragColor = invar; > +} > diff --git > a/tests/spec/glsl-1.50/compiler/interface-block-instance-name-input-read-only.frag > > b/tests/spec/glsl-1.50/compiler/interface-block-instance-name-input-read-only.frag > new file mode 100644 > index 000..d001db8 > --- /dev/null > +++ > b/tests/spec/glsl-1.50/compiler/interface-block-instance-name-input-read-only.frag > @@ -0,0 +1,20 @@ > +// [config] > +// expect_result: fail > +// glsl_version: 1.50 > +// check_link: false > +// [end config] > +// > +// Check that an error is generated when trying > +// to change the value of a shader input. > + > +#version 150 > + > +in Block { > + vec4 invar; > +} a; > + > +void main() > +{ > + a.invar = vec4(1.0); > + gl_FragColor = a.invar; > +} > diff --git > a/tests/spec/glsl-1.50/compiler/interface-block-instance-name-uniform-read-only.frag > > b/tests/spec/glsl-1.50/compiler/interface-block-instance-name-uniform-read-only.frag > new file mode 100644 > index 000..43909ba > --- /dev/null > +++ > b/tests/spec/glsl-1.50/compiler/interface-block-instance-name-uniform-read-only.frag > @@ -0,0 +1,20 @@ > +// [config] > +// expect_result: fail > +// glsl_version: 1.50 > +// check_link: false > +// [end config] > +// > +// Check that an error is generated when trying > +// to change the value of a uniform. > + > +#version 150 > + > +uniform Block { > + vec4 invar; > +} a; > + > +void main() > +{ > + a.invar = vec4(1.0); > + gl_FragColor = a.invar; > +} > diff --git > a/tests/spec/glsl-1.50/compiler/interface-block-uniform-read-only.frag > b/tests/spec/glsl-1.50/compiler/interface-block-uniform-read-only.frag > new file mode 100644 > index 000..aaea6b3 > --- /dev/null > +++ b/tests/spec/glsl-1.50/compiler/interface-block-uniform-read-only.frag > @@ -0,0 +1,20 @@ > +// [config] > +// expect_result: fail > +// glsl_version: 1.50 > +// check_link: false > +// [end config] > +// > +// Check that an error is generated when trying > +// to change the value of a uniform. > + > +#version 150 > + > +uniform Block { > + vec4 invar; > +}; > + > +void main() > +{ > + invar = vec4(1.0); > + gl_FragColor = invar; > +} > -- > 2.1.0 > > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/piglit ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 0/4] Replace bash generator with python generator
On Fri, Mar 27, 2015 at 03:52:49PM -0400, Ilia Mirkin wrote: > On Fri, Mar 27, 2015 at 3:01 PM, Dylan Baker wrote: > > This replaces one of the two variable-index generators. I'm working on > > the second one as well, but that generator is more difficult to work > > with than this was. > > > > I think that the diffstats speak for themselves on this one. > > FWIW, they appear to be basically the same length. The big gain here > is "don't check in generated artifacts"... Yeah, I guess thats true. But ~35K LOC deleted... signature.asc Description: Digital signature ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 0/4] Replace bash generator with python generator
On Fri, Mar 27, 2015 at 3:01 PM, Dylan Baker wrote: > This replaces one of the two variable-index generators. I'm working on > the second one as well, but that generator is more difficult to work > with than this was. > > I think that the diffstats speak for themselves on this one. FWIW, they appear to be basically the same length. The big gain here is "don't check in generated artifacts"... ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 0/4] Replace bash generator with python generator
Apparently patch 1 is almost a 1Mb, so... This is available at my github: https://github.com/dcbaker/piglit submit/generate-variable-index-read Dylan On Fri, Mar 27, 2015 at 12:01:23PM -0700, Dylan Baker wrote: > This replaces one of the two variable-index generators. I'm working on > the second one as well, but that generator is more difficult to work > with than this was. > > I think that the diffstats speak for themselves on this one. > > The initial patch is as naive a port as possible. The goal was to > produce a generator that produced as close to the same result as > possible without a lot of guessing about what I had changed from the > original. The following 3 patches make some cleanups and generally make > the generator better. They could be squashed back into the original > patch if reviews feel that way. > > I tested this with both python2.7 and python3.3, in both cases the > generated tests were the same except for white space, and produced the > same result (pass) on my HSW GT3e. > > Dylan Baker (4): > generators: port variable-index-read.sh to python > gen_variable_index_read_tests use bools instead of 0 and 1 > gen_variable_index_read_tests: simplify some things > gen_variable_index_read_tests.py: reduce duplication with loop > > 440 files changed, 547 insertions(+), 34076 deletions(-) > > -- > 2.3.4 > signature.asc Description: Digital signature ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 3/4] gen_variable_index_read_tests: simplify some things
This makes the port a little less naive than it did before. Signed-off-by: Dylan Baker 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/generated_tests/templates/gen_variable_index_read_tests/helpers.mako b/generated_tests/templates/gen_variable_index_read_tests/helpers.mako index 7c9305f..da5d963 100644 --- a/generated_tests/templates/gen_variable_index_read_tests/helpers.mako +++ b/generated_tests/templates/gen_variable_index_read_tests/helpers.mako @@ -121,13 +121,7 @@ void main() * written." */ % endif -## TODO: Could probably simplify this with the use of params.row -% if params.expect_type == 'float': - color = (m${params.idx}[${params.col}][row] == expect) \ -% else: - color = (m${params.idx}[${params.col}] == expect) \ -% endif -? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); +color = (m${params.idx}[${params.col}]${params.row} == expect) ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); % endif } -- 2.3.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 2/4] gen_variable_index_read_tests use bools instead of 0 and 1
Signed-off-by: Dylan Baker 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/generated_tests/templates/gen_variable_index_read_tests/fs.shader_test.mako b/generated_tests/templates/gen_variable_index_read_tests/fs.shader_test.mako index 33f5a78..0009bdc 100644 --- a/generated_tests/templates/gen_variable_index_read_tests/fs.shader_test.mako +++ b/generated_tests/templates/gen_variable_index_read_tests/fs.shader_test.mako @@ -41,8 +41,8 @@ ${helpers.emit_header(params)} -${helpers.emit_vs(params, 0)} +${helpers.emit_vs(params, False)} -${helpers.emit_fs(params, 1)} +${helpers.emit_fs(params, True)} ${helpers.emit_test_vectors(params)} diff --git a/generated_tests/templates/gen_variable_index_read_tests/helpers.mako b/generated_tests/templates/gen_variable_index_read_tests/helpers.mako index cb3d922..7c9305f 100644 --- a/generated_tests/templates/gen_variable_index_read_tests/helpers.mako +++ b/generated_tests/templates/gen_variable_index_read_tests/helpers.mako @@ -99,7 +99,6 @@ ${base_type}(${matrix_data(c * matrix_dim**2 + 1, matrix_dim)})\ varying vec4 color; -## TODO: convert do_compare into a bool <%def name="emit_vs(params, do_compare)" filter="newlines"> [vertex shader] ${emit_globals(params)} @@ -108,11 +107,11 @@ void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - % if params.mode == 'varying' or (params.mode == 'temp' and do_compare != 0): + % if params.mode == 'varying' or (params.mode == 'temp' and do_compare): ${emit_set_matrix(params)} % endif - % if do_compare != 0: + % if do_compare: % if params.mode == 'varying': /* From page 23 (page 30 of the PDF) of the GLSL 1.10 spec: * @@ -133,14 +132,13 @@ void main() } -## TODO: convert do_compare into a bool <%def name="emit_fs(params, do_compare)" filter="newlines"> [fragment shader] ${emit_globals(params)} void main() { - % if do_compare == 0 and params.mode == 'varying': + % if not do_compare and params.mode == 'varying': /* There is some trickery here. The fragment shader has to actually use * the varyings generated by the vertex shader, or the compiler (more * likely the linker) might demote the varying outputs to just be vertex @@ -148,12 +146,12 @@ void main() * shader reading from a varying, that would defeat the test. */ % endif - % if do_compare != 0 or params.mode == 'varying': + % if do_compare or params.mode == 'varying': % if params.mode == 'temp': ${emit_set_matrix(params)} % endif gl_FragColor = (m${params.idx}[${params.col}]${params.row} == expect) \ -% if do_compare == 0: +% if not do_compare: ? color : vec4(1.0, 0.0, 0.0, 1.0); % else: ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); diff --git a/generated_tests/templates/gen_variable_index_read_tests/vs.shader_test.mako b/generated_tests/templates/gen_variable_index_read_tests/vs.shader_test.mako index 3d20499..507d3d7 100644 --- a/generated_tests/templates/gen_variable_index_read_tests/vs.shader_test.mako +++ b/generated_tests/templates/gen_variable_index_read_tests/vs.shader_test.mako @@ -41,8 +41,8 @@ ${helpers.emit_header(params)} -${helpers.emit_vs(params, 1)} +${helpers.emit_vs(params, True)} -${helpers.emit_fs(params, 0)} +${helpers.emit_fs(params, False)} ${helpers.emit_test_vectors(params)} -- 2.3.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH 4/4] gen_variable_index_read_tests.py: reduce duplication with loop
This reduces the number of calls to make_{fs,vs} by using more loops. This means less code and makes some things easier to read and understand. Signed-off-by: Dylan Baker 1 file changed, 39 insertions(+), 89 deletions(-) diff --git a/generated_tests/gen_variable_index_read_tests.py b/generated_tests/gen_variable_index_read_tests.py index 7c597cb..f28087b 100644 --- a/generated_tests/gen_variable_index_read_tests.py +++ b/generated_tests/gen_variable_index_read_tests.py @@ -165,96 +165,46 @@ def main(): array_dims = [0, 3] matrix_dims = [2, 3, 4] glsl_versions = [110, 120] -iter_ = itertools.product(modes, array_dims, matrix_dims, glsl_versions) -for mode, array_dim, matrix_dim, glsl_version in iter_: -if array_dim != 0: -arr = 'array-' -idx_text = 'index-' - -# TODO: This can certainly be rolled up into a loop - -make_fs( - 'fs-{mode}-{arr}mat{matrix_dim}-col-row-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 1, 'col', 'float', - glsl_version)) - -make_fs( - 'fs-{mode}-{arr}mat{matrix_dim}-row-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 1, 1, 'float', - glsl_version)) - -make_fs( - 'fs-{mode}-{arr}mat{matrix_dim}-col-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 1, 'col', - 'vec{}'.format(matrix_dim), glsl_version)) - -make_fs( - 'fs-{mode}-{arr}mat{matrix_dim}-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 1, 1, - 'vec{}'.format(matrix_dim), glsl_version)) - -make_vs( - 'vs-{mode}-{arr}mat{matrix_dim}-col-row-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 1, 'col', 'float', - glsl_version)) - -make_vs( - 'vs-{mode}-{arr}mat{matrix_dim}-row-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 1, 1, 'float', - glsl_version)) - -make_vs( - 'vs-{mode}-{arr}mat{matrix_dim}-col-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 1, 'col', - 'vec{}'.format(matrix_dim), glsl_version)) - -make_vs( - 'vs-{mode}-{arr}mat{matrix_dim}-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 1, 1, - 'vec{}'.format(matrix_dim), glsl_version)) +cols = [1, 'col'] +stages = ['fs', 'vs'] +iter_ = itertools.product(stages, modes, array_dims, matrix_dims, + glsl_versions, cols) +for stage, mode, array_dim, matrix_dim, glsl_version, col in iter_: +if stage == 'vs': +func = make_vs else: -arr = '' -idx_text = '' - -make_fs( - 'fs-{mode}-{arr}mat{matrix_dim}-{idx_text}col-row-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 'index', 'col', 'float', - glsl_version)) - -make_fs( - 'fs-{mode}-{arr}mat{matrix_dim}-{idx_text}row-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 'index', 1, 'float', - glsl_version)) - -make_fs( - 'fs-{mode}-{arr}mat{matrix_dim}-{idx_text}col-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 'index', 'col', - 'vec{}'.format(matrix_dim), glsl_version)) - -make_fs( - 'fs-{mode}-{arr}mat{matrix_dim}-{idx_text}rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 'index', 1, - 'vec{}'.format(matrix_dim), glsl_version)) - -make_vs( - 'vs-{mode}-{arr}mat{matrix_dim}-{idx_text}col-row-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 'index', 'col', 'float', - glsl_version)) - -make_vs( - 'vs-{mode}-{arr}mat{matrix_dim}-{idx_text}row-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 'index', 1, 'float', - glsl_version)) - -make_vs( - 'vs-{mode}-{arr}mat{matrix_dim}-{idx_text}col-rd.shader_test'.format(**locals()), -TestParams(matrix_dim, array_dim, mode, 'index', 'col', - 'vec{}'.format(matrix_dim), glsl_version)) - -make_vs( - 'vs-{mode}-{arr}mat{matrix_dim}-{idx_text}rd.shader_test'.format(**locals()), -TestParams
[Piglit] [PATCH 0/4] Replace bash generator with python generator
This replaces one of the two variable-index generators. I'm working on the second one as well, but that generator is more difficult to work with than this was. I think that the diffstats speak for themselves on this one. The initial patch is as naive a port as possible. The goal was to produce a generator that produced as close to the same result as possible without a lot of guessing about what I had changed from the original. The following 3 patches make some cleanups and generally make the generator better. They could be squashed back into the original patch if reviews feel that way. I tested this with both python2.7 and python3.3, in both cases the generated tests were the same except for white space, and produced the same result (pass) on my HSW GT3e. Dylan Baker (4): generators: port variable-index-read.sh to python gen_variable_index_read_tests use bools instead of 0 and 1 gen_variable_index_read_tests: simplify some things gen_variable_index_read_tests.py: reduce duplication with loop 440 files changed, 547 insertions(+), 34076 deletions(-) -- 2.3.4 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] glsl-es-1.00: add constant-index-expression indexing test with struct
On Fri, Mar 27, 2015 at 12:27 AM, Tapani Pälli wrote: > This test fails with current Mesa HEAD (6264348), see bug > https://bugs.freedesktop.org/show_bug.cgi?id=84225. > > Signed-off-by: Tapani Pälli > --- > .../struct-sampler-array-index.frag| 42 > ++ > 1 file changed, 42 insertions(+) > create mode 100644 > tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/struct-sampler-array-index.frag > > diff --git > a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/struct-sampler-array-index.frag > > b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/struct-sampler-array-index.frag > new file mode 100644 > index 000..122a8a4 > --- /dev/null > +++ > b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/struct-sampler-array-index.frag > @@ -0,0 +1,42 @@ > +/* [config] > + * expect_result: pass > + * glsl_version: 1.00 > + * [end config] > + * > + * From "Appendix A" of the GLSL ES 1.00 spec: > + * > + * "GLSL ES 1.00 supports both arrays of samplers and arrays of > + * structures which contain samplers. In both these cases, for > + * ES 2.0, support for indexing with a constant-index-expression > + * is mandated" > + * > + * For additional complexity this test has array of structures > + * that has array of samplers. > + * > + */ > +#version 100 > + > +struct s_t > +{ > + sampler2D array[1]; array[2]. > + sampler2D foo; > +}; > + > +uniform s_t array[1]; array[2]. > + > +void main() > +{ > + highp vec4 color; > + > + // case 1, sampler in array of structs > + for (int i = 0; i < 2; i++) { > + color += texture2D(array[i].foo, vec2(0.0)); > + } > + > + // case 2, index sampler array in array of structs > + for (int i = 0; i < 2; i++) { > + color += texture2D(array[i].array[i], vec2(0.0)); > + } I think these would be better as a doubly-nested loop. I was going to suggest using .length() instead of hardcoded upper bounds, but that's not really possible with two separate loops, the second of which assumes the two arrays are of equal size. > + > + gl_FragColor = color; > +} > -- > 2.1.0 > ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] glsl-es-1.00: add test for constant-index-expression indexing
On Thu, Mar 26, 2015 at 11:49 PM, Tapani Pälli wrote: > This test fails with current Mesa HEAD (6264348), see bug > https://bugs.freedesktop.org/show_bug.cgi?id=84225. > > Signed-off-by: Tapani Pälli > --- > .../sampler-array-index.frag | 24 > ++ > 1 file changed, 24 insertions(+) > create mode 100644 > tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag > > diff --git > a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag > > b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag > new file mode 100644 > index 000..08ed68d > --- /dev/null > +++ > b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag > @@ -0,0 +1,24 @@ > +/* [config] > + * expect_result: pass > + * glsl_version: 1.00 > + * [end config] > + * > + * From "Appendix A" of the GLSL ES 1.00 spec: > + * > + * "GLSL ES 1.00 supports both arrays of samplers and arrays of > + * structures which contain samplers. In both these cases, for > + * ES 2.0, support for indexing with a constant-index-expression > + * is mandated" > + * > + */ > +#version 100 > +uniform sampler2D array[1]; I only noticed upon looking at the second test, but this is wrong. Should be array[2]. > + > +void main() > +{ > + highp vec4 color; > + for (int i = 0; i < 2; i++) { Using array.length() here would have at least prevented the failure, even if it didn't quite do what we expected. With *those* fixed, Reviewed-by: Matt Turner > + color += texture2D(array[i], vec2(0.0)); > + } > + gl_FragColor = color; > +} > -- > 2.1.0 > > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/piglit ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] glsl-1.50: check read only interfaces are read only
On Fri, Mar 27, 2015 at 6:12 AM, Timothy Arceri wrote: > Test results: > > AMD Radeon HD 6670 - Catalyst 14.501.1003 OpenGL 4.4 > > interface-block-instance-name-input-read-only.frag - pass > interface-block-input-read-only.frag - pass > interface-block-instance-name-uniform-read-only.frag - fail > interface-block-uniform-read-only.frag - fail > --- > .../compiler/interface-block-input-read-only.frag| 20 > > ...nterface-block-instance-name-input-read-only.frag | 20 > > ...erface-block-instance-name-uniform-read-only.frag | 20 > > .../compiler/interface-block-uniform-read-only.frag | 20 > > 4 files changed, 80 insertions(+) > create mode 100644 > tests/spec/glsl-1.50/compiler/interface-block-input-read-only.frag > create mode 100644 > tests/spec/glsl-1.50/compiler/interface-block-instance-name-input-read-only.frag > create mode 100644 > tests/spec/glsl-1.50/compiler/interface-block-instance-name-uniform-read-only.frag > create mode 100644 > tests/spec/glsl-1.50/compiler/interface-block-uniform-read-only.frag > > diff --git > a/tests/spec/glsl-1.50/compiler/interface-block-input-read-only.frag > b/tests/spec/glsl-1.50/compiler/interface-block-input-read-only.frag > new file mode 100644 > index 000..304aacf > --- /dev/null > +++ b/tests/spec/glsl-1.50/compiler/interface-block-input-read-only.frag > @@ -0,0 +1,20 @@ > +// [config] > +// expect_result: fail > +// glsl_version: 1.50 > +// check_link: false > +// [end config] > +// > +// Check that an error is generated when trying > +// to change the value of a shader input. > + > +#version 150 > + > +in Block { > + vec4 invar; > +}; > + > +void main() > +{ > + invar = vec4(1.0); > + gl_FragColor = invar; > +} > diff --git > a/tests/spec/glsl-1.50/compiler/interface-block-instance-name-input-read-only.frag > > b/tests/spec/glsl-1.50/compiler/interface-block-instance-name-input-read-only.frag > new file mode 100644 > index 000..d001db8 > --- /dev/null > +++ > b/tests/spec/glsl-1.50/compiler/interface-block-instance-name-input-read-only.frag > @@ -0,0 +1,20 @@ > +// [config] > +// expect_result: fail > +// glsl_version: 1.50 > +// check_link: false > +// [end config] > +// > +// Check that an error is generated when trying > +// to change the value of a shader input. > + > +#version 150 > + > +in Block { > + vec4 invar; > +} a; > + > +void main() > +{ > + a.invar = vec4(1.0); > + gl_FragColor = a.invar; > +} > diff --git > a/tests/spec/glsl-1.50/compiler/interface-block-instance-name-uniform-read-only.frag > > b/tests/spec/glsl-1.50/compiler/interface-block-instance-name-uniform-read-only.frag > new file mode 100644 > index 000..43909ba > --- /dev/null > +++ > b/tests/spec/glsl-1.50/compiler/interface-block-instance-name-uniform-read-only.frag > @@ -0,0 +1,20 @@ > +// [config] > +// expect_result: fail > +// glsl_version: 1.50 > +// check_link: false > +// [end config] > +// > +// Check that an error is generated when trying > +// to change the value of a uniform. > + > +#version 150 > + > +uniform Block { > + vec4 invar; > +} a; > + > +void main() > +{ > + a.invar = vec4(1.0); > + gl_FragColor = a.invar; > +} > diff --git > a/tests/spec/glsl-1.50/compiler/interface-block-uniform-read-only.frag > b/tests/spec/glsl-1.50/compiler/interface-block-uniform-read-only.frag > new file mode 100644 > index 000..aaea6b3 > --- /dev/null > +++ b/tests/spec/glsl-1.50/compiler/interface-block-uniform-read-only.frag > @@ -0,0 +1,20 @@ > +// [config] > +// expect_result: fail > +// glsl_version: 1.50 > +// check_link: false > +// [end config] > +// > +// Check that an error is generated when trying > +// to change the value of a uniform. > + > +#version 150 > + > +uniform Block { > + vec4 invar; > +}; > + > +void main() > +{ > + invar = vec4(1.0); > + gl_FragColor = invar; > +} > -- > 2.1.0 > > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/piglit LGTM. Reviewed-by: Anuj Phogat ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] glsl-1.50: don't do link check in gs-also-uses-smooth-flat-noperspective.geom
On Fri, Mar 27, 2015 at 3:22 AM, Samuel Iglesias Gonsalvez wrote: > From GLSL 1.50 spec, section 4.3.4 "Inputs": > > "Only the input variables that are actually read need to be written by the >previous stage" >[...] > "Geometry shader input variables get the per-vertex values written >out by vertex shader output variables of the same names." > > As there is not vertex shader that defines the respective output > variables, this test should fail when linking. However, as it is checking > that smooth and flat interpolation qualifiers are allowed in geometry > shaders, this patch disables link checking. > > Signed-off-by: Samuel Iglesias Gonsalvez > --- > .../spec/glsl-1.50/compiler/gs-also-uses-smooth-flat-noperspective.geom | 2 > +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git > a/tests/spec/glsl-1.50/compiler/gs-also-uses-smooth-flat-noperspective.geom > b/tests/spec/glsl-1.50/compiler/gs-also-uses-smooth-flat-noperspective.geom > index f1ab41e..9eb0d7a 100644 > --- > a/tests/spec/glsl-1.50/compiler/gs-also-uses-smooth-flat-noperspective.geom > +++ > b/tests/spec/glsl-1.50/compiler/gs-also-uses-smooth-flat-noperspective.geom > @@ -1,7 +1,7 @@ > // [config] > // expect_result: pass > // glsl_version: 1.50 > -// check_link: true > +// check_link: false > // [end config] > > #version 150 > -- > 2.1.0 > > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/piglit Reviewed-by: Anuj Phogat ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 3/3] cl: add atan2pi test
On Fri, 2015-03-27 at 11:13 +, Bruno Jimenez wrote: > On Wed, 2015-03-25 at 13:33 -0400, Jan Vesely wrote: > > tested on clover and intel ocl-sdk > > > > Signed-off-by: Jan Vesely > > --- > > generated_tests/gen_cl_math_builtins.py | 11 +++ > > 1 file changed, 11 insertions(+) > > > > diff --git a/generated_tests/gen_cl_math_builtins.py > > b/generated_tests/gen_cl_math_builtins.py > > index d86b53a..59b7f18 100644 > > --- a/generated_tests/gen_cl_math_builtins.py > > +++ b/generated_tests/gen_cl_math_builtins.py > > @@ -39,6 +39,7 @@ CLC_VERSION_MIN = { > > 'asinpi' : 10, > > 'atan' : 10, > > 'atan2' : 10, > > +'atan2pi' : 10, > > 'atanh' : 10, > > 'atanpi': 10, > > 'cbrt' : 10, > > @@ -153,6 +154,16 @@ tests = { > > ], > > 'tolerance' : 6 > > }, > > +'atan2pi' : { > > +'arg_types' : [F, F, F], > > +'function_type': 'ttt', > > +'values' : [ > > +[atan2(0.0, 0.0)/pi, atan2(1.2345, 10.0)/pi, atan2(35671470.0, > > 0.1)/pi], # Result > > +[0.0, 1.2345, 35671470.0 > > ], # Arg0 > > +[0.0, 10.0,0.1 ] > > # Arg1 > > + > Hi, > > If I remember correctly, atan2 also accepts negative imputs for x and y, > and returns the correct angle (remember that tan(x) == tan(x + pi)). > Should they be also tested? I agree. This is just a simple adaptation of atan2 tests. There's also additional edge case behavior described in 7.5.1 that should be tested too. jan > > -Bruno > > > ], > > +'tolerance' : 6 > > + }, > > 'atanh' : { > > 'arg_types' : [F, F], > > 'function_type': 'ttt', > > -- Jan Vesely signature.asc Description: This is a digitally signed message part ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] glsl-1.50: check read only interfaces are read only
Test results: AMD Radeon HD 6670 - Catalyst 14.501.1003 OpenGL 4.4 interface-block-instance-name-input-read-only.frag - pass interface-block-input-read-only.frag - pass interface-block-instance-name-uniform-read-only.frag - fail interface-block-uniform-read-only.frag - fail --- .../compiler/interface-block-input-read-only.frag| 20 ...nterface-block-instance-name-input-read-only.frag | 20 ...erface-block-instance-name-uniform-read-only.frag | 20 .../compiler/interface-block-uniform-read-only.frag | 20 4 files changed, 80 insertions(+) create mode 100644 tests/spec/glsl-1.50/compiler/interface-block-input-read-only.frag create mode 100644 tests/spec/glsl-1.50/compiler/interface-block-instance-name-input-read-only.frag create mode 100644 tests/spec/glsl-1.50/compiler/interface-block-instance-name-uniform-read-only.frag create mode 100644 tests/spec/glsl-1.50/compiler/interface-block-uniform-read-only.frag diff --git a/tests/spec/glsl-1.50/compiler/interface-block-input-read-only.frag b/tests/spec/glsl-1.50/compiler/interface-block-input-read-only.frag new file mode 100644 index 000..304aacf --- /dev/null +++ b/tests/spec/glsl-1.50/compiler/interface-block-input-read-only.frag @@ -0,0 +1,20 @@ +// [config] +// expect_result: fail +// glsl_version: 1.50 +// check_link: false +// [end config] +// +// Check that an error is generated when trying +// to change the value of a shader input. + +#version 150 + +in Block { + vec4 invar; +}; + +void main() +{ + invar = vec4(1.0); + gl_FragColor = invar; +} diff --git a/tests/spec/glsl-1.50/compiler/interface-block-instance-name-input-read-only.frag b/tests/spec/glsl-1.50/compiler/interface-block-instance-name-input-read-only.frag new file mode 100644 index 000..d001db8 --- /dev/null +++ b/tests/spec/glsl-1.50/compiler/interface-block-instance-name-input-read-only.frag @@ -0,0 +1,20 @@ +// [config] +// expect_result: fail +// glsl_version: 1.50 +// check_link: false +// [end config] +// +// Check that an error is generated when trying +// to change the value of a shader input. + +#version 150 + +in Block { + vec4 invar; +} a; + +void main() +{ + a.invar = vec4(1.0); + gl_FragColor = a.invar; +} diff --git a/tests/spec/glsl-1.50/compiler/interface-block-instance-name-uniform-read-only.frag b/tests/spec/glsl-1.50/compiler/interface-block-instance-name-uniform-read-only.frag new file mode 100644 index 000..43909ba --- /dev/null +++ b/tests/spec/glsl-1.50/compiler/interface-block-instance-name-uniform-read-only.frag @@ -0,0 +1,20 @@ +// [config] +// expect_result: fail +// glsl_version: 1.50 +// check_link: false +// [end config] +// +// Check that an error is generated when trying +// to change the value of a uniform. + +#version 150 + +uniform Block { + vec4 invar; +} a; + +void main() +{ + a.invar = vec4(1.0); + gl_FragColor = a.invar; +} diff --git a/tests/spec/glsl-1.50/compiler/interface-block-uniform-read-only.frag b/tests/spec/glsl-1.50/compiler/interface-block-uniform-read-only.frag new file mode 100644 index 000..aaea6b3 --- /dev/null +++ b/tests/spec/glsl-1.50/compiler/interface-block-uniform-read-only.frag @@ -0,0 +1,20 @@ +// [config] +// expect_result: fail +// glsl_version: 1.50 +// check_link: false +// [end config] +// +// Check that an error is generated when trying +// to change the value of a uniform. + +#version 150 + +uniform Block { + vec4 invar; +}; + +void main() +{ + invar = vec4(1.0); + gl_FragColor = invar; +} -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 3/3] cl: add atan2pi test
On Wed, 2015-03-25 at 13:33 -0400, Jan Vesely wrote: > tested on clover and intel ocl-sdk > > Signed-off-by: Jan Vesely > --- > generated_tests/gen_cl_math_builtins.py | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git a/generated_tests/gen_cl_math_builtins.py > b/generated_tests/gen_cl_math_builtins.py > index d86b53a..59b7f18 100644 > --- a/generated_tests/gen_cl_math_builtins.py > +++ b/generated_tests/gen_cl_math_builtins.py > @@ -39,6 +39,7 @@ CLC_VERSION_MIN = { > 'asinpi' : 10, > 'atan' : 10, > 'atan2' : 10, > +'atan2pi' : 10, > 'atanh' : 10, > 'atanpi': 10, > 'cbrt' : 10, > @@ -153,6 +154,16 @@ tests = { > ], > 'tolerance' : 6 > }, > +'atan2pi' : { > +'arg_types' : [F, F, F], > +'function_type': 'ttt', > +'values' : [ > +[atan2(0.0, 0.0)/pi, atan2(1.2345, 10.0)/pi, atan2(35671470.0, > 0.1)/pi], # Result > +[0.0, 1.2345, 35671470.0], > # Arg0 > +[0.0, 10.0,0.1 ] > # Arg1 > + Hi, If I remember correctly, atan2 also accepts negative imputs for x and y, and returns the correct angle (remember that tan(x) == tan(x + pi)). Should they be also tested? -Bruno > ], > +'tolerance' : 6 > + }, > 'atanh' : { > 'arg_types' : [F, F], > 'function_type': 'ttt', ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] glsl-1.50: don't do link check in gs-also-uses-smooth-flat-noperspective.geom
From GLSL 1.50 spec, section 4.3.4 "Inputs": "Only the input variables that are actually read need to be written by the previous stage" [...] "Geometry shader input variables get the per-vertex values written out by vertex shader output variables of the same names." As there is not vertex shader that defines the respective output variables, this test should fail when linking. However, as it is checking that smooth and flat interpolation qualifiers are allowed in geometry shaders, this patch disables link checking. Signed-off-by: Samuel Iglesias Gonsalvez --- .../spec/glsl-1.50/compiler/gs-also-uses-smooth-flat-noperspective.geom | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/glsl-1.50/compiler/gs-also-uses-smooth-flat-noperspective.geom b/tests/spec/glsl-1.50/compiler/gs-also-uses-smooth-flat-noperspective.geom index f1ab41e..9eb0d7a 100644 --- a/tests/spec/glsl-1.50/compiler/gs-also-uses-smooth-flat-noperspective.geom +++ b/tests/spec/glsl-1.50/compiler/gs-also-uses-smooth-flat-noperspective.geom @@ -1,7 +1,7 @@ // [config] // expect_result: pass // glsl_version: 1.50 -// check_link: true +// check_link: false // [end config] #version 150 -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 1/4] program_interface_query: add tests for querying the resources
On 03/27/2015 10:12 AM, Martin Peres wrote: On 27/03/15 09:58, Tapani Pälli wrote: Huh, first of all thanks for taking time to add the 'crosschecking' (consistency_check) .. this test has impressive amount of subtests and validation of the results! I did not find any errors from the subtests (excluding that one that should be PROGRAM_INPUT not OUTPUT but that you already fixed, right?). Yes, it is already fixed in my tree and on freedesktop. Some nitpicking and comments on the layout below; I'd give r-b but I want to hear if you will address some of this; On 03/25/2015 06:01 PM, Martin Peres wrote: This tests primarily glGetProgramInterfaceiv in various (potentially tricky) program pipelines. All the calls are supposed to succeed as this test is purely functional. This test requires a OpenGL 3.2 core context but also has optional subtests that depend on the following extensions: - GL_ARB_shader_atomic_counters - GL_ARB_shader_storage_buffer_object - GL_ARB_shader_subroutine - GL_ARB_tessellation_shader - GL_ARB_compute_shader - GL_ARB_shader_image_load_store Signed-off-by: Martin Peres --- tests/all.py | 1 + .../arb_program_interface_query/CMakeLists.gl.txt | 1 + tests/spec/arb_program_interface_query/common.h| 238 +++ .../arb_program_interface_query/resource-query.c | 741 + 4 files changed, 981 insertions(+) mode change 100644 => 100755 tests/all.py mode change 100644 => 100755 tests/spec/arb_program_interface_query/CMakeLists.gl.txt create mode 100755 tests/spec/arb_program_interface_query/common.h create mode 100755 tests/spec/arb_program_interface_query/resource-query.c diff --git a/tests/all.py b/tests/all.py old mode 100644 new mode 100755 index b2266db..f47e198 --- a/tests/all.py +++ b/tests/all.py @@ -2274,6 +2274,7 @@ with profile.group_manager( grouptools.join('spec', 'ARB_program_interface_query')) as g: g(['arb_program_interface_query-resource-location'], run_concurrent=False) g(['arb_program_interface_query-resource-index'], run_concurrent=False) +g(['arb_program_interface_query-resource-query'], run_concurrent=False) # Group ARB_explicit_uniform_location with profile.group_manager( diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt old mode 100644 new mode 100755 index 2028553..9535798 --- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt +++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt @@ -11,3 +11,4 @@ link_libraries ( piglit_add_executable (arb_program_interface_query-resource-location resource-location.c) piglit_add_executable (arb_program_interface_query-resource-index resource-index.c) +piglit_add_executable (arb_program_interface_query-resource-query resource-query.c) diff --git a/tests/spec/arb_program_interface_query/common.h b/tests/spec/arb_program_interface_query/common.h new file mode 100755 index 000..4e5ff01 --- /dev/null +++ b/tests/spec/arb_program_interface_query/common.h @@ -0,0 +1,238 @@ +/* + * Copyright © 2015 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. + */ + +#pragma once +#ifndef __COMMON_H__ +#define __COMMON_H__ + +static const char vs_std[] = +"#version 150\n" +"struct vs_struct {\n" +"vec4 a[2];\n" +"};\n" +"uniform vs_uniform_block {\n" +"vec4 vs_test;\n" +"};\n" +"uniform vs_struct sa[2];\n" +"in vec4 vs_input0;\n" +"in vec4 vs_input1;\n" +"void main() {\n" +"gl_Position = vs_input0 * vs_test * vs_input1 + sa[0].a[1] +" +" sa[1].a[1];\n" +"}"; + +const char gs_std[] = +"#version 150\n" +"layout(triangles) in;\n" +"layout(triangle_strip, max_vertices = 6) out;\n" +"uniform gs_uniform_block {\n" +"vec4 gs_test;\n" +
Re: [Piglit] [PATCH 1/4] program_interface_query: add tests for querying the resources
On 27/03/15 09:58, Tapani Pälli wrote: Huh, first of all thanks for taking time to add the 'crosschecking' (consistency_check) .. this test has impressive amount of subtests and validation of the results! I did not find any errors from the subtests (excluding that one that should be PROGRAM_INPUT not OUTPUT but that you already fixed, right?). Yes, it is already fixed in my tree and on freedesktop. Some nitpicking and comments on the layout below; I'd give r-b but I want to hear if you will address some of this; On 03/25/2015 06:01 PM, Martin Peres wrote: This tests primarily glGetProgramInterfaceiv in various (potentially tricky) program pipelines. All the calls are supposed to succeed as this test is purely functional. This test requires a OpenGL 3.2 core context but also has optional subtests that depend on the following extensions: - GL_ARB_shader_atomic_counters - GL_ARB_shader_storage_buffer_object - GL_ARB_shader_subroutine - GL_ARB_tessellation_shader - GL_ARB_compute_shader - GL_ARB_shader_image_load_store Signed-off-by: Martin Peres --- tests/all.py | 1 + .../arb_program_interface_query/CMakeLists.gl.txt | 1 + tests/spec/arb_program_interface_query/common.h| 238 +++ .../arb_program_interface_query/resource-query.c | 741 + 4 files changed, 981 insertions(+) mode change 100644 => 100755 tests/all.py mode change 100644 => 100755 tests/spec/arb_program_interface_query/CMakeLists.gl.txt create mode 100755 tests/spec/arb_program_interface_query/common.h create mode 100755 tests/spec/arb_program_interface_query/resource-query.c diff --git a/tests/all.py b/tests/all.py old mode 100644 new mode 100755 index b2266db..f47e198 --- a/tests/all.py +++ b/tests/all.py @@ -2274,6 +2274,7 @@ with profile.group_manager( grouptools.join('spec', 'ARB_program_interface_query')) as g: g(['arb_program_interface_query-resource-location'], run_concurrent=False) g(['arb_program_interface_query-resource-index'], run_concurrent=False) +g(['arb_program_interface_query-resource-query'], run_concurrent=False) # Group ARB_explicit_uniform_location with profile.group_manager( diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt old mode 100644 new mode 100755 index 2028553..9535798 --- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt +++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt @@ -11,3 +11,4 @@ link_libraries ( piglit_add_executable (arb_program_interface_query-resource-location resource-location.c) piglit_add_executable (arb_program_interface_query-resource-index resource-index.c) +piglit_add_executable (arb_program_interface_query-resource-query resource-query.c) diff --git a/tests/spec/arb_program_interface_query/common.h b/tests/spec/arb_program_interface_query/common.h new file mode 100755 index 000..4e5ff01 --- /dev/null +++ b/tests/spec/arb_program_interface_query/common.h @@ -0,0 +1,238 @@ +/* + * Copyright © 2015 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. + */ + +#pragma once +#ifndef __COMMON_H__ +#define __COMMON_H__ + +static const char vs_std[] = +"#version 150\n" +"struct vs_struct {\n" +"vec4 a[2];\n" +"};\n" +"uniform vs_uniform_block {\n" +"vec4 vs_test;\n" +"};\n" +"uniform vs_struct sa[2];\n" +"in vec4 vs_input0;\n" +"in vec4 vs_input1;\n" +"void main() {\n" +"gl_Position = vs_input0 * vs_test * vs_input1 + sa[0].a[1] +" +" sa[1].a[1];\n" +"}"; + +const char gs_std[] = +"#version 150\n" +"layout(triangles) in;\n" +"layout(triangle_strip, max_vertices = 6) out;\n" +"uniform gs_uniform_block {\n" +"vec4 gs_test;\n" +"};\n" +
Re: [Piglit] [PATCH 1/4] program_interface_query: add tests for querying the resources
Huh, first of all thanks for taking time to add the 'crosschecking' (consistency_check) .. this test has impressive amount of subtests and validation of the results! I did not find any errors from the subtests (excluding that one that should be PROGRAM_INPUT not OUTPUT but that you already fixed, right?). Some nitpicking and comments on the layout below; I'd give r-b but I want to hear if you will address some of this; On 03/25/2015 06:01 PM, Martin Peres wrote: This tests primarily glGetProgramInterfaceiv in various (potentially tricky) program pipelines. All the calls are supposed to succeed as this test is purely functional. This test requires a OpenGL 3.2 core context but also has optional subtests that depend on the following extensions: - GL_ARB_shader_atomic_counters - GL_ARB_shader_storage_buffer_object - GL_ARB_shader_subroutine - GL_ARB_tessellation_shader - GL_ARB_compute_shader - GL_ARB_shader_image_load_store Signed-off-by: Martin Peres --- tests/all.py | 1 + .../arb_program_interface_query/CMakeLists.gl.txt | 1 + tests/spec/arb_program_interface_query/common.h| 238 +++ .../arb_program_interface_query/resource-query.c | 741 + 4 files changed, 981 insertions(+) mode change 100644 => 100755 tests/all.py mode change 100644 => 100755 tests/spec/arb_program_interface_query/CMakeLists.gl.txt create mode 100755 tests/spec/arb_program_interface_query/common.h create mode 100755 tests/spec/arb_program_interface_query/resource-query.c diff --git a/tests/all.py b/tests/all.py old mode 100644 new mode 100755 index b2266db..f47e198 --- a/tests/all.py +++ b/tests/all.py @@ -2274,6 +2274,7 @@ with profile.group_manager( grouptools.join('spec', 'ARB_program_interface_query')) as g: g(['arb_program_interface_query-resource-location'], run_concurrent=False) g(['arb_program_interface_query-resource-index'], run_concurrent=False) +g(['arb_program_interface_query-resource-query'], run_concurrent=False) # Group ARB_explicit_uniform_location with profile.group_manager( diff --git a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt old mode 100644 new mode 100755 index 2028553..9535798 --- a/tests/spec/arb_program_interface_query/CMakeLists.gl.txt +++ b/tests/spec/arb_program_interface_query/CMakeLists.gl.txt @@ -11,3 +11,4 @@ link_libraries ( piglit_add_executable (arb_program_interface_query-resource-location resource-location.c) piglit_add_executable (arb_program_interface_query-resource-index resource-index.c) +piglit_add_executable (arb_program_interface_query-resource-query resource-query.c) diff --git a/tests/spec/arb_program_interface_query/common.h b/tests/spec/arb_program_interface_query/common.h new file mode 100755 index 000..4e5ff01 --- /dev/null +++ b/tests/spec/arb_program_interface_query/common.h @@ -0,0 +1,238 @@ +/* + * Copyright © 2015 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. + */ + +#pragma once +#ifndef __COMMON_H__ +#define __COMMON_H__ + +static const char vs_std[] = + "#version 150\n" + "struct vs_struct {\n" + " vec4 a[2];\n" + "};\n" + "uniform vs_uniform_block {\n" + " vec4 vs_test;\n" + "};\n" + "uniform vs_struct sa[2];\n" + "in vec4 vs_input0;\n" + "in vec4 vs_input1;\n" + "void main() {\n" + " gl_Position = vs_input0 * vs_test * vs_input1 + sa[0].a[1] +" + "sa[1].a[1];\n" + "}"; + +const char gs_std[] = + "#version 150\n" + "layout(triangles) in;\n" + "layout(triangle_strip, max_vertices = 6) out;\n" + "uniform gs_uniform_block {\n" + " vec4 gs_test;\n" + "};\n" + "in vec4 gs_input[3];\n" + "out vec4 gs_output0;\n" + "vo
[Piglit] [PATCH] glsl-es-1.00: add constant-index-expression indexing test with struct
This test fails with current Mesa HEAD (6264348), see bug https://bugs.freedesktop.org/show_bug.cgi?id=84225. Signed-off-by: Tapani Pälli --- .../struct-sampler-array-index.frag| 42 ++ 1 file changed, 42 insertions(+) create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/struct-sampler-array-index.frag diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/struct-sampler-array-index.frag b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/struct-sampler-array-index.frag new file mode 100644 index 000..122a8a4 --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/struct-sampler-array-index.frag @@ -0,0 +1,42 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.00 + * [end config] + * + * From "Appendix A" of the GLSL ES 1.00 spec: + * + * "GLSL ES 1.00 supports both arrays of samplers and arrays of + * structures which contain samplers. In both these cases, for + * ES 2.0, support for indexing with a constant-index-expression + * is mandated" + * + * For additional complexity this test has array of structures + * that has array of samplers. + * + */ +#version 100 + +struct s_t +{ + sampler2D array[1]; + sampler2D foo; +}; + +uniform s_t array[1]; + +void main() +{ + highp vec4 color; + + // case 1, sampler in array of structs + for (int i = 0; i < 2; i++) { + color += texture2D(array[i].foo, vec2(0.0)); + } + + // case 2, index sampler array in array of structs + for (int i = 0; i < 2; i++) { + color += texture2D(array[i].array[i], vec2(0.0)); + } + + gl_FragColor = color; +} -- 2.1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] glsl-es-1.00: add test for constant-index-expression indexing
On 03/27/2015 09:02 AM, Matt Turner wrote: On Thu, Mar 26, 2015 at 11:49 PM, Tapani Pälli wrote: This test fails with current Mesa HEAD (6264348), see bug https://bugs.freedesktop.org/show_bug.cgi?id=84225. Signed-off-by: Tapani Pälli --- .../sampler-array-index.frag | 24 ++ 1 file changed, 24 insertions(+) create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag new file mode 100644 index 000..08ed68d --- /dev/null +++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag @@ -0,0 +1,24 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.00 + * [end config] + * + * From "Appendix A" of the GLSL ES 1.00 spec: + * + * "GLSL ES 1.00 supports both arrays of samplers and arrays of + * structures which contain samplers. In both these cases, for + * ES 2.0, support for indexing with a constant-index-expression + * is mandated" + * + */ +#version 100 +uniform sampler2D array[1]; + +void main() +{ + highp vec4 color; + for (int i = 0; i < 2; i++) { + color += texture2D(array[i], vec2(0.0)); + } + gl_FragColor = color; +} -- 2.1.0 This looks good, but could you also add a test for an array of structures that contain samplers? Sure, I'll add this case too. Reviewed-by: Matt Turner Thanks; // Tapani ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] glsl-es-1.00: add test for constant-index-expression indexing
On Thu, Mar 26, 2015 at 11:49 PM, Tapani Pälli wrote: > This test fails with current Mesa HEAD (6264348), see bug > https://bugs.freedesktop.org/show_bug.cgi?id=84225. > > Signed-off-by: Tapani Pälli > --- > .../sampler-array-index.frag | 24 > ++ > 1 file changed, 24 insertions(+) > create mode 100644 > tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag > > diff --git > a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag > > b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag > new file mode 100644 > index 000..08ed68d > --- /dev/null > +++ > b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/sampler-array-index.frag > @@ -0,0 +1,24 @@ > +/* [config] > + * expect_result: pass > + * glsl_version: 1.00 > + * [end config] > + * > + * From "Appendix A" of the GLSL ES 1.00 spec: > + * > + * "GLSL ES 1.00 supports both arrays of samplers and arrays of > + * structures which contain samplers. In both these cases, for > + * ES 2.0, support for indexing with a constant-index-expression > + * is mandated" > + * > + */ > +#version 100 > +uniform sampler2D array[1]; > + > +void main() > +{ > + highp vec4 color; > + for (int i = 0; i < 2; i++) { > + color += texture2D(array[i], vec2(0.0)); > + } > + gl_FragColor = color; > +} > -- > 2.1.0 This looks good, but could you also add a test for an array of structures that contain samplers? Reviewed-by: Matt Turner ___ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit