From fd1c50d8d831384f3062355c75bd63e663ada3b6 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 21 Apr 2018 14:01:27 +0200 Subject: [PATCH] [dxbc] Fixed incorrect shader resource slot computation --- src/dxbc/dxbc_util.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dxbc/dxbc_util.cpp b/src/dxbc/dxbc_util.cpp index 6197992c..fc406e55 100644 --- a/src/dxbc/dxbc_util.cpp +++ b/src/dxbc/dxbc_util.cpp @@ -7,7 +7,7 @@ namespace dxvk { DxbcBindingType bindingType, uint32_t bindingIndex) { // First resource slot index for per-stage resources - const uint32_t stageOffset = 132 + 158 * static_cast(shaderStage); + const uint32_t stageOffset = 132 + 158 * uint32_t(shaderStage); if (shaderStage == DxbcProgramType::ComputeShader) { // 0 - 13: Constant buffers @@ -32,9 +32,9 @@ namespace dxvk { // 14 - 29: Samplers // 30 - 157: Shader resources switch (bindingType) { - case DxbcBindingType::UnorderedAccessView:return bindingIndex + 0; - case DxbcBindingType::UavCounter: return bindingIndex + 8; - case DxbcBindingType::StreamOutputBuffer: return bindingIndex + 16; + case DxbcBindingType::StreamOutputBuffer: return bindingIndex + 0; + case DxbcBindingType::UnorderedAccessView:return bindingIndex + 4; + case DxbcBindingType::UavCounter: return bindingIndex + 68; case DxbcBindingType::ConstantBuffer: return bindingIndex + stageOffset + 0; case DxbcBindingType::ImageSampler: return bindingIndex + stageOffset + 14; case DxbcBindingType::ShaderResource: return bindingIndex + stageOffset + 30;