From 55db8abdeb34db003fe477599a180df5041a1fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tur=C3=A1nszki=20J=C3=A1nos?= Date: Sat, 18 Jan 2025 12:04:58 +0100 Subject: [PATCH] xbox fix --- WickedEngine/wiGraphicsDevice_DX12.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WickedEngine/wiGraphicsDevice_DX12.cpp b/WickedEngine/wiGraphicsDevice_DX12.cpp index ab0894bb0..0c7de53bf 100644 --- a/WickedEngine/wiGraphicsDevice_DX12.cpp +++ b/WickedEngine/wiGraphicsDevice_DX12.cpp @@ -3276,6 +3276,9 @@ std::mutex queue_locker; // (since it has no resource) D3D12_RESOURCE_ALLOCATION_INFO allocationInfo = device->GetResourceAllocationInfo(0, 1, &resourceDesc); + // D3D12MA ValidateAllocateMemoryParameters requires this, wasn't always true on Xbox: + allocationInfo.SizeInBytes = AlignTo(allocationInfo.SizeInBytes, (UINT64)D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT); + if (resource_heap_tier >= D3D12_RESOURCE_HEAP_TIER_2) { allocationDesc.ExtraHeapFlags = D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES;