From a5934b93e91eb4f9110895419f6409abac0c2131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 15 Oct 2015 20:17:07 -0700 Subject: [PATCH] Cleanup. --- src/bgfx.cpp | 6 +++--- src/renderer_d3d11.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 622e3d4e..2b67759f 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -1594,8 +1594,8 @@ again: if (windowsVersionIs(Condition::GreaterEqual, 0x0602) ) { - first = RendererType::Direct3D12; - second = RendererType::Direct3D11; + first = RendererType::Direct3D11; + second = RendererType::Direct3D12; if (!s_rendererCreator[second].supported) { second = RendererType::Direct3D9; @@ -1662,7 +1662,7 @@ again: } else { -#if 1 +#if 0 if (s_rendererCreator[RendererType::Metal].supported) { _type = RendererType::Metal; diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 59410fdb..e6239ed9 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -3905,7 +3905,8 @@ BX_PRAGMA_DIAGNOSTIC_POP(); const bool bufferOnly = 0 != (m_flags&BGFX_TEXTURE_RT_BUFFER_ONLY); const bool computeWrite = 0 != (m_flags&BGFX_TEXTURE_COMPUTE_WRITE); const bool renderTarget = 0 != (m_flags&BGFX_TEXTURE_RT_MASK); - const bool srgb = 0 != (m_flags&BGFX_TEXTURE_SRGB) || imageContainer.m_srgb; + const bool srgb = 0 != (m_flags&BGFX_TEXTURE_SRGB) || imageContainer.m_srgb; + const bool blit = 0 != (m_flags&BGFX_TEXTURE_BLIT_DST); const uint32_t msaaQuality = bx::uint32_satsub( (m_flags&BGFX_TEXTURE_RT_MSAA_MASK)>>BGFX_TEXTURE_RT_MSAA_SHIFT, 1); const DXGI_SAMPLE_DESC& msaa = s_msaa[msaaQuality]; @@ -3943,7 +3944,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); desc.MipLevels = numMips; desc.Format = format; desc.SampleDesc = msaa; - desc.Usage = kk == 0 ? D3D11_USAGE_DEFAULT : D3D11_USAGE_IMMUTABLE; + desc.Usage = kk == 0 || blit ? D3D11_USAGE_DEFAULT : D3D11_USAGE_IMMUTABLE; desc.BindFlags = bufferOnly ? 0 : D3D11_BIND_SHADER_RESOURCE; desc.CPUAccessFlags = 0; @@ -3991,7 +3992,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); desc.Depth = imageContainer.m_depth; desc.MipLevels = imageContainer.m_numMips; desc.Format = format; - desc.Usage = kk == 0 ? D3D11_USAGE_DEFAULT : D3D11_USAGE_IMMUTABLE; + desc.Usage = kk == 0 || blit ? D3D11_USAGE_DEFAULT : D3D11_USAGE_IMMUTABLE; desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; desc.CPUAccessFlags = 0; desc.MiscFlags = 0;