mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-12-02 05:54:18 +01:00
fix: incorrect roundEven implementation
This commit is contained in:
parent
0bb99aaa75
commit
be98734358
@ -1231,8 +1231,7 @@ static void _emitALUOP2InstructionCode(LatteDecompilerShaderContext* shaderConte
|
|||||||
_emitInstructionOutputVariableName(shaderContext, aluInstruction);
|
_emitInstructionOutputVariableName(shaderContext, aluInstruction);
|
||||||
src->add(" = ");
|
src->add(" = ");
|
||||||
_emitTypeConversionPrefixMSL(shaderContext, LATTE_DECOMPILER_DTYPE_FLOAT, outputType);
|
_emitTypeConversionPrefixMSL(shaderContext, LATTE_DECOMPILER_DTYPE_FLOAT, outputType);
|
||||||
src->add("roundEven");
|
src->add("rint(");
|
||||||
src->add("(");
|
|
||||||
_emitOperandInputCode(shaderContext, aluInstruction, 0, LATTE_DECOMPILER_DTYPE_FLOAT);
|
_emitOperandInputCode(shaderContext, aluInstruction, 0, LATTE_DECOMPILER_DTYPE_FLOAT);
|
||||||
src->add(")");
|
src->add(")");
|
||||||
_emitTypeConversionSuffixMSL(shaderContext, LATTE_DECOMPILER_DTYPE_FLOAT, outputType);
|
_emitTypeConversionSuffixMSL(shaderContext, LATTE_DECOMPILER_DTYPE_FLOAT, outputType);
|
||||||
@ -3725,12 +3724,6 @@ void LatteDecompiler_emitHelperFunctions(LatteDecompilerShaderContext* shaderCon
|
|||||||
"return as_type<int>(clamp(as_type<float>(v), 0.0, 1.0));\r\n"
|
"return as_type<int>(clamp(as_type<float>(v), 0.0, 1.0));\r\n"
|
||||||
"}\r\n");
|
"}\r\n");
|
||||||
|
|
||||||
// round even
|
|
||||||
fCStr_shaderSource->add(""
|
|
||||||
"float roundEven(float x) {\r\n"
|
|
||||||
"return round(x / 2.0) * 2.0;\r\n"
|
|
||||||
"}\r\n");
|
|
||||||
|
|
||||||
// Bit cast
|
// Bit cast
|
||||||
|
|
||||||
// Scalar
|
// Scalar
|
||||||
|
Loading…
Reference in New Issue
Block a user