vkd3d: Enable per component robustness on AMD.

Tested and verified to work as expected, not so much on NV.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
Hans-Kristian Arntzen 2021-11-09 13:15:46 +01:00
parent 3210832ad9
commit b53a4a98a6
2 changed files with 12 additions and 1 deletions

View File

@ -5591,6 +5591,17 @@ static void vkd3d_init_shader_extensions(struct d3d12_device *device)
{
device->vk_info.shader_extensions[device->vk_info.shader_extension_count++] =
VKD3D_SHADER_TARGET_EXTENSION_SCALAR_BLOCK_LAYOUT;
if (device->device_info.properties2.properties.vendorID == VKD3D_VENDOR_ID_AMD)
{
/* Raw load-store instructions on AMD are bounds checked correctly per component.
* In other cases, we must be careful when emitting byte address buffers and block
* any attempt to vectorize vec3.
* We can still vectorize vec3 structured buffers however as long as SCALAR_BLOCK_LAYOUT
* is supported. */
device->vk_info.shader_extensions[device->vk_info.shader_extension_count++] =
VKD3D_SHADER_TARGET_EXTENSION_ASSUME_PER_COMPONENT_SSBO_ROBUSTNESS;
}
}
}

View File

@ -49,7 +49,7 @@
#define MAKE_MAGIC(a,b,c,d) (((uint32_t)a) | (((uint32_t)b) << 8) | (((uint32_t)c) << 16) | (((uint32_t)d) << 24))
#define VKD3D_MAX_COMPATIBLE_FORMAT_COUNT 6u
#define VKD3D_MAX_SHADER_EXTENSIONS 5u
#define VKD3D_MAX_SHADER_EXTENSIONS 6u
#define VKD3D_MAX_SHADER_STAGES 5u
#define VKD3D_MAX_VK_SYNC_OBJECTS 4u