Fix incorrect “FLT_MIN”

Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
This commit is contained in:
Isaac Marovitz 2025-03-27 18:43:12 -04:00
parent 06fab7d08e
commit 8752326f1c
No known key found for this signature in database
GPG key ID: 97250B2B09A132E1
2 changed files with 3 additions and 4 deletions

View file

@ -13,7 +13,6 @@
#if defined(__air__) || !defined(__cplusplus) || defined(__INTELLISENSE__)
#ifndef __air__
#define FLT_MIN asfloat(0xff7fffff)
#define FLT_MAX asfloat(0x7f7fffff)
#endif

View file

@ -1085,19 +1085,19 @@ void ShaderRecompiler::recompile(const AluInstruction& instr)
case AluScalarOpcode::Logc:
case AluScalarOpcode::Log:
print("clamp(log2({}), FLT_MIN, FLT_MAX)", op(SCALAR_0).expression);
print("clamp(log2({}), -FLT_MAX, FLT_MAX)", op(SCALAR_0).expression);
break;
case AluScalarOpcode::Rcpc:
case AluScalarOpcode::Rcpf:
case AluScalarOpcode::Rcp:
print("clamp(rcp({}), FLT_MIN, FLT_MAX)", op(SCALAR_0).expression);
print("clamp(rcp({}), -FLT_MAX, FLT_MAX)", op(SCALAR_0).expression);
break;
case AluScalarOpcode::Rsqc:
case AluScalarOpcode::Rsqf:
case AluScalarOpcode::Rsq:
print("clamp(rsqrt({}), FLT_MIN, FLT_MAX)", op(SCALAR_0).expression);
print("clamp(rsqrt({}), -FLT_MAX, FLT_MAX)", op(SCALAR_0).expression);
break;
case AluScalarOpcode::Subs: