summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/linker_util.h
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2019-04-29 16:37:42 +1000
committerTimothy Arceri <[email protected]>2019-05-23 15:06:20 +1000
commita482cf6ab27aef30ec8caaea5b734504ffaa28d9 (patch)
tree5c04b806bf37a7ea11e801467b9760e30dca1e79 /src/compiler/glsl/linker_util.h
parent96c2851586e8d76397823624321d5d24b3d22b36 (diff)
glsl: simplify resource list building code
This greatly simplifies the code to calculate if we should add a buffer to the resource list. This uses the spec rules and simple math to decide if we should add the buffer rather than complex string processing. This patch refines a patch present in the ARB_gl_spriv merge request for the NIR linker and applies it to the GLSL IR linker. This is why we also move the function to the shared linker code, because we will want to reuse the code for the NIR linker also. Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/compiler/glsl/linker_util.h')
-rw-r--r--src/compiler/glsl/linker_util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/glsl/linker_util.h b/src/compiler/glsl/linker_util.h
index 1c3674f35a5..20a7b97527a 100644
--- a/src/compiler/glsl/linker_util.h
+++ b/src/compiler/glsl/linker_util.h
@@ -51,6 +51,14 @@ void
linker_warning(struct gl_shader_program *prog, const char *fmt, ...);
bool
+link_util_should_add_buffer_variable(struct gl_shader_program *prog,
+ struct gl_uniform_storage *uniform,
+ int top_level_array_base_offset,
+ int top_level_array_size_in_bytes,
+ int second_element_offset,
+ int block_index);
+
+bool
link_util_add_program_resource(struct gl_shader_program *prog,
struct set *resource_set,
GLenum type, const void *data, uint8_t stages);