[Mesa-dev] [PATCH 23/26] nir/linker: add program ubo/ssbo at the resource list

Alejandro PiƱeiro apinheiro at igalia.com
Sat Sep 15 16:18:46 UTC 2018


---
 src/compiler/glsl/gl_nir_linker.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c
index 547549bc4e0..138a12e532d 100644
--- a/src/compiler/glsl/gl_nir_linker.c
+++ b/src/compiler/glsl/gl_nir_linker.c
@@ -67,5 +67,19 @@ nir_build_program_resource_list(struct gl_context *ctx,
    }
 
 
+   /* Add program uniform blocks. */
+   for (unsigned i = 0; i < prog->data->NumUniformBlocks; i++) {
+      if (!link_util_add_program_resource(prog, resource_set, GL_UNIFORM_BLOCK,
+                                          &prog->data->UniformBlocks[i], 0))
+         return;
+   }
+
+   /* Add program shader storage blocks. */
+   for (unsigned i = 0; i < prog->data->NumShaderStorageBlocks; i++) {
+      if (!link_util_add_program_resource(prog, resource_set, GL_SHADER_STORAGE_BLOCK,
+                                          &prog->data->ShaderStorageBlocks[i], 0))
+         return;
+   }
+
    _mesa_set_destroy(resource_set, NULL);
 }
-- 
2.14.1



More information about the mesa-dev mailing list