From c94ad845ee0b66b886b0d974a99281deb13ad03c Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Tue, 12 Mar 2024 11:24:56 -0700 Subject: [PATCH] Add c_initialRead/UAVTargetState to help with PC vs. Xbox warnings (#217) --- CMakePresets.json | 3 +++ Inc/DirectXHelpers.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/CMakePresets.json b/CMakePresets.json index 98803d6..6dfb160 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -307,6 +307,9 @@ { "name": "arm64-Debug" , "configurePreset": "arm64-Debug" }, { "name": "arm64-Release", "configurePreset": "arm64-Release" }, + { "name": "x64-Debug-VCPKG" , "configurePreset": "x64-Debug-VCPKG" }, + { "name": "x64-Release-VCPKG" , "configurePreset": "x64-Release-VCPKG" }, + { "name": "x64-Debug-Clang" , "configurePreset": "x64-Debug-Clang" }, { "name": "x64-Release-Clang" , "configurePreset": "x64-Release-Clang" }, { "name": "x86-Debug-Clang" , "configurePreset": "x86-Debug-Clang" }, diff --git a/Inc/DirectXHelpers.h b/Inc/DirectXHelpers.h index afe54cd..de24128 100644 --- a/Inc/DirectXHelpers.h +++ b/Inc/DirectXHelpers.h @@ -117,8 +117,12 @@ namespace DirectX { #if (defined(_XBOX_ONE) && defined(_TITLE)) || defined(_GAMING_XBOX) constexpr D3D12_RESOURCE_STATES c_initialCopyTargetState = D3D12_RESOURCE_STATE_COPY_DEST; + constexpr D3D12_RESOURCE_STATES c_initialReadTargetState = D3D12_RESOURCE_STATE_GENERIC_READ; + constexpr D3D12_RESOURCE_STATES c_initialUAVTargetState = D3D12_RESOURCE_STATE_UNORDERED_ACCESS; #else constexpr D3D12_RESOURCE_STATES c_initialCopyTargetState = D3D12_RESOURCE_STATE_COMMON; + constexpr D3D12_RESOURCE_STATES c_initialReadTargetState = D3D12_RESOURCE_STATE_COMMON; + constexpr D3D12_RESOURCE_STATES c_initialUAVTargetState = D3D12_RESOURCE_STATE_COMMON; #endif constexpr D3D12_CPU_DESCRIPTOR_HANDLE D3D12_CPU_DESCRIPTOR_HANDLE_ZERO = {};