[Mesa-dev] [PATCH] glsl: set correct packing for uniform block arrays

Timothy Arceri t_arceri at yahoo.com.au
Thu Sep 3 06:37:39 PDT 2015


On Thu, 2015-09-03 at 23:23 +1000, Timothy Arceri wrote:
> Looks like an oversight from when this was originally added. Before this
> change it would always end up as std140.

Note this now means linking will fail if the layout qualifier differs between
shaders. The spec only says "having the same member-wise layout qualification"
and the Nvidia binary doesnt fail for this case.

I've got a piglit test for this case, should I send it? Is member-wise meant
to imply the block layout should match also? Or are we just doing this check
because it makes sense?

> 
> Cc: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/glsl/link_uniform_blocks.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/glsl/link_uniform_blocks.cpp
> b/src/glsl/link_uniform_blocks.cpp
> index 4df39e2..5bd5a26 100644
> --- a/src/glsl/link_uniform_blocks.cpp
> +++ b/src/glsl/link_uniform_blocks.cpp
> @@ -283,7 +283,7 @@ link_uniform_blocks(void *mem_ctx,
>  
>              blocks[i].UniformBufferSize = 0;
>              blocks[i]._Packing =
> -               gl_uniform_block_packing(block_type->interface_packing);
> +               gl_uniform_block_packing(block_type->fields.array
> ->interface_packing);
>  
>              parcel.process(block_type->fields.array,
>                             blocks[i].Name);


More information about the mesa-dev mailing list