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

[dxbc] Only emit temp array range check for dynamically indexed stores

Generates less code and makes things slightly more readable.
This commit is contained in:
Philip Rebohle 2022-03-24 12:46:58 +01:00
parent c590736fec
commit 3ecd13cec2
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -5721,7 +5721,12 @@ namespace dxvk {
void DxbcCompiler::emitRegisterStore(
const DxbcRegister& reg,
DxbcRegisterValue value) {
if (reg.type == DxbcOperandType::IndexableTemp) {
bool doRangeCheck = false;
if (reg.type == DxbcOperandType::IndexableTemp)
doRangeCheck = reg.idx[1].relReg != nullptr;
if (doRangeCheck) {
DxbcRegisterValue vectorId = emitIndexLoad(reg.idx[1]);
uint32_t boundsCheck = m_module.opULessThan(
m_module.defBoolType(), vectorId.id,