vkd3d: HACK: Don't create host pointer heap for Halo Infinite.
Some usage pattern here is causing a failure inside amdgpu. Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
This commit is contained in:
parent
f487db4756
commit
849537614a
|
@ -91,6 +91,7 @@ extern "C" {
|
||||||
#define VKD3D_CONFIG_FLAG_ZERO_MEMORY_WORKAROUNDS_COMMITTED_BUFFER_UAV (1ull << 29)
|
#define VKD3D_CONFIG_FLAG_ZERO_MEMORY_WORKAROUNDS_COMMITTED_BUFFER_UAV (1ull << 29)
|
||||||
#define VKD3D_CONFIG_FLAG_ALLOW_SBT_COLLECTION (1ull << 30)
|
#define VKD3D_CONFIG_FLAG_ALLOW_SBT_COLLECTION (1ull << 30)
|
||||||
#define VKD3D_CONFIG_FLAG_FORCE_NATIVE_FP16 (1ull << 31)
|
#define VKD3D_CONFIG_FLAG_FORCE_NATIVE_FP16 (1ull << 31)
|
||||||
|
#define VKD3D_CONFIG_FLAG_USE_HOST_IMPORT_FALLBACK (1ull << 32)
|
||||||
|
|
||||||
typedef HRESULT (*PFN_vkd3d_signal_event)(HANDLE event);
|
typedef HRESULT (*PFN_vkd3d_signal_event)(HANDLE event);
|
||||||
|
|
||||||
|
|
|
@ -514,7 +514,8 @@ static const struct vkd3d_instance_application_meta application_override[] = {
|
||||||
* This works okay with zerovram on first game boot, but not later, since this memory is guaranteed to be recycled.
|
* This works okay with zerovram on first game boot, but not later, since this memory is guaranteed to be recycled.
|
||||||
* Game also relies on indirectly modifying CBV root descriptors, which means we are forced to rely on RAW_VA_CBV. */
|
* Game also relies on indirectly modifying CBV root descriptors, which means we are forced to rely on RAW_VA_CBV. */
|
||||||
{ VKD3D_STRING_COMPARE_EXACT, "HaloInfinite.exe",
|
{ VKD3D_STRING_COMPARE_EXACT, "HaloInfinite.exe",
|
||||||
VKD3D_CONFIG_FLAG_ZERO_MEMORY_WORKAROUNDS_COMMITTED_BUFFER_UAV | VKD3D_CONFIG_FLAG_FORCE_RAW_VA_CBV, 0 },
|
VKD3D_CONFIG_FLAG_ZERO_MEMORY_WORKAROUNDS_COMMITTED_BUFFER_UAV | VKD3D_CONFIG_FLAG_FORCE_RAW_VA_CBV |
|
||||||
|
VKD3D_CONFIG_FLAG_USE_HOST_IMPORT_FALLBACK, 0 },
|
||||||
/* Shadow of the Tomb Raider (750920).
|
/* Shadow of the Tomb Raider (750920).
|
||||||
* Invariant workarounds actually cause more issues than they resolve on NV.
|
* Invariant workarounds actually cause more issues than they resolve on NV.
|
||||||
* RADV already has workarounds by default.
|
* RADV already has workarounds by default.
|
||||||
|
|
|
@ -327,23 +327,25 @@ static HRESULT vkd3d_import_host_memory(struct d3d12_device *device, void *host_
|
||||||
void *pNext, struct vkd3d_device_memory_allocation *allocation)
|
void *pNext, struct vkd3d_device_memory_allocation *allocation)
|
||||||
{
|
{
|
||||||
VkImportMemoryHostPointerInfoEXT import_info;
|
VkImportMemoryHostPointerInfoEXT import_info;
|
||||||
HRESULT hr;
|
HRESULT hr = S_OK;
|
||||||
|
|
||||||
import_info.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT;
|
import_info.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT;
|
||||||
import_info.pNext = pNext;
|
import_info.pNext = pNext;
|
||||||
import_info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT;
|
import_info.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT;
|
||||||
import_info.pHostPointer = host_address;
|
import_info.pHostPointer = host_address;
|
||||||
|
|
||||||
if (FAILED(hr = vkd3d_try_allocate_device_memory(device, size,
|
if ((vkd3d_config_flags & VKD3D_CONFIG_FLAG_USE_HOST_IMPORT_FALLBACK) ||
|
||||||
|
FAILED(hr = vkd3d_try_allocate_device_memory(device, size,
|
||||||
type_flags, type_mask, &import_info, allocation)))
|
type_flags, type_mask, &import_info, allocation)))
|
||||||
{
|
{
|
||||||
WARN("Failed to import host memory, hr %#x.\n", hr);
|
if (FAILED(hr))
|
||||||
|
WARN("Failed to import host memory, hr %#x.\n", hr);
|
||||||
/* If we failed, fall back to a host-visible allocation. Generally
|
/* If we failed, fall back to a host-visible allocation. Generally
|
||||||
* the app will access the memory thorugh the main host pointer,
|
* the app will access the memory thorugh the main host pointer,
|
||||||
* so it's fine. */
|
* so it's fine. */
|
||||||
hr = vkd3d_try_allocate_device_memory(device, size,
|
hr = vkd3d_try_allocate_device_memory(device, size,
|
||||||
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
|
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
|
||||||
type_mask, &import_info, allocation);
|
type_mask, pNext, allocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
|
Loading…
Reference in New Issue