Commit Graph
13 Commits
Author SHA1 Message Date
Jim Blandy 8b267218a4 Implement module compaction.
Add a new Naga feature, `"compact"`, which adds a new function
`naga::compact::compact`, which removes unused expressions, types, and
constants from a `Module`.
2023-09-20 18:46:33 +02:00
teoxoy d348d843e1 implement const-expressions (phase 1) 2023-07-17 16:26:08 -07:00
Teodor Tanasoaia 62b287e761 Change type of constant sized arrays to NonZeroU32 (#2337) 2023-05-12 14:38:50 +02:00
Jim Blandy 412d5aa62e [wgsl-in] Generate Expression::Literal. 2023-05-11 07:09:53 -07:00
Jim Blandy b209d91168 [spv-out] Properly combine the fixes for #2035 and #2038.
The Vulkan decoration rules require us to distinguish vertex shader
inputs, fragment shader inputs, and everything else, so just pass the
stage to `Writer::write_varying`. Together with the SPIRV storage
class, this is sufficient to distinguish all the cases in a way that
closely follows the spec language.
2022-09-01 15:55:42 -07:00
Nicolas Silva b63436af36 Decorate most builtins as Flat in the spirv writer.
Fixes #2032
2022-09-01 10:27:19 -07:00
Nicolas Silva 6b3c111f3f Don't decorate varyings with interpolation modes at the beginning and end of the pipeline.
Fixes #2036.
2022-09-01 10:17:55 -07:00
Jim Blandy 170faab6db Move invariant bit from Binding::Builtin to Builtin::Position. (#1822)
Use the type system to enforce the rule that the invariant attribute
may only appear on `Position` builtins.
2022-04-13 14:57:05 -07:00
teoxoy d3957c1186 implement invariant attribute 2022-04-10 21:49:23 -07:00
Jim Blandy c84aa77579 [msl-out] Properly rename entry point arguments for struct members. (#1766) 2022-03-08 10:07:30 -05:00
Jim Blandy d44e2ad207 Simplify interpolation defaulting.
Replace `Module::apply_common_default_interpolation` with a simpler function
that handles a single `Binding` at a time. In exchange for the simplicity, the
function must be called at each point function arguments, function results, and
struct members are prepared. (Any missed spots will be caught by the verifier.)

This approach no longer requires mutating types in the arena, a prerequisite for
properly handling type identity.

Applying defaults to struct members when the struct declaration is parsed does
have a disadvantage, compared to the old whole-module pass: at struct parse
time, we don't yet know which pipeline stages the struct will be used in. The
best we can do is apply defaults to anything with a `Location` binding. This
causes needless qualifiers to appear in some output. However, it seems that our
back end languages all tolerate such qualifiers.
2021-09-27 15:17:41 -04:00
Dzmitry Malyshau 52d74e91a4 spv-out: option to emit PointSize 2021-09-15 18:48:18 -04:00
Jim Blandy 933ecc4a44 [spv-out] Rename test snapshot files.
The old filenames were probably based on the shader stage, not the shader
function name, which the PR changed to do in response to a review suggestion.
2021-09-14 18:41:23 -04:00