[Piglit] [PATCH] builtin_packing: Add swizzles to the sources of packing functions
Ian Romanick
idr at freedesktop.org
Wed Oct 10 18:45:03 UTC 2018
These changes look good, but I'm wondering why. :) Did you find some
bug, or ... ?
On 10/04/2018 10:42 AM, Jason Ekstrand wrote:
> ---
> .../fs_pack.shader_test.mako | 14 +++++++++++---
> .../fs_unpack.shader_test.mako | 6 +++---
> .../vs_pack.shader_test.mako | 14 +++++++++++---
> .../vs_unpack.shader_test.mako | 6 +++---
> 4 files changed, 28 insertions(+), 12 deletions(-)
>
> diff --git a/generated_tests/templates/gen_builtin_packing_tests/fs_pack.shader_test.mako b/generated_tests/templates/gen_builtin_packing_tests/fs_pack.shader_test.mako
> index 4c053bf89..86c63061e 100644
> --- a/generated_tests/templates/gen_builtin_packing_tests/fs_pack.shader_test.mako
> +++ b/generated_tests/templates/gen_builtin_packing_tests/fs_pack.shader_test.mako
> @@ -21,7 +21,7 @@ precision highp float;
> const vec4 red = vec4(1, 0, 0, 1);
> const vec4 green = vec4(0, 1, 0, 1);
>
> -uniform ${func.vector_type} func_input;
> +uniform vec4 func_input;
>
> % for i in range(func.num_valid_outputs):
> uniform ${func.result_precision} uint expect${i};
> @@ -31,7 +31,11 @@ out vec4 frag_color;
>
> void main()
> {
> - ${func.result_precision} uint actual = ${func.name}(func_input);
> +% if func.vector_type == 'vec2':
> + ${func.result_precision} uint actual = ${func.name}(func_input.wx);
> +% else:
> + ${func.result_precision} uint actual = ${func.name}(func_input.wxzy);
> +% endif
>
> if (false
> % for i in range(func.num_valid_outputs):
> @@ -53,7 +57,11 @@ vertex/float/2
>
> [test]
> % for io in func.inout_seq:
> -uniform ${func.vector_type} func_input ${" ".join(io.input)}
> +% if func.vector_type == 'vec2':
> +uniform vec4 func_input ${io.input[1]} 0.0 0.0 ${io.input[0]}
> +% else:
> +uniform vec4 func_input ${io.input[1]} ${io.input[3]} ${io.input[2]} ${io.input[0]}
> +% endif
> % for i in range(func.num_valid_outputs):
> uniform uint expect${i} ${io.valid_outputs[i]}
> % endfor
> diff --git a/generated_tests/templates/gen_builtin_packing_tests/fs_unpack.shader_test.mako b/generated_tests/templates/gen_builtin_packing_tests/fs_unpack.shader_test.mako
> index ee610bbfb..8e3f12a58 100644
> --- a/generated_tests/templates/gen_builtin_packing_tests/fs_unpack.shader_test.mako
> +++ b/generated_tests/templates/gen_builtin_packing_tests/fs_unpack.shader_test.mako
> @@ -21,7 +21,7 @@ precision highp float;
> const vec4 red = vec4(1, 0, 0, 1);
> const vec4 green = vec4(0, 1, 0, 1);
>
> -uniform highp uint func_input;
> +uniform highp uvec4 func_input;
>
> uniform bool exact;
>
> @@ -33,7 +33,7 @@ out vec4 frag_color;
>
> void main()
> {
> - ${func.result_precision} ${func.vector_type} actual = ${func.name}(func_input);
> + ${func.result_precision} ${func.vector_type} actual = ${func.name}(func_input.y);
>
> if (false
> % for i in range(func.num_valid_outputs):
> @@ -56,7 +56,7 @@ vertex/float/2
>
> [test]
> % for io in func.inout_seq:
> -uniform uint func_input ${io.input}
> +uniform uvec4 func_input 0 ${io.input} 0 0
> % if func.exact:
> uniform int exact 1
> % else:
> diff --git a/generated_tests/templates/gen_builtin_packing_tests/vs_pack.shader_test.mako b/generated_tests/templates/gen_builtin_packing_tests/vs_pack.shader_test.mako
> index 5f37d7eaf..81c725846 100644
> --- a/generated_tests/templates/gen_builtin_packing_tests/vs_pack.shader_test.mako
> +++ b/generated_tests/templates/gen_builtin_packing_tests/vs_pack.shader_test.mako
> @@ -11,7 +11,7 @@ ${func.requirements}
> const vec4 red = vec4(1, 0, 0, 1);
> const vec4 green = vec4(0, 1, 0, 1);
>
> -uniform ${func.vector_type} func_input;
> +uniform vec4 func_input;
>
> % for j in range(func.num_valid_outputs):
> uniform ${func.result_precision} uint expect${j};
> @@ -23,7 +23,11 @@ out vec4 vert_color;
> void main()
> {
> gl_Position = vertex;
> - ${func.result_precision} uint actual = ${func.name}(func_input);
> +% if func.vector_type == 'vec2':
> + ${func.result_precision} uint actual = ${func.name}(func_input.zy);
> +% else:
> + ${func.result_precision} uint actual = ${func.name}(func_input.wyzx);
> +% endif
>
> if (false
> % for j in range(func.num_valid_outputs):
> @@ -58,7 +62,11 @@ vertex/float/2
>
> [test]
> % for io in func.inout_seq:
> -uniform ${func.vector_type} func_input ${" ".join(io.input)}
> +% if func.vector_type == 'vec2':
> +uniform vec4 func_input 0.0 ${io.input[1]} ${io.input[0]} 0.0
> +% else:
> +uniform vec4 func_input ${io.input[3]} ${io.input[1]} ${io.input[2]} ${io.input[0]}
> +% endif
> % for j in range(func.num_valid_outputs):
> uniform uint expect${j} ${io.valid_outputs[j]}
> % endfor
> diff --git a/generated_tests/templates/gen_builtin_packing_tests/vs_unpack.shader_test.mako b/generated_tests/templates/gen_builtin_packing_tests/vs_unpack.shader_test.mako
> index 5f2a39125..c14fd35a0 100644
> --- a/generated_tests/templates/gen_builtin_packing_tests/vs_unpack.shader_test.mako
> +++ b/generated_tests/templates/gen_builtin_packing_tests/vs_unpack.shader_test.mako
> @@ -11,7 +11,7 @@ ${func.requirements}
> const vec4 red = vec4(1, 0, 0, 1);
> const vec4 green = vec4(0, 1, 0, 1);
>
> -uniform highp uint func_input;
> +uniform highp uvec4 func_input;
>
> uniform bool exact;
>
> @@ -26,7 +26,7 @@ void main()
> {
> gl_Position = vertex;
>
> - ${func.result_precision} ${func.vector_type} actual = ${func.name}(func_input);
> + ${func.result_precision} ${func.vector_type} actual = ${func.name}(func_input.z);
>
> if (false
> % for i in range(func.num_valid_outputs):
> @@ -61,7 +61,7 @@ vertex/float/2
>
> [test]
> % for io in func.inout_seq:
> -uniform uint func_input ${io.input}
> +uniform uvec4 func_input 0 0 ${io.input} 0
> % if func.exact:
> uniform int exact 1
> % else:
>
More information about the Piglit
mailing list