[Mesa-dev] [PATCH 1/6] main: fix TOP_LEVEL_ARRAY_SIZE and TOP_LEVEL_ARRAY_STRIDE

Tapani Pälli tapani.palli at intel.com
Fri Oct 2 00:25:57 PDT 2015


These patches fix ES31-CTS.shader_storage_buffer_object.*matrixOp*
(from 6/14 to 14/14 passing)

Tested-by: Tapani Pälli <tapani.palli at intel.com>

On 10/02/2015 10:13 AM, Samuel Iglesias Gonsalvez wrote:
> When the active variable is an array which is already a top-level
> shader storage block member, don't return its array size and stride
> when querying TOP_LEVEL_ARRAY_SIZE and TOP_LEVEL_ARRAY_STRIDE
> respectively.
>
> Fixes the following 12 dEQP-GLES31 tests:
>
> dEQP-GLES31.functional.ssbo.layout.single_basic_array.shared.mat3x4
> dEQP-GLES31.functional.ssbo.layout.single_basic_array.shared.row_major_mat3x4
> dEQP-GLES31.functional.ssbo.layout.single_basic_array.shared.column_major_mat3x4
> dEQP-GLES31.functional.ssbo.layout.single_basic_array.packed.mat3x4
> dEQP-GLES31.functional.ssbo.layout.single_basic_array.packed.row_major_mat3x4
> dEQP-GLES31.functional.ssbo.layout.single_basic_array.packed.column_major_mat3x4
> dEQP-GLES31.functional.ssbo.layout.single_basic_array.std140.mat3x4
> dEQP-GLES31.functional.ssbo.layout.single_basic_array.std140.row_major_mat3x4
> dEQP-GLES31.functional.ssbo.layout.single_basic_array.std140.column_major_mat3x4
> dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.mat3x4
> dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.row_major_mat3x4
> dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.column_major_mat3x4
>
> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
> ---
>
> I am not very sure about this change, ARB_program_interface query
> doesn't clarify this case:
>
> "For the property TOP_LEVEL_ARRAY_SIZE, a single integer identifying
>   the number of active array elements of the top-level shader storage
>   block member containing to the active variable is written to <params>"
>
> "For the property TOP_LEVEL_ARRAY_STRIDE, a single integer identifying
>   the stride between array elements of the top-level shader storage
>   block member containing the active variable is written to <params>."
>
> Ian, What do you think?
>
>   src/mesa/main/shader_query.cpp | 16 +++++++++++++++-
>   1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp
> index 7189676..e6d93c3 100644
> --- a/src/mesa/main/shader_query.cpp
> +++ b/src/mesa/main/shader_query.cpp
> @@ -921,12 +921,18 @@ program_resource_top_level_array_size(struct gl_shader_program *shProg,
>                * the top-level block member is an array with no declared size,
>                * the value zero is written to <params>.
>                */
> -            if (field->type->is_unsized_array())
> +            /* If the given variable is already a top-level shader storage
> +             * block member, then return array_size = 1.
> +             */
> +            if (strcmp(name, var_name) == 0)
> +               array_size = 1;
> +            else if (field->type->is_unsized_array())
>                  array_size = 0;
>               else if (field->type->is_array())
>                  array_size = field->type->length;
>               else
>                  array_size = 1;
> +
>               goto found_top_level_array_size;
>            }
>         }
> @@ -995,6 +1001,14 @@ program_resource_top_level_array_stride(struct gl_shader_program *shProg,
>                  bool row_major = matrix_layout == GLSL_MATRIX_LAYOUT_ROW_MAJOR;
>                  const glsl_type *array_type = field->type->fields.array;
>
> +               /* If the given variable is already a top-level shader storage
> +                * block member, then return array_stride = 0.
> +                */
> +               if (strcmp(name, var_name) == 0) {
> +                  array_stride = 0;
> +                  goto found_top_level_array_size;
> +               }
> +
>                  if (interface->interface_packing != GLSL_INTERFACE_PACKING_STD430) {
>                     if (array_type->is_record()) {
>                        array_stride = array_type->std140_size(row_major);
>


More information about the mesa-dev mailing list