From cf4a2d49ac13e90bec949e45c2df6778c11bc50b Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 24 Apr 2017 13:51:27 -0700 Subject: [PATCH] Fixed validation errors with Creators Update --- Src/NormalMapEffect.cpp | 5 +++++ Src/ResourceUploadBatch.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Src/NormalMapEffect.cpp b/Src/NormalMapEffect.cpp index 94fd42b..11c6511 100644 --- a/Src/NormalMapEffect.cpp +++ b/Src/NormalMapEffect.cpp @@ -319,6 +319,11 @@ void NormalMapEffect::Impl::Apply(_In_ ID3D12GraphicsCommandList* commandList) } commandList->SetGraphicsRootDescriptorTable(RootParameterIndex::TextureSpecularSRV, specular); } + else + { + // Set unused texture slot to void validation warning on Tier 1 hardware + commandList->SetGraphicsRootDescriptorTable(RootParameterIndex::TextureSpecularSRV, texture); + } // Set constants commandList->SetGraphicsRootConstantBufferView(RootParameterIndex::ConstantBuffer, GetConstantBufferGpuAddress()); diff --git a/Src/ResourceUploadBatch.cpp b/Src/ResourceUploadBatch.cpp index 2374298..e2de070 100644 --- a/Src/ResourceUploadBatch.cpp +++ b/Src/ResourceUploadBatch.cpp @@ -682,7 +682,7 @@ private: // Create a BGRA alias auto aliasDesc = resourceDesc; - aliasDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; + aliasDesc.Format = (resourceDesc.Format == DXGI_FORMAT_B8G8R8X8_UNORM || resourceDesc.Format == DXGI_FORMAT_B8G8R8X8_UNORM_SRGB) ? DXGI_FORMAT_B8G8R8X8_UNORM : DXGI_FORMAT_B8G8R8A8_UNORM; ComPtr aliasCopy; ThrowIfFailed(mDevice->CreatePlacedResource(