diff --git a/src/amd/vulkan/layers/radv_no_mans_sky.c b/src/amd/vulkan/layers/radv_no_mans_sky.c new file mode 100644 index 00000000000..024afeacad8 --- /dev/null +++ b/src/amd/vulkan/layers/radv_no_mans_sky.c @@ -0,0 +1,35 @@ +/* + * Copyright © 2025 Valve Corporation + * + * SPDX-License-Identifier: MIT + */ + +#include "radv_device.h" +#include "radv_entrypoints.h" +#include "radv_image_view.h" + +VKAPI_ATTR VkResult VKAPI_CALL +no_mans_sky_CreateImageView(VkDevice _device, const VkImageViewCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, VkImageView *pView) +{ + VK_FROM_HANDLE(radv_device, device, _device); + VkResult result; + + result = device->layer_dispatch.app.CreateImageView(_device, pCreateInfo, pAllocator, pView); + if (result != VK_SUCCESS) + return result; + + VK_FROM_HANDLE(radv_image_view, iview, *pView); + + if ((iview->vk.aspects == (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) && + (iview->vk.usage & + (VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT))) { + /* No Man's Sky creates descriptors with depth/stencil aspects (only when Intel XESS is + * enabled apparently). and this is illegal in Vulkan. Ignore them by using NULL descriptors + * to workaroud GPU hangs. + */ + memset(&iview->descriptor, 0, sizeof(iview->descriptor)); + } + + return result; +} diff --git a/src/amd/vulkan/meson.build b/src/amd/vulkan/meson.build index fa8a8be1140..78b19aaa7a3 100644 --- a/src/amd/vulkan/meson.build +++ b/src/amd/vulkan/meson.build @@ -21,6 +21,7 @@ radv_entrypoints_gen_command += [ '--device-prefix', 'metro_exodus', '--device-prefix', 'rage2', '--device-prefix', 'quantic_dream', + '--device-prefix', 'no_mans_sky', # Command buffer annotation layer entrypoints '--device-prefix', 'annotate', @@ -40,6 +41,7 @@ libradv_files = files( 'layers/radv_metro_exodus.c', 'layers/radv_rage2.c', 'layers/radv_quantic_dream.c', + 'layers/radv_no_mans_sky.c', 'layers/radv_rmv_layer.c', 'layers/radv_rra_layer.c', 'layers/radv_sqtt_layer.c', diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 2d6408b0593..a97bcb490d8 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -792,6 +792,8 @@ init_dispatch_tables(struct radv_device *device, struct radv_physical_device *pd add_entrypoints(&b, &rage2_device_entrypoints, RADV_APP_DISPATCH_TABLE); } else if (!strcmp(instance->drirc.debug.app_layer, "quanticdream")) { add_entrypoints(&b, &quantic_dream_device_entrypoints, RADV_APP_DISPATCH_TABLE); + } else if (!strcmp(instance->drirc.debug.app_layer, "no_mans_sky")) { + add_entrypoints(&b, &no_mans_sky_device_entrypoints, RADV_APP_DISPATCH_TABLE); } if (instance->vk.trace_mode & RADV_TRACE_MODE_RGP) diff --git a/src/util/00-radv-defaults.conf b/src/util/00-radv-defaults.conf index cc74cf7d8a7..2f2667c2c50 100644 --- a/src/util/00-radv-defaults.conf +++ b/src/util/00-radv-defaults.conf @@ -305,5 +305,9 @@ Application bugs worked around in this file: + + +