[qfcc] Implement min and the pack/unpack functions

Well... at least as far as marking the intrinsics. Still need to
implement parameterized intrinsics.
This commit is contained in:
Bill Currie 2025-01-16 17:18:17 +09:00
parent 1a1bbfd03a
commit 6ff1704246

View file

@ -507,14 +507,14 @@ SRC_LINE
"genDType mod(genDType x, genDType y);" "\n"
"genFType modf(genFType x, out genFType i);" "\n"
"genDType modf(genDType x, out genDType i);" "\n"
"genFType min(genFType x, genFType y);" "\n"
"genFType min(genFType x, float y);" "\n"
"genDType min(genDType x, genDType y);" "\n"
"genDType min(genDType x, double y);" "\n"
"genIType min(genIType x, genIType y);" "\n"
"genIType min(genIType x, int y);" "\n"
"genUType min(genUType x, genUType y);" "\n"
"genUType min(genUType x, uint y);" "\n"
"genFType min(genFType x, genFType y) = " GLSL(FMin) ";" "\n"
"genFType min(genFType x, float y) = " GLSL(FMax) "[x, @construct (genFType, y)];" "\n"
"genDType min(genDType x, genDType y) = " GLSL(FMin) ";" "\n"
"genDType min(genDType x, double y) = " GLSL(FMax) "[x, @construct (genDType, y)];" "\n"
"genIType min(genIType x, genIType y) = " GLSL(IMin) ";" "\n"
"genIType min(genIType x, int y) = " GLSL(FMax) "[x, @construct (genIType, y)];" "\n"
"genUType min(genUType x, genUType y) = " GLSL(UMin) ";" "\n"
"genUType min(genUType x, uint y) = " GLSL(FMax) "[x, @construct (genUType, y)];" "\n"
"genFType max(genFType x, genFType y) = " GLSL(FMax) ";" "\n"
"genFType max(genFType x, float y) = " GLSL(FMax) "[x, @construct (genFType, y)];" "\n"
"genDType max(genDType x, genDType y) = " GLSL(FMax) ";" "\n"
@ -565,18 +565,18 @@ SRC_LINE
//floating-point pack and unpack functions
SRC_LINE
"highp uint packUnorm2x16(vec2 v);" "\n"
"highp uint packSnorm2x16(vec2 v);" "\n"
"uint packUnorm4x8(vec4 v);" "\n"
"uint packSnorm4x8(vec4 v);" "\n"
"vec2 unpackUnorm2x16(highp uint p);" "\n"
"vec2 unpackSnorm2x16(highp uint p);" "\n"
"vec4 unpackUnorm4x8(highp uint p);" "\n"
"vec4 unpackSnorm4x8(highp uint p);" "\n"
"uint packHalf2x16(vec2 v);" "\n"
"vec2 unpackHalf2x16(uint v);" "\n"
"double packDouble2x32(uvec2 v);" "\n"
"uvec2 unpackDouble2x32(double v);" "\n"
"highp uint packUnorm2x16(vec2 v) = " GLSL(PackUnorm2x16) ";" "\n"
"highp uint packSnorm2x16(vec2 v) = " GLSL(PackSnorm2x16) ";" "\n"
"uint packUnorm4x8(vec4 v) = " GLSL(PackUnorm4x8) ";" "\n"
"uint packSnorm4x8(vec4 v) = " GLSL(PackSnorm4x8) ";" "\n"
"vec2 unpackUnorm2x16(highp uint p) = " GLSL(UnpackUnorm2x16) ";" "\n"
"vec2 unpackSnorm2x16(highp uint p) = " GLSL(UnpackSnorm2x16) ";" "\n"
"vec4 unpackUnorm4x8(highp uint p) = " GLSL(UnpackUnorm4x8) ";" "\n"
"vec4 unpackSnorm4x8(highp uint p) = " GLSL(UnpackSnorm4x8) ";" "\n"
"uint packHalf2x16(vec2 v) = " GLSL(PackHalf2x16) ";" "\n"
"vec2 unpackHalf2x16(uint v) = " GLSL(UnpackHalf2x16) ";" "\n"
"double packDouble2x32(uvec2 v) = " GLSL(PackDouble2x32) ";" "\n"
"uvec2 unpackDouble2x32(double v) = " GLSL(UnpackDouble2x32) ";" "\n"
//geometric functions
SRC_LINE