[Mesa-dev] [PATCH 1/3] nir: Get the number of SSBOs and UBOs right

Jason Ekstrand jason at jlekstrand.net
Thu Oct 15 08:06:53 PDT 2015


On Thu, Oct 15, 2015 at 12:18 AM, Iago Toral Quiroga <itoral at igalia.com> wrote:
> Before d31f98a272e429d and 56e2bdbca36a20 we had a sigle index space for UBOs
> and SSBOs, so NumBufferInterfaceBlocks would contain the combined number of
> blocks, not just one kind. This means that for shader programs using both
> UBOs and SSBOs, we were setting num_ssbos and num_ubos to a larger number than
> we should. Since the above commits  we have separate index spaces for each
> so we can just get the right numbers.

Shouldn't this patch go after the other two?  It seems like once we
have this patch, we'll no longer be marking the right number of UBO's
as used (as per the other two) but since NumBufferInterfaceBlocks is
probably bigger than NumShaderStorageBlocks, it should be safe to do
the other two first.

In any case, all three are

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

> ---
>  src/glsl/nir/glsl_to_nir.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
> index 6f67b1d..b705f66 100644
> --- a/src/glsl/nir/glsl_to_nir.cpp
> +++ b/src/glsl/nir/glsl_to_nir.cpp
> @@ -152,9 +152,9 @@ glsl_to_nir(const struct gl_shader_program *shader_prog,
>
>     shader->info.name = ralloc_asprintf(shader, "GLSL%d", sh->Name);
>     shader->info.num_textures = num_textures;
> -   shader->info.num_ubos = sh->NumBufferInterfaceBlocks;
> +   shader->info.num_ubos = sh->NumUniformBlocks;
>     shader->info.num_abos = shader_prog->NumAtomicBuffers;
> -   shader->info.num_ssbos = shader_prog->NumBufferInterfaceBlocks;
> +   shader->info.num_ssbos = sh->NumShaderStorageBlocks;
>     shader->info.num_images = sh->NumImages;
>     shader->info.inputs_read = sh->Program->InputsRead;
>     shader->info.outputs_written = sh->Program->OutputsWritten;
> --
> 1.9.1
>


More information about the mesa-dev mailing list