1- import { GenType , DataType } from "./ir_types"
1+ // Need the .js extension because we also import this from a Node script.
2+ // Try to keep this file minimal because of that.
3+ import { GenType , DataType } from "./ir_types.js"
24
35// GLSL Built in functions
46// https://docs.gl/el3/abs
@@ -83,7 +85,7 @@ const builtInGLSLFunctions = {
8385 sqrt : [ { params : [ GenType . FLOAT ] , returnType : GenType . FLOAT , isp5Function : true } ] ,
8486 step : [ { params : [ GenType . FLOAT , GenType . FLOAT ] , returnType : GenType . FLOAT , isp5Function : false } ] ,
8587 trunc : [ { params : [ GenType . FLOAT ] , returnType : GenType . FLOAT , isp5Function : false } ] ,
86-
88+
8789 ////////// Vector //////////
8890 cross : [ { params : [ DataType . float3 , DataType . float3 ] , returnType : DataType . float3 , isp5Function : true } ] ,
8991 distance : [ { params : [ GenType . FLOAT , GenType . FLOAT ] , returnType :DataType . float1 , isp5Function : true } ] ,
@@ -103,12 +105,12 @@ const builtInGLSLFunctions = {
103105 ] ,
104106 reflect : [ { params : [ GenType . FLOAT , GenType . FLOAT ] , returnType : GenType . FLOAT , isp5Function : false } ] ,
105107 refract : [ { params : [ GenType . FLOAT , GenType . FLOAT , DataType . float1 ] , returnType : GenType . FLOAT , isp5Function : false } ] ,
106-
108+
107109 ////////// Texture sampling //////////
108110 texture : [ { params : [ DataType . sampler2D , DataType . float2 ] , returnType : DataType . float4 , isp5Function : true } ] ,
109111 getTexture : [ { params : [ DataType . sampler2D , DataType . float2 ] , returnType : DataType . float4 , isp5Function : true } ]
110112}
111113
112114export const strandsBuiltinFunctions = {
113115 ...builtInGLSLFunctions ,
114- }
116+ }
0 commit comments