summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/link_uniforms.cpp
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-08-16 14:31:28 -0500
committerJason Ekstrand <[email protected]>2018-08-29 14:04:02 -0500
commit48e4fa7dd8c4b777989c4a731d6ac54cfe6c24eb (patch)
tree77c34d4c05d012072f410f406475f07db8428e57 /src/compiler/glsl/link_uniforms.cpp
parent42891438990ce170a2ce08f71a1360842d5897a1 (diff)
glsl/link,i965: Make ImageAccess four-state
The GLSL spec allows you to set both the "readonly" and "writeonly" qualifiers on images to indicate that it can only be used with imageSize. However, we had no way of representing this int he linked shader and flagged it as GL_READ_ONLY. This is good from a "does it use this buffer?" perspective but not from a format and access lowering perspective. By using GL_NONE for if "readonly" and "writeonly" are both set, we can detect this case in the driver and handle it correctly. Nothing currently relies on the type of surface in the "readonly" + "writeonly" case but that's about to change. i965 is the only drier which uses the ImageAccess field and gl_bindless_image::access is currently unused. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl/link_uniforms.cpp')
-rw-r--r--src/compiler/glsl/link_uniforms.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index 434ecefb289..63e688b19a7 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -690,9 +690,11 @@ private:
/* Set image access qualifiers */
const GLenum access =
- (current_var->data.memory_read_only ? GL_READ_ONLY :
- current_var->data.memory_write_only ? GL_WRITE_ONLY :
- GL_READ_WRITE);
+ current_var->data.memory_read_only ?
+ (current_var->data.memory_write_only ? GL_NONE :
+ GL_READ_ONLY) :
+ (current_var->data.memory_write_only ? GL_WRITE_ONLY :
+ GL_READ_WRITE);
if (current_var->data.bindless) {
if (!set_opaque_indices(base_type, uniform, name,