mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Lighting: Compute the GE's pow from the float's bits
Read as an integer, a float's bits are its log2 with the mantissa a straight line between powers of two, scaled by 2^23, and writing an integer back is the matching exp2. That's exactly the GE's approximation, without log2/exp2/floor. pspPow now also returns 1 for e <= 0 itself, so the callers drop their checks. Shader languages without integers fall back to a true pow. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
9162592493
commit
333035df03
4 files changed
+41
-44
No files matched your search
@@ -37,6 +37,8 @@ const char * const hlsl_preamble_fs =
|
||||
"#define inversesqrt rsqrt\n"
|
||||
"#define floatBitsToUint asuint\n"
|
||||
"#define uintBitsToFloat asfloat\n"
|
||||
"#define floatBitsToInt asint\n"
|
||||
"#define intBitsToFloat asfloat\n"
|
||||
"\n";
|
||||
|
||||
static const char * const hlsl_d3d11_preamble_fs =
|
||||
@@ -71,6 +73,8 @@ static const char * const hlsl_preamble_vs =
|
||||
"#define inversesqrt rsqrt\n"
|
||||
"#define floatBitsToUint asuint\n"
|
||||
"#define uintBitsToFloat asfloat\n"
|
||||
"#define floatBitsToInt asint\n"
|
||||
"#define intBitsToFloat asfloat\n"
|
||||
"\n";
|
||||
|
||||
static const char * const semanticNames[] = {
|
||||
|
||||
Reference in new issue
Block a user