Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calls to functions should accept Resources instead of plain identifiers. #357

Open
iwoplaza opened this issue Sep 19, 2024 · 0 comments
Open
Milestone

Comments

@iwoplaza
Copy link
Collaborator

Calls to functions have to accept Resources in order to adjust their functionality based on the type of arguments.

E.g.:

Wrapping i32 and u32 expressions with f32 to minimize explicit casts in these obvious cases.

const val_u = u32(123);
const val_i = i32(123);

vec3f(val_u) // vec3f({ value: '123', dataType: U32 }) -> `vec3f(f32(val_u))`
vec3f(val_i) // vec3f({ value: '123', dataType: I32 }) -> `vec3f(f32(val_i))`
// AbstractInt and AbstractFloat are left as they are
vec3f(123) // vec3f({ value: '123', dataType: AbstractInt }) -> `vec3f(123)`
vec3f(0.5) // vec3f({ value: '123', dataType: AbstractFloat }) -> `vec3f(0.5)`
@iwoplaza iwoplaza added this to the 0.3.0 - TGSL milestone Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant