Commit 3cfc16ea authored by Joshua Ashton's avatar Joshua Ashton Committed by Philip Rebohle

[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.
parent b738c422
......@@ -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);
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment