mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
radv: add a workaround for illegal depth/stencil descriptors with No Man's Sky
Using descriptors with both depth and stencil aspects is illegal in
Vulkan and this hangs the GPU.
Use NULL descriptors to mitigate the issue. Note that AMDVLK also
ignores them.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13325
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit cb4e0c4140)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38268>
This commit is contained in:
parent
3ddddf78b4
commit
1e885e7a88
5 changed files with 44 additions and 1 deletions
|
|
@ -24,7 +24,7 @@
|
|||
"description": "radv: add a workaround for illegal depth/stencil descriptors with No Man's Sky",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
35
src/amd/vulkan/layers/radv_no_mans_sky.c
Normal file
35
src/amd/vulkan/layers/radv_no_mans_sky.c
Normal file
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -302,5 +302,9 @@ Application bugs worked around in this file:
|
|||
<application name="Total War: WARHAMMER III" application_name_match="TotalWarhammer3">
|
||||
<option name="radv_disable_depth_storage" value="true"/>
|
||||
</application>
|
||||
|
||||
<application name="No Man's Sky" application_name_match="No Man's Sky">
|
||||
<option name="radv_app_layer" value="no_mans_sky" />
|
||||
</application>
|
||||
</device>
|
||||
</driconf>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue