mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-19 20:19:13 +12:00
Fix shader-interpreter RCP/RSQ output
Handle the `-0.0` special-case
This commit is contained in:
parent
01b2ac7555
commit
123252592b
1 changed files with 10 additions and 2 deletions
|
@ -382,7 +382,11 @@ void PICAShader::rcp(u32 instruction) {
|
|||
vec4f srcVec1 = getSourceSwizzled<1>(src1, operandDescriptor);
|
||||
|
||||
vec4f& destVector = getDest(dest);
|
||||
f24 res = f24::fromFloat32(1.0f) / srcVec1[0];
|
||||
float input = srcVec1[0].toFloat32();
|
||||
if (input == -0.0f) {
|
||||
input = 0.0f;
|
||||
}
|
||||
const f24 res = f24::fromFloat32(1.0f / input);
|
||||
|
||||
u32 componentMask = operandDescriptor & 0xf;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
@ -402,7 +406,11 @@ void PICAShader::rsq(u32 instruction) {
|
|||
vec4f srcVec1 = getSourceSwizzled<1>(src1, operandDescriptor);
|
||||
|
||||
vec4f& destVector = getDest(dest);
|
||||
f24 res = f24::fromFloat32(1.0f / std::sqrt(srcVec1[0].toFloat32()));
|
||||
float input = srcVec1[0].toFloat32();
|
||||
if (input == -0.0f) {
|
||||
input = 0.0f;
|
||||
}
|
||||
const f24 res = f24::fromFloat32(1.0f / std::sqrt(input));
|
||||
|
||||
u32 componentMask = operandDescriptor & 0xf;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue