From 144f4badef6fd9e12485ea798d5a9d8f64e2541f Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 26 Oct 2019 23:13:59 +0200 Subject: [PATCH] [dxbc] Always allocate at least one input array element Turns out that shaders with no inputs can still have an input signature, in which case we were generating a zero-length array which is illegal. --- src/dxbc/dxbc_compiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 7db161ffa..4947a4f8e 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -7039,7 +7039,7 @@ namespace dxvk { // Define the array type. This will be two-dimensional // in some shaders, with the outer index representing // the vertex ID within an invocation. - m_vArrayLength = m_isgn != nullptr ? m_isgn->maxRegisterCount() : 1; + m_vArrayLength = m_isgn != nullptr ? std::max(1u, m_isgn->maxRegisterCount()) : 1; m_vArrayLengthId = m_module.lateConst32(getScalarTypeId(DxbcScalarType::Uint32)); uint32_t vectorTypeId = getVectorTypeId(info);