glsl: respect GL_EXT_shader_image_load_formatted when image is embedded in a struct
Fix compilation failure when image is embedded in struct when
GL_EXT_shader_image_load_formatted is enabled:
struct GpuPointShadow {
image2D RayTracedShadowMapImage;
};
layout(std140, binding = 2) uniform ShadowsUBO {
GpuPointShadow PointShadows[1];
} shadowsUBO;
Compile log:
error: image not qualified with `writeonly' must have a format layout qualifier
Fixes: 082d180a22
("mesa, glsl: add support for EXT_shader_image_load_formatted")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29693>
This commit is contained in:
@@ -7902,7 +7902,11 @@ ast_process_struct_or_iface_block_members(exec_list *instructions,
|
||||
|
||||
fields[i].image_format = qual->image_format;
|
||||
} else {
|
||||
if (!qual->flags.q.write_only) {
|
||||
if (state->has_image_load_formatted()) {
|
||||
if (state->EXT_shader_image_load_formatted_warn) {
|
||||
_mesa_glsl_warning(&loc, state, "GL_EXT_image_load_formatted used");
|
||||
}
|
||||
} else if (!qual->flags.q.write_only) {
|
||||
_mesa_glsl_error(&loc, state, "image not qualified with "
|
||||
"`writeonly' must have a format layout "
|
||||
"qualifier");
|
||||
|
Reference in New Issue
Block a user