mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader: Introduce DESCRIPTOR_INFO_FLAG_UAV_ATOMICS and always declare UAV images with known type for atomic ops.
Atomic ops on images with Unknown type will cause SPIR-V validation failure, and assertion failure in Mesa debug builds. D3D12 allows atomics on typed buffers, and this requires a distinction to be made between UAV reads and atomic ops. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53874
This commit is contained in:
committed by
Alexandre Julliard
parent
fc652d2b27
commit
1b11b57652
Notes:
Alexandre Julliard
2022-11-21 22:45:52 +01:00
Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/49
@@ -5864,9 +5864,9 @@ static uint32_t spirv_compiler_get_image_type_id(struct spirv_compiler *compiler
|
||||
{
|
||||
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
|
||||
const struct vkd3d_shader_descriptor_info *d;
|
||||
bool uav_read, uav_atomics;
|
||||
uint32_t sampled_type_id;
|
||||
SpvImageFormat format;
|
||||
bool uav_read;
|
||||
|
||||
format = SpvImageFormatUnknown;
|
||||
if (reg->type == VKD3DSPR_UAV)
|
||||
@@ -5874,7 +5874,8 @@ static uint32_t spirv_compiler_get_image_type_id(struct spirv_compiler *compiler
|
||||
d = spirv_compiler_get_descriptor_info(compiler,
|
||||
VKD3D_SHADER_DESCRIPTOR_TYPE_UAV, range);
|
||||
uav_read = !!(d->flags & VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_UAV_READ);
|
||||
if (raw_structured || (uav_read && !compiler->uav_read_without_format))
|
||||
uav_atomics = !!(d->flags & VKD3D_SHADER_DESCRIPTOR_INFO_FLAG_UAV_ATOMICS);
|
||||
if (raw_structured || uav_atomics || (uav_read && !compiler->uav_read_without_format))
|
||||
format = image_format_for_image_read(data_type);
|
||||
else if (uav_read)
|
||||
vkd3d_spirv_enable_capability(builder, SpvCapabilityStorageImageReadWithoutFormat);
|
||||
|
Reference in New Issue
Block a user