1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-04 01:29:26 +01:00

[d3d9] Use cdw to iterate over register tokens in D3D9ShaderValidator

This commit is contained in:
WinterSnowfall 2025-01-07 17:50:36 +02:00 committed by Philip Rebohle
parent 150cb0d4c7
commit 475bf4e9c1

View File

@ -87,7 +87,7 @@ namespace dxvk {
default:
// Iterate over register tokens. Bit 31 of register tokens is always 1.
for (uint32_t instNum = 1; pdwInst[instNum] & 0x80000000; instNum++) {
for (uint32_t instNum = 1; instNum < cdw && (pdwInst[instNum] >> 31); instNum++) {
DWORD regType = ((pdwInst[instNum] & D3DSP_REGTYPE_MASK) >> D3DSP_REGTYPE_SHIFT)
| ((pdwInst[instNum] & D3DSP_REGTYPE_MASK2) >> D3DSP_REGTYPE_SHIFT2);
DWORD regIndex = pdwInst[instNum] & D3DSP_REGNUM_MASK;