diff --git a/src/dxso/dxso_compiler.cpp b/src/dxso/dxso_compiler.cpp index c6ca4fcd..d1d7a68b 100644 --- a/src/dxso/dxso_compiler.cpp +++ b/src/dxso/dxso_compiler.cpp @@ -41,6 +41,7 @@ namespace dxvk { m_usedSamplers = 0; m_usedRTs = 0; + m_rRegs.reserve(DxsoMaxTempRegs); for (uint32_t i = 0; i < m_rRegs.size(); i++) m_rRegs.at(i) = DxsoRegisterPointer{ }; @@ -1043,6 +1044,8 @@ namespace dxvk { const DxsoBaseRegister* relative) { switch (reg.id.type) { case DxsoRegisterType::Temp: { + if (reg.id.num >= m_rRegs.size()) + m_rRegs.resize( reg.id.num + 1, DxsoRegisterPointer { } ); DxsoRegisterPointer& ptr = m_rRegs.at(reg.id.num); if (ptr.id == 0) { std::string name = str::format("r", reg.id.num); diff --git a/src/dxso/dxso_compiler.h b/src/dxso/dxso_compiler.h index b96124f9..05daca70 100644 --- a/src/dxso/dxso_compiler.h +++ b/src/dxso/dxso_compiler.h @@ -272,9 +272,7 @@ namespace dxvk { //////////////////////////////////////////////// // Temporary r# vector registers with immediate // indexing, and x# vector array registers. - std::array< - DxsoRegisterPointer, - DxsoMaxTempRegs> m_rRegs; + std::vector m_rRegs; //////////////////////////////////////////////// // Predicate registers