teoxoy
6044c5443c
[gles] simplify cubemap tracking
2023-10-13 23:59:30 -04:00
Nicolas Silva
ff306d20e0
Add support for bgra8unorm-storage ( #4228 )
...
* Add `BGRA8UNORM_STORAGE` extension
* Leave a comment in the backends that don't support bgra8unorm-storage
* Pass the appropriate storage format to naga
* Check for bgra8unorm storage support in the vulkan backend
* Add a test
Co-authored-by: Jinlei Li <jinleili0@outlook.com >
Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com >
2023-10-13 10:07:11 +00:00
Teodor Tanasoaia
6c8ccdeaa9
[gles] enable/disable blending per attachment only when available (on ES 3.2 or higher) ( #4234 )
2023-10-12 20:22:42 -04:00
Jim Blandy
9df73c5c6e
Update naga to 0.13.0@git:9eb3a1dc (const expressions) ( #4233 )
2023-10-12 11:56:46 -04:00
Jim Blandy
9eb3a1dc8a
[wgsl-out] Generate correct code for bit complement on integers.
...
Remove incorrect special case for `UnaryOperator::Not` on vectors.
2023-10-12 13:18:19 +02:00
Jim Blandy
1b485ea925
[wgsl-in] Don't double-initialize variables local to loops.
2023-10-12 13:13:26 +02:00
teoxoy
f7e15bf391
[valid] check local variable initializer is const
2023-10-12 13:13:26 +02:00
Jim Blandy
a3ba3259fe
Some documentation for ConstantEvaluator.
2023-10-12 13:13:26 +02:00
Jim Blandy
504b33d8cd
[wgsl-in] Document necessity of force_non_const.
2023-10-12 13:13:26 +02:00
teoxoy
4f453b4041
avoid const-evaluating the operators.wgsl snapshot
2023-10-12 13:13:26 +02:00
teoxoy
a77f6ff51c
[const-eval] error on NaN and infinite floats
2023-10-12 13:13:26 +02:00
teoxoy
d8ceeae3b2
Avoid FXC's error X3694: race condition writing to shared resource detected
2023-10-12 13:13:26 +02:00
Jim Blandy
ca2e810492
Properly recognize Literal expressions as non-dynamic indices. ( #2537 )
...
Restore `negative_index` test in `tests/wgsl-errors.rs`, as part of
the `invalid_arrays` test function.
2023-10-12 13:13:26 +02:00
teoxoy
c5b2afaf78
[const-eval] error on invalid binary operations
2023-10-12 13:13:26 +02:00
teoxoy
13a0ed4eae
[const-eval] evaluate BinaryOperator::Modulo correctly (use the truncated version instead of floored)
2023-10-12 13:13:26 +02:00
teoxoy
a9c28d47c3
[const-eval] allow bitcast, select and relational functions for GLSL since they should be supported
2023-10-12 13:13:26 +02:00
teoxoy
4945b7a803
[const-eval] implement pow & clamp built-in functions properly
2023-10-12 13:13:26 +02:00
teoxoy
c46a69d993
[const-eval] account for ZeroValue index for AccessIndex expression
2023-10-12 13:13:26 +02:00
teoxoy
d50c384328
[const-eval] check number of arguments for math functions
2023-10-12 13:13:26 +02:00
teoxoy
c2141ab804
[const-eval] add wgsl/glsl behavior switch to evaluator
2023-10-12 13:13:26 +02:00
teoxoy
4e95667a1c
[wgsl] test usage of constants in switch cases
2023-10-12 13:13:26 +02:00
teoxoy
5de27f2078
[wgsl] test const evaluation of division and multiplication
2023-10-12 13:13:26 +02:00
teoxoy
b95a72b2f6
[wgsl] test @workgroup_size attribute with constants
2023-10-12 13:13:26 +02:00
teoxoy
55dd0e1fbc
[wgsl-in] don't treat let declarations as const declarations
2023-10-12 13:13:26 +02:00
teoxoy
3d346977e5
avoid having constants pointing to other constants
2023-10-12 13:13:26 +02:00
teoxoy
648540999e
[wgsl-in] use ast spans for errors since they are more accurate
2023-10-12 13:13:26 +02:00
Jim Blandy
c16a298cac
Let ConstantEvaluator see through Constant exprs in Splat exprs.
2023-10-12 13:13:26 +02:00
Jim Blandy
3e4d565576
Let ConstantEvaluator see through Constant exprs in Compose exprs.
2023-10-12 13:13:26 +02:00
Jim Blandy
6bd15e4492
Add snapshot tests for constant evaluation of splats and composes.
2023-10-12 13:13:26 +02:00
teoxoy
c33d7ee40d
add an expression constness tracker
2023-10-12 13:13:26 +02:00
Jim Blandy
ab177af3ba
Test that only constant expressions are hoisted to initializers.
2023-10-12 13:13:26 +02:00
Jim Blandy
bdcb9f6f64
Split const-exprs.rs test into separate functions.
...
Also, just use a single out variable for each type. rather than
introducing a new output variable for every test we add.
2023-10-12 13:13:26 +02:00
Jim Blandy
1a4b526d9a
ConstantEvaluator::swizzle: Handle vector concatenation and indexing ( #2485 )
...
* ConstantEvaluator::swizzle: Handle vector concatenation, indexing.
* Handle vector Compose expressions nested two deep.
* Move `flatten_compose` to `proc`, and make it a free function.
* [spv-out] Ensure that we flatten Compose for OpConstantCompose.
2023-10-12 13:13:26 +02:00
Jim Blandy
f0ac838019
ConstantEvaluator::copy_from: Rename argument handle to expr. ( #2490 )
2023-10-12 13:13:26 +02:00
Jim Blandy
44ca6ac5b3
Document some parts of ConstantEvaluator. ( #2489 )
2023-10-12 13:13:26 +02:00
Jim Blandy
ca69a6b372
Add a bit of logging to ConstantEvaluator. ( #2488 )
2023-10-12 13:13:26 +02:00
Jim Blandy
aa041aafbd
Replace ConstantEvaluator's closure with optional emitter data.
...
Instead of letting the user supply an arbitrary closure for appending
expressions, instead give `ConstantEvaluator` an `Option` that holds
an `Emitter` to interrupt, and a `block` to add any new `Emit`
statements to.
2023-10-12 13:13:26 +02:00
Jim Blandy
77851ebfb6
Move front::Emitter to proc.
...
With the addition of the constant evaluator to the `proc` module, it
is now concerned with constructing expressions. Any code that
constructs expressions will generally also need to deal with `Emit`
statements, which are handled by the `Emitter` type. However,
`Emitter` is private to the `front` module. This patch moves it to
`proc` and makes it accessible to both the constant evaluator and the
front ends.
2023-10-12 13:13:26 +02:00
teoxoy
0e4ac2a98c
[glsl-in] set initializer of local variables
2023-10-12 13:13:26 +02:00
teoxoy
fe7bc01d27
[glsl-in] const eval as soon as possible
2023-10-12 13:13:26 +02:00
teoxoy
3fb4c333a7
use LocalVariable init
2023-10-12 13:13:26 +02:00
teoxoy
a730236b68
[wgsl-in] eagerly evaluate const-expressions
...
[wgsl-in] support const-expressions in attributes
allow `Splat` as an evaluated const-expression type
2023-10-12 13:13:26 +02:00
Teodor Tanasoaia
858d7d590e
Fix features of player tests ( #4232 )
2023-10-11 17:11:47 -04:00
Connor Fitzgerald
c5d884fca8
Add codeowners file
2023-10-11 14:05:04 -04:00
Nicolas Silva
f95d1c55e3
Expose Instance flags ( #4230 )
...
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com >
2023-10-11 17:39:04 +00:00
Colin Edwards
0f7b530ea8
Add WinUI 3 SwapChainPanel support ( #4191 )
2023-10-11 13:36:30 -04:00
Erich Gubler
c1748b2fea
Make more HAL APIs require Debug ( #4226 )
2023-10-11 13:31:37 -04:00
Nicolas Silva
b3135b9320
Properly handle user callbacks in surface_configure ( #4227 )
...
* Properly handle user callbacks in surface_configure
* Add a changelog entry
2023-10-11 09:35:00 +02:00
Nicolas Silva
35ebd4a528
Update naga to 0.13.0@git:33b75a27d93c6574b11b4dd4492b85b5783d6c52 ( #4229 )
2023-10-10 16:54:07 +00:00
Nicolas Silva
33b75a27d9
[wgsl-in] Parse the bgra8unorm storage format ( #2550 )
2023-10-10 09:13:19 -07:00