libs/vkd3d-shader: Emit NonReadable decoration for image variables.

Fixes image writes for UNORM formats on Anv. Anv uses special surface
state for write-only storage image descriptors.

The SPIR-V spec doesn't state that the NonReadable decoration is
required for images used with StorageImageWriteWithoutFormat. On the
other hand, glslang requires the 'writeonly' keyword for images without
format, and it emits the NonReadable decoration.
This commit is contained in:
Józef Kucia 2017-09-26 10:37:41 +02:00
parent 2323c36fbd
commit e7aa2a7bcf

View File

@ -3248,6 +3248,9 @@ static void vkd3d_dxbc_compiler_emit_resource_declaration(struct vkd3d_dxbc_comp
vkd3d_dxbc_compiler_emit_register_debug_name(builder, var_id, reg);
if (is_uav && !(scan_info->uav_read_mask & (1u << reg->idx[0].offset)))
vkd3d_spirv_build_op_decorate(builder, var_id, SpvDecorationNonReadable, NULL, 0);
if (is_uav && (scan_info->uav_counter_mask & (1u << reg->idx[0].offset)))
{
assert(structure_stride); /* counters are valid only for structured buffers */