From a938f1c507f3827dcf8c769c6c42af9c7f2512fa Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 5 Dec 2024 12:17:23 +0900 Subject: [PATCH] [qfcc] Define the glsl mix builtins Unfortunately, it turns out that generic functions are over-grouped so all functions with the same name get the last definition, so `mix` with a float (which should get GLSLstd450FMix) gets the bool version instead (SpvOpSelect). --- tools/qfcc/source/glsl-builtins.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/qfcc/source/glsl-builtins.c b/tools/qfcc/source/glsl-builtins.c index 2c357005e..ed5b9611c 100644 --- a/tools/qfcc/source/glsl-builtins.c +++ b/tools/qfcc/source/glsl-builtins.c @@ -435,15 +435,15 @@ SRC_LINE "genIType clamp(genIType x, int minVal, int maxVal);" "\n" "genUType clamp(genUType x, genUType minVal, genUType maxVal);" "\n" "genUType clamp(genUType x, uint minVal, uint maxVal);" "\n" -"genFType mix(genFType x, genFType y, genFType a);" "\n" -"genFType mix(genFType x, genFType y, float a);" "\n" -"genDType mix(genDType x, genDType y, genDType a);" "\n" -"genDType mix(genDType x, genDType y, double a);" "\n" -"genFType mix(genFType x, genFType y, genBType a);" "\n" -"genDType mix(genDType x, genDType y, genBType a);" "\n" -"genIType mix(genIType x, genIType y, genBType a);" "\n" -"genUType mix(genUType x, genUType y, genBType a);" "\n" -"genBType mix(genBType x, genBType y, genBType a);" "\n" +"genFType mix(genFType x, genFType y, genFType a) = " GLSL(46) ";" "\n" +"genFType mix(genFType x, genFType y, float a) = " GLSL(46) ";" "\n" +"genDType mix(genDType x, genDType y, genDType a) = " GLSL(46) ";" "\n" +"genDType mix(genDType x, genDType y, double a) = " GLSL(46) ";" "\n" +"genFType mix(genFType x, genFType y, genBType a) = " SPV(169) ";" "\n" +"genDType mix(genDType x, genDType y, genBType a) = " SPV(169) ";" "\n" +"genIType mix(genIType x, genIType y, genBType a) = " SPV(169) ";" "\n" +"genUType mix(genUType x, genUType y, genBType a) = " SPV(169) ";" "\n" +"genBType mix(genBType x, genBType y, genBType a) = " SPV(169) ";" "\n" "genFType step(genFType edge, genFType x);" "\n" "genFType step(float edge, genFType x);" "\n" "genDType step(genDType edge, genDType x);" "\n"