1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-11 19:24:11 +01:00

[dxso] Don't assume 32 registers.

This commit is contained in:
Etaash Mathamsetty 2023-08-12 15:06:57 -04:00 committed by Joshie
parent 295a58afdf
commit 037669f715
2 changed files with 4 additions and 3 deletions

View File

@ -41,6 +41,7 @@ namespace dxvk {
m_usedSamplers = 0; m_usedSamplers = 0;
m_usedRTs = 0; m_usedRTs = 0;
m_rRegs.reserve(DxsoMaxTempRegs);
for (uint32_t i = 0; i < m_rRegs.size(); i++) for (uint32_t i = 0; i < m_rRegs.size(); i++)
m_rRegs.at(i) = DxsoRegisterPointer{ }; m_rRegs.at(i) = DxsoRegisterPointer{ };
@ -1043,6 +1044,8 @@ namespace dxvk {
const DxsoBaseRegister* relative) { const DxsoBaseRegister* relative) {
switch (reg.id.type) { switch (reg.id.type) {
case DxsoRegisterType::Temp: { 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); DxsoRegisterPointer& ptr = m_rRegs.at(reg.id.num);
if (ptr.id == 0) { if (ptr.id == 0) {
std::string name = str::format("r", reg.id.num); std::string name = str::format("r", reg.id.num);

View File

@ -272,9 +272,7 @@ namespace dxvk {
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Temporary r# vector registers with immediate // Temporary r# vector registers with immediate
// indexing, and x# vector array registers. // indexing, and x# vector array registers.
std::array< std::vector<DxsoRegisterPointer> m_rRegs;
DxsoRegisterPointer,
DxsoMaxTempRegs> m_rRegs;
//////////////////////////////////////////////// ////////////////////////////////////////////////
// Predicate registers // Predicate registers