summaryrefslogtreecommitdiffstats
path: root/unityplugin
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-04-19 16:15:34 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-04-19 16:15:34 +0000
commit2fbd30f9662095c6e53e961d4751df972821225e (patch)
treebc8d65bf438d0ede0231554b8ee846a83a7a5288 /unityplugin
parentUpdated core (texture uploader updates) (diff)
downloadDiligentEngine-2fbd30f9662095c6e53e961d4751df972821225e.tar.gz
DiligentEngine-2fbd30f9662095c6e53e961d4751df972821225e.zip
Updated core; fixed issue with swap chain format in D3D12 Unity emulator
Diffstat (limited to 'unityplugin')
-rw-r--r--unityplugin/GhostCubeScene/src/GhostCubeScene.cpp2
-rw-r--r--unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/unityplugin/GhostCubeScene/src/GhostCubeScene.cpp b/unityplugin/GhostCubeScene/src/GhostCubeScene.cpp
index 4e64ab8..5eb205a 100644
--- a/unityplugin/GhostCubeScene/src/GhostCubeScene.cpp
+++ b/unityplugin/GhostCubeScene/src/GhostCubeScene.cpp
@@ -86,7 +86,7 @@ void GhostCubeScene::OnGraphicsInitialized()
PSODesc.Name = "Mirror PSO";
PSODesc.GraphicsPipeline.NumRenderTargets = 1;
- PSODesc.GraphicsPipeline.RTVFormats[0] = SCDesc.ColorBufferFormat == TEX_FORMAT_RGBA8_UNORM ? TEX_FORMAT_RGBA8_UNORM_SRGB : SCDesc.ColorBufferFormat;
+ PSODesc.GraphicsPipeline.RTVFormats[0] = SCDesc.ColorBufferFormat;
PSODesc.GraphicsPipeline.DSVFormat = SCDesc.DepthBufferFormat;
PSODesc.GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_BACK;
diff --git a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp
index 18e2ae0..1495f5c 100644
--- a/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp
+++ b/unityplugin/UnityEmulator/src/DiligentGraphicsAdapterD3D12.cpp
@@ -149,6 +149,9 @@ public:
m_SwapChainDesc.Width = SwapChainDesc.Width;
m_SwapChainDesc.Height = SwapChainDesc.Height;
m_SwapChainDesc.ColorBufferFormat = DXGI_FormatToTexFormat(SwapChainDesc.Format);
+ if (m_SwapChainDesc.ColorBufferFormat == TEX_FORMAT_RGBA8_UNORM)
+ m_SwapChainDesc.ColorBufferFormat = TEX_FORMAT_RGBA8_UNORM_SRGB;
+
const auto DepthBufferDesc = pd3d12DepthBuffer->GetDesc();
m_SwapChainDesc.DepthBufferFormat = DXGI_FormatToTexFormat(DepthBufferDesc.Format);