Skip to content

Commit

Permalink
glsl-in: Perform output parameters implicit casts
Browse files Browse the repository at this point in the history
Glsl defines under `Function Definitions` (Paragraph 6.1 in glsl 4.60),
the following:

> When function calls are resolved, an exact type match for all
> the arguments is sought.
> (...)
> If no exact match is found, then the implicit conversions in
> section “Implicit Conversions” will be applied to find a match.
> (...)
> Mismatched types on output parameters (out or inout) must have a
> conversion from the formal parameter type to the calling argument type.

The glsl frontend wasn't performing this implicit cast for output parameters.

This commit fixes that by using a proxy write, this
creates a spill variable with the correct type and in the call
prologue a conversion is made back to the original type and the
value is stored in the original variable.
  • Loading branch information
JCapucho committed Feb 8, 2023
1 parent 2d0aab8 commit 0e8c872
Showing 1 changed file with 232 additions and 122 deletions.
Loading

0 comments on commit 0e8c872

Please sign in to comment.