1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[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.
This commit is contained in:
Philip Rebohle 2019-10-26 23:13:59 +02:00
parent 20f79a754b
commit 144f4badef
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -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);