mirror of
https://github.com/hedge-dev/XenosRecomp.git
synced 2025-10-30 07:12:17 +00:00
Compare commits
4 commits
06fab7d08e
...
cf49b058f4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf49b058f4 | ||
|
|
5d3ed8016c | ||
|
|
c11a6f28b5 | ||
|
|
8752326f1c |
2 changed files with 7 additions and 7 deletions
|
|
@ -13,7 +13,6 @@
|
|||
#if defined(__air__) || !defined(__cplusplus) || defined(__INTELLISENSE__)
|
||||
|
||||
#ifndef __air__
|
||||
#define FLT_MIN asfloat(0xff7fffff)
|
||||
#define FLT_MAX asfloat(0x7f7fffff)
|
||||
#endif
|
||||
|
||||
|
|
@ -42,11 +41,12 @@ struct PushConstants
|
|||
|
||||
using namespace metal;
|
||||
|
||||
constant uint G_SPEC_CONSTANT [[function_constant(0)]];
|
||||
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;
|
||||
|
||||
uint g_SpecConstants()
|
||||
{
|
||||
return G_SPEC_CONSTANT;
|
||||
return G_SPEC_CONSTANTS_VAL;
|
||||
}
|
||||
|
||||
struct PushConstants
|
||||
|
|
@ -173,7 +173,7 @@ float rcp(T a)
|
|||
template<typename T>
|
||||
float4x4 mul(T a, T b)
|
||||
{
|
||||
return a * b;
|
||||
return b * a;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue