From f5cdf6e4bf253d90bcbf8e26a29ad669e5b90fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Thu, 25 Feb 2021 18:40:30 -0800 Subject: [PATCH] Cleanup. --- src/renderer_d3d11.cpp | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index 0c2f1260a..5eb073a00 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -3032,50 +3032,54 @@ namespace bgfx { namespace d3d11 { const uint32_t maxTextureSamplers = g_caps.limits.maxTextureSamplers; + ID3D11DeviceContext* deviceCtx = m_deviceCtx; + // vertex texture fetch not supported on 9_1 through 9_3 if (m_featureLevel > D3D_FEATURE_LEVEL_9_3) { - m_deviceCtx->VSSetShaderResources(0, maxTextureSamplers, s_zero.m_srv); - m_deviceCtx->VSSetSamplers(0, maxTextureSamplers, s_zero.m_sampler); + deviceCtx->VSSetShaderResources(0, maxTextureSamplers, s_zero.m_srv); + deviceCtx->VSSetSamplers(0, maxTextureSamplers, s_zero.m_sampler); } if (m_featureLevel > D3D_FEATURE_LEVEL_11_0) { - m_deviceCtx->OMSetRenderTargetsAndUnorderedAccessViews( - D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL - , NULL - , NULL - , 16 - , maxTextureSamplers - , s_zero.m_uav - , NULL + deviceCtx->OMSetRenderTargetsAndUnorderedAccessViews( + D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL + , NULL + , NULL + , 16 + , maxTextureSamplers + , s_zero.m_uav + , NULL ); } - m_deviceCtx->PSSetShaderResources(0, maxTextureSamplers, s_zero.m_srv); - m_deviceCtx->PSSetSamplers(0, maxTextureSamplers, s_zero.m_sampler); + deviceCtx->PSSetShaderResources(0, maxTextureSamplers, s_zero.m_srv); + deviceCtx->PSSetSamplers(0, maxTextureSamplers, s_zero.m_sampler); } void commitTextureStage() { - if (BX_ENABLED(BGFX_CONFIG_DEBUG)) + if (BX_ENABLED(BGFX_CONFIG_DEBUG) ) { quietValidation(); } const uint32_t maxTextureSamplers = g_caps.limits.maxTextureSamplers; + ID3D11DeviceContext* deviceCtx = m_deviceCtx; + // vertex texture fetch not supported on 9_1 through 9_3 if (m_featureLevel > D3D_FEATURE_LEVEL_9_3) { - m_deviceCtx->VSSetShaderResources(0, maxTextureSamplers, m_textureStage.m_srv); - m_deviceCtx->VSSetSamplers(0, maxTextureSamplers, m_textureStage.m_sampler); + deviceCtx->VSSetShaderResources(0, maxTextureSamplers, m_textureStage.m_srv); + deviceCtx->VSSetSamplers(0, maxTextureSamplers, m_textureStage.m_sampler); } if (m_featureLevel > D3D_FEATURE_LEVEL_11_0) { - m_deviceCtx->OMSetRenderTargetsAndUnorderedAccessViews( - D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL + deviceCtx->OMSetRenderTargetsAndUnorderedAccessViews( + D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL , NULL , NULL , 16 @@ -3085,8 +3089,8 @@ namespace bgfx { namespace d3d11 ); } - m_deviceCtx->PSSetShaderResources(0, maxTextureSamplers, m_textureStage.m_srv); - m_deviceCtx->PSSetSamplers(0, maxTextureSamplers, m_textureStage.m_sampler); + deviceCtx->PSSetShaderResources(0, maxTextureSamplers, m_textureStage.m_srv); + deviceCtx->PSSetSamplers(0, maxTextureSamplers, m_textureStage.m_sampler); } void invalidateTextureStage()