From 0bf97993c6bb23821223eec23ac72f2db61dbdc1 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 22 Apr 2018 08:13:14 +0200 Subject: [PATCH] [dxbc] Fix layer count in resinfo instruction For non-layered types, this instruction is supposed to return 0, not 1. --- src/dxbc/dxbc_compiler.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 9cd79355..4b30e545 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -4558,6 +4558,16 @@ namespace dxvk { getVectorTypeId(result.type), m_module.opLoad(info.typeId, info.varId)); } + + if (info.image.array && !info.image.layered) { + const uint32_t index = result.type.ccount - 1; + const uint32_t zero = m_module.constu32(0); + + result.id = m_module.opCompositeInsert( + getVectorTypeId(result.type), + zero, result.id, 1, &index); + } + return result; } @@ -4613,7 +4623,6 @@ namespace dxvk { } }(); - coordVector.id = m_module.opCompositeInsert( getVectorTypeId(coordVector.type), zero, coordVector.id, 1, &index);