Implement float-uniform out-of-bound return value

In the case that the resulting float-uniform index is greater than the 96 slots that it has, a result of `{1,1,1,1}` is to be returned.
This commit is contained in:
Wunkolo 2024-03-20 10:54:18 -07:00
parent dbdf7c4ffb
commit 17b4c68577
No known key found for this signature in database

View file

@ -136,6 +136,8 @@ PICAShader::vec4f PICAShader::getSource(u32 source) {
return tempRegisters[source - 0x10];
else if (source <= 0x7f)
return floatUniforms[source - 0x20];
else if (source <= 0x7f + 96)
return vec4f({f24::fromFloat32(1.0f), f24::fromFloat32(1.0f), f24::fromFloat32(1.0f), f24::fromFloat32(1.0f)});
else {
Helpers::warn("[PICA] Unimplemented source value: %X\n", source);
return vec4f({f24::zero(), f24::zero(), f24::zero(), f24::zero()});