diff options
author | Samuel Iglesias Gonsalvez <[email protected]> | 2015-05-06 08:11:02 +0200 |
---|---|---|
committer | Samuel Iglesias Gonsalvez <[email protected]> | 2015-09-25 08:39:23 +0200 |
commit | 9b477ad49d3f82503a1b8ba23dedfc05cd848fe8 (patch) | |
tree | b446e9e00b8ed22c73d6b80a0e152fd4dd491b7f /src/glsl/linker.cpp | |
parent | 0f18945cb612493d787377d8cbb138c18738f683 (diff) |
main: Add SHADER_STORAGE_BLOCK and BUFFER_VARIABLE support for ARB_program_interface_query
Including TOP_LEVEL_ARRAY_SIZE and TOP_LEVEL_ARRAY_STRIDE queries.
v2:
- Use std430_array_stride() to get top level array stride following std430's rules.
Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/glsl/linker.cpp')
-rw-r--r-- | src/glsl/linker.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index aebf2560dab..9d419ac9d39 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -3406,14 +3406,18 @@ build_program_resource_list(struct gl_shader_program *shProg) } } - if (!add_program_resource(shProg, GL_UNIFORM, + bool is_shader_storage = shProg->UniformStorage[i].is_shader_storage; + GLenum type = is_shader_storage ? GL_BUFFER_VARIABLE : GL_UNIFORM; + if (!add_program_resource(shProg, type, &shProg->UniformStorage[i], stageref)) return; } - /* Add program uniform blocks. */ + /* Add program uniform blocks and shader storage blocks. */ for (unsigned i = 0; i < shProg->NumUniformBlocks; i++) { - if (!add_program_resource(shProg, GL_UNIFORM_BLOCK, + bool is_shader_storage = shProg->UniformBlocks[i].IsShaderStorage; + GLenum type = is_shader_storage ? GL_SHADER_STORAGE_BLOCK : GL_UNIFORM_BLOCK; + if (!add_program_resource(shProg, type, &shProg->UniformBlocks[i], 0)) return; } |