Compare commits

..

1 commit

Author SHA1 Message Date
Isaac Marovitz
73fbabce60
Merge 06fab7d08e into b15b5e4728 2025-03-27 15:56:35 +00:00
2 changed files with 7 additions and 7 deletions

View file

@ -13,6 +13,7 @@
#if defined(__air__) || !defined(__cplusplus) || defined(__INTELLISENSE__)
#ifndef __air__
#define FLT_MIN asfloat(0xff7fffff)
#define FLT_MAX asfloat(0x7f7fffff)
#endif
@ -41,12 +42,11 @@ struct PushConstants
using namespace metal;
constant uint G_SPEC_CONSTANTS [[function_constant(0)]];
constant uint G_SPEC_CONSTANTS_VAL = is_function_constant_defined(G_SPEC_CONSTANTS) ? G_SPEC_CONSTANTS : 0;
constant uint G_SPEC_CONSTANT [[function_constant(0)]];
uint g_SpecConstants()
{
return G_SPEC_CONSTANTS_VAL;
return G_SPEC_CONSTANT;
}
struct PushConstants
@ -173,7 +173,7 @@ float rcp(T a)
template<typename T>
float4x4 mul(T a, T b)
{
return b * a;
return a * b;
}
#endif

View file

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