From 3cfc16ea3408cb7ce2d65e1925e2a2203fe945d5 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Wed, 8 Jan 2020 21:59:00 +0000 Subject: [PATCH] [d3d11] Move shader stage and buffer slot calc to inside lambda Take advantage of the fact that template permutations transfer into lambdas inside of them. Removes some unnecessary captures. --- src/d3d11/d3d11_context.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp index 4dcd1e92..8fd5e37b 100644 --- a/src/d3d11/d3d11_context.cpp +++ b/src/d3d11/d3d11_context.cpp @@ -3366,12 +3366,7 @@ namespace dxvk { void D3D11DeviceContext::BindShader( const D3D11CommonShader* pShaderModule) { // Bind the shader and the ICB at once - uint32_t slotId = computeConstantBufferBinding(ShaderStage, - D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT); - EmitCs([ - cSlotId = slotId, - cStage = GetShaderStage(ShaderStage), cSlice = pShaderModule != nullptr && pShaderModule->GetIcb() != nullptr ? DxvkBufferSlice(pShaderModule->GetIcb()) @@ -3380,8 +3375,13 @@ namespace dxvk { ? pShaderModule->GetShader() : nullptr ] (DxvkContext* ctx) { - ctx->bindShader (cStage, cShader); - ctx->bindResourceBuffer(cSlotId, cSlice); + VkShaderStageFlagBits stage = GetShaderStage(ShaderStage); + + uint32_t slotId = computeConstantBufferBinding(ShaderStage, + D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT); + + ctx->bindShader (stage, cShader); + ctx->bindResourceBuffer(slotId, cSlice); }); }