Commit Graph

206 Commits

Author SHA1 Message Date
vero
1c48a23cff
Add Metal 3.0 and 3.1 detection (#5497) 2024-04-05 19:22:33 +02:00
Jim Blandy
2ad95b2774 [naga wgsl-in] Allow override expressions as local var initializers.
Allow `LocalVariable::init` to be an override expression.

Note that this is unrelated to WGSL compliance. The WGSL front end
already accepts any sort of expression as an initializer for
`LocalVariable`s, but initialization by an override expression was
handled in the same way as initialization by a runtime expression, via
an explicit `Store` statement.

This commit merely lets us skip the `Store` when the initializer is an
override expression, producing slightly cleaner output in some cases.
2024-04-05 18:07:41 +02:00
teoxoy
7df0aa6364 move the burden of evaluating override-expressions to users of naga's API 2024-04-05 18:07:41 +02:00
Jim Blandy
ba19d8df34 [naga] Adjust RayQuery statements in override processing. 2024-04-05 18:07:41 +02:00
Jim Blandy
906ed128de [naga] Spell out members in adjust_expr. 2024-04-05 18:07:41 +02:00
Jim Blandy
8a2bc07f11 [naga] Handle comparison operands in pipeline constant evaluation.
Properly adjust `AtomicFunction::Exchange::compare` after pipeline
constant evaluation.
2024-04-05 18:07:41 +02:00
Jim Blandy
a7d8ee999d [naga] Add missing newline to test input file. 2024-04-05 18:07:41 +02:00
Jim Blandy
8107f80b7f [naga] Tweak comments in ConstantEvaluator::try_eval_and_append.
I found I needed a little bit more detail here.
2024-04-05 18:07:41 +02:00
Jim Blandy
bb15286df2 [naga] Let filter_emits_with_block operate on a &mut Block.
This removes some clones and collects, simplifies call sites, and
isn't any more complicated to implement.
2024-04-05 18:07:41 +02:00
Jim Blandy
aaf3b17623 [naga] Hoist ConstantEvaluator construction in process_function.
There's no need to build a fresh `ConstantEvaluator` for every
expression; just build it once and reuse it.
2024-04-05 18:07:41 +02:00
Jim Blandy
f464598646 [naga] Simplify uses of replace in back::pipeline_constants. 2024-04-05 18:07:41 +02:00
Jim Blandy
58d1e1f745 [naga] Doc tweaks for back::pipeline_constants. 2024-04-05 18:07:41 +02:00
teoxoy
ca252b9e74 allow private variables to have an override-expression initializer 2024-04-05 18:07:41 +02:00
teoxoy
3abdfde0ba evaluate override-expressions in functions 2024-04-05 18:07:41 +02:00
teoxoy
fd5c4db606 refactor try_eval_and_append body 2024-04-05 18:07:41 +02:00
Jim Blandy
dd315ee39a [naga] Add some documentation to process_overrides and subroutines. 2024-04-05 18:07:41 +02:00
teoxoy
4ede83929c [valid] make sure overrides are not present after evaluation 2024-04-05 18:07:41 +02:00
teoxoy
f1706b994b [valid] error on non fully evaluated const-expressions 2024-04-05 18:07:41 +02:00
teoxoy
e9eb703941 rename const_expressions to global_expressions 2024-04-05 18:07:41 +02:00
teoxoy
fa5406fbb9 rename ExpressionConstnessTracker to ExpressionKindTracker 2024-04-05 18:07:41 +02:00
teoxoy
d6ebd88f42 implement override-expression evaluation for initializers of override declarations 2024-04-05 18:07:41 +02:00
teoxoy
ff332afdef [const-eval] fix evaluation of bool constuctors 2024-04-05 18:07:41 +02:00
teoxoy
a946a6f0ad [const-eval] refactor logic around try_eval_and_append 2024-04-05 18:07:41 +02:00
teoxoy
d7cfe16b79 validate that override ids are unique 2024-04-05 18:07:41 +02:00
teoxoy
2929ec333c [spv/msl/hlsl-out] support pipeline constant value replacements 2024-04-05 18:07:41 +02:00
teoxoy
7ce422c57a remove naga's clone feature 2024-04-05 18:07:41 +02:00
Teodor Tanasoaia
f949ea69c4 [wgsl-in] add support for override declarations (#4793)
Co-authored-by: Jim Blandy <jimb@red-bean.com>
2024-04-05 18:07:41 +02:00
Jim Blandy
b3dfc40c9d [naga] Delete Constant::override and Override. 2024-04-05 18:07:41 +02:00
teoxoy
3bda381812 add pipeline constants plumbing 2024-04-05 18:07:41 +02:00
Erich Gubler
fb305b85f6 docs: add warning about stack size for WGSL compilation 2024-04-03 15:54:43 -04:00
Erich Gubler
b21a3265de fix(wgsl-in)!: limit brace recursion 2024-04-03 15:54:43 -04:00
Erich Gubler
d4b673c88a refactor(wgsl-in): remove unnecessary return Ok(()) 2024-04-03 15:54:43 -04:00
Dzmitry Malyshau
3a467ad93d spv-out: Support arrayLength of a dynamically indexed bindings array 2024-04-02 19:22:34 +02:00
Dzmitry Malyshau
bfe0b90740 spv-out: implement OpArrayLength on array buffer bindings 2024-04-02 19:22:34 +02:00
Christian Legnitto
1fd47b54ab Expose all items in naga::back.
This helps out-of-tree backends.

Fixes https://github.com/gfx-rs/wgpu/issues/5398.
2024-04-02 17:14:13 +02:00
Vecvec
1ead28701d
Fix unused acceleration structures causing invalid SPIR-V (#5463) 2024-04-02 11:06:28 +00:00
Thomas Bork
dc7cbe6e8b
docs: Fix incorrect git URL for naga-cli installation (#5457) 2024-04-02 12:54:27 +02:00
Christian Legnitto
0f4839c466
Include the glsl global name in entrypoint arguments. (#5418) 2024-03-28 18:19:51 +01:00
Jim Blandy
c613fbbeed [naga] Add some documentation for the uniformity analysis.
This is Naga's classic, over-conservative, non-standard-compliant
uniformity analysis. But it's still good to know what the heck it's
doing.
2024-03-28 17:36:58 +01:00
dependabot[bot]
e04a9f4c6f
build(deps): bump the patch-updates group with 29 updates (#5376)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 13:00:43 -04:00
stefnotch
6a5418b93f
Fix 5385 by updating the documentation (#5386)
* Fix 5385 by updating the documentation

* Update changelog
2024-03-13 21:30:50 -04:00
vero
4e6f873da5
Add shader I64 and U64 support (#5154)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-03-12 12:34:06 +01:00
Teodor Tanasoaia
3107f5e148 [mtl-out] Add "assert" to reserved words 2024-03-12 10:52:37 +01:00
Jim Blandy
14dbf8c60e [naga] Document the absence of "phi" expressions. 2024-03-07 12:46:25 +01:00
Jim Blandy
8ee3c414f0 [naga] Document return types of image query operations. 2024-03-07 12:45:22 +01:00
Erik Zivkovic
d417433e0c Naga: GLSL 410 does not support layout(binding = ...)
Naga assumed that GLSL 410 supported layout(binding = ...) but it does not,
it only supports layout(location = ...). It is not possible to enable only
layout(location = ...) currently, so we need to predicate the feature on GLSL
420 instead.
2024-03-07 12:28:26 +01:00
Jim Blandy
ffaabeb921 [naga xtask] Update Cargo.lock for dependabot #5241.
The dependabot PR #5241 made `naga/hlsl-snapshots` depend on nanoserde 0.1.37,
but didn't regenerate `naga/xtask/Cargo.lock`.
2024-03-07 12:14:02 +01:00
Connor Fitzgerald
a5c0181c3a
Bitfield Fixes (#5305) 2024-02-29 20:50:42 +00:00
Jim Blandy
b020b984df
[naga] Fix docs generated by gen_component_wise_extractor. (#5314) 2024-02-29 15:39:27 -05:00
Connor Fitzgerald
8129897ccb Nested loop test 2024-02-28 13:54:27 +01:00