From 728f1022f84c7d1071b35793f6d6a8534e514902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 21 Dec 2017 17:31:32 -0800 Subject: [PATCH] D3D12: Fixed initial state for BGFX_TEXTURE_BLIT_DST texture. --- src/renderer_d3d12.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index 424fb4ed4..40013af37 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -1823,8 +1823,12 @@ namespace bgfx { namespace d3d12 bx::memCopy(m_uniforms[_loc], _data, _size); } - void setMarker(const char* /*_marker*/, uint32_t /*_size*/) override + void setMarker(const char* _marker, uint32_t /*_size*/) override { + if (BX_ENABLED(BGFX_CONFIG_DEBUG_PIX)) + { + PIX3_SETMARKER(m_commandList, D3DCOLOR_MARKER, _marker); + } } void invalidateOcclusionQuery(OcclusionQueryHandle _handle) override @@ -4349,6 +4353,7 @@ data.NumQualityLevels = 0; const bool writeOnly = 0 != (m_flags&BGFX_TEXTURE_RT_WRITE_ONLY); const bool computeWrite = 0 != (m_flags&BGFX_TEXTURE_COMPUTE_WRITE); const bool renderTarget = 0 != (m_flags&BGFX_TEXTURE_RT_MASK); + const bool blit = 0 != (m_flags&BGFX_TEXTURE_BLIT_DST); BX_TRACE("Texture %3d: %s (requested: %s), %dx%d%s RT[%c], BO[%c], CW[%c]%s." , this - s_renderD3D12->m_textures @@ -4524,6 +4529,11 @@ data.NumQualityLevels = 0; resourceDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS; } + if (blit) + { + state = D3D12_RESOURCE_STATE_COPY_DEST; + } + switch (m_type) { case Texture2D: