Commit Graph
929 Commits
Author SHA1 Message Date
teoxoy 04562dea26 Split UnaryOperator::Not into UnaryOperator::LogicalNot & UnaryOperator::BitwiseNot
since it should not be valid to use the logical and bitwise not operators interchangeably

also, don't allow `UnaryOperator::Negate` to operate on booleans (no frontend/backend supports this)
2023-10-16 16:22:06 -07: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
teoxoy c33d7ee40d add an expression constness tracker 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
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
Nicolas Silva 3c7dbc4016 Add StorageFormat::Bgra8Unorm 2023-10-09 17:04:03 +02:00
Teodor Tanasoaia f37db5affc [wgsl] remove outerProduct (#2535) 2023-10-05 19:14:52 +02:00
Teodor Tanasoaia 6668d0694c Add Rgb10a2Uint format (#2525) 2023-10-03 13:36:14 +02:00
Teodor Tanasoaia 613da72ac0 [spv-out] require ClipDistance & CullDistance capabilities if necessary (#2528) 2023-10-03 13:34:56 +02:00
Evan Mark Hopkins 9f3cdb61aa [msl-out] Make varyings' struct members unique (#2521) 2023-09-29 12:26:23 +02:00
Teodor Tanasoaia c927d3ec82 remove duplicated code 2023-09-28 15:16:18 -07:00
Evan Mark Hopkins a898522e10 Rename identifiers containing double underscores (#2510) 2023-09-26 16:46:02 +02:00
Jim Blandy 0c69735f59 Change naga::back::spv::DebugInfo::file_name to a &Path.
This makes it a bit easier to use in the CLI and snapshot tests.
2023-09-25 07:59:41 -07:00
Evan Mark Hopkins dc3d2b1e78 [glsl-out] Polyfill frexp 2023-09-25 13:17:50 +02:00
Jim Blandy b586631efe Small cleanups to backend naming. (#2491)
Document `FunctionType` better.

Use `FunctionCtx` name key methods where appropriate in the WGSL and
HLSL backends.
2023-09-20 19:20:47 +02:00
Jim Blandy 2a47a15f03 cli: Populate dot backend options in Parameters early.
This is a step towards having the output loop depend only on `params`,
rather than both `params` and `args`.
2023-09-20 18:46:33 +02:00
Bruce Mitchener 79c5cb2d04 spv-out: Remove empty else branch. (#2473) 2023-09-13 15:44:02 +02:00
Theo 1281c1156c [spv-out] Always give structs with runtime arrays a Block decoration (#2455) 2023-09-12 19:59:31 +02:00
Jim Blandy 0f36a745cf [wgsl-out] Don't include type parameter in splat expressions. (#2469)
Generate `vec4(1.0)` instead of `vec4<f32>(1.0)`, since WGSL requires
us to infer the type parameter anyway.
2023-09-12 19:34:24 +02:00
Fredrik Fornwall a0eb1f5462 [wgsl-in] Allow sign() to take int argument (#2463) 2023-09-06 09:29:35 -07:00
Fredrik Fornwall 5329aa2bd5 [wgsl-in] Handle modf and frexp (#2454) 2023-09-02 08:55:35 +02:00
Frederik Magnus Johansen Vestreandteoxoy 0491d39232 Support dual source blending (#2427)
Co-authored-by: teoxoy <28601907+teoxoy@users.noreply.github.com>
2023-08-30 21:00:35 +02:00
teoxoy 061d499ddb [spv-out] rename get_image_id to get_handle_id 2023-08-04 10:45:36 -04:00
teoxoy c3e35df576 [spv-out] decorate the result of the OpLoad with NonUniform (not the access chain) when loading images/samplers (resources in the Handle address space) 2023-08-04 10:45:36 -04:00
teoxoy e51b4afa1e clarify binding array of handles comment 2023-08-04 10:45:36 -04:00
Evan Mark Hopkins f7de1942c1 [spv-out] Cache OpConstantNull (#2414) 2023-08-02 18:05:16 +02:00
Fredrik Fornwallandteoxoy dcce91960a [glsl-out] Add built-in functions to keywords (#2410)
* [glsl-out] Add built-in functions to keywords

Fixes #2276 and part of #2366.

* add a few more keywords and document where they come from

---------

Co-authored-by: teoxoy <28601907+teoxoy@users.noreply.github.com>
2023-07-25 16:47:32 +02:00
Evan Mark Hopkins 5f8e4f6dea [spv] Fix OpImageQueries to allow Uints (#2404) 2023-07-24 21:25:45 +02:00
Jim Blandy 409239c0e2 [glsl-out] Various doc fixes. 2023-07-17 16:26:08 -07:00
teoxoy d348d843e1 implement const-expressions (phase 1) 2023-07-17 16:26:08 -07:00
Nicolas Silva 7624d6c78e [glsl-out] textureSize level must be a signed integer. (#2397) 2023-07-04 15:53:29 +02:00
Teodor Tanasoaia a550b0b499 Split image bounds check policy (#2265) 2023-06-29 14:59:37 +00:00
wicast 3ca8b4997d fix(spv-out-debug): fix debug options (#2394) 2023-06-29 13:31:26 +02:00
wicast 25e4f17a69 add debug info for spv-out (#2379) 2023-06-28 14:30:25 +02:00
Elabajaba adf1cca68d Implement Pack/Unpack for HLSL (#2353) 2023-06-23 15:52:22 +02:00
Teodor Tanasoaia ffe2308a60 rename allow_point_size to allow_and_force_point_size (#2280) 2023-06-22 06:36:54 -07:00
Eduard-Mihai Burtescu f915d39a87 [spv-out] Use IndexSet instead of HashSet for iterated sets (capabilities/extensions). 2023-06-21 13:30:01 -07:00
Igor Shaposhnik 304ba5805c [glsl-out] Fix functions with array return type 2023-06-15 14:53:19 +02:00
teoxoy 76003dc003 remove unnecessary macro parameters 2023-06-13 15:08:05 -07:00
teoxoy 08105461ce omit non referenced expressions 2023-06-12 17:49:06 -07:00
teoxoy 763ec5d1a5 complete HLSL reserved symbols 2023-06-12 17:41:53 -07:00
daxpedda b7f4006e46 Bump bitflags to v2 (#2358) 2023-06-01 15:40:47 +02:00
Pieter-Jan Briers 544ccf88da Handle case insensitive FXC HLSL keywords. (#2347)
There are a few keywords like "pass" in HLSL that are actually case-insensitive for FXC. This can be disabled with strict mode, but even if you do that FXC will continue to give an error if you try to use them in identifiers (at all, with any casing).

This changes the namer code to escape these keywords even if the casing is different.

If you're wondering where I got the list from: I looked at the list of strings in D3DCompiler_47.dll.
2023-05-31 15:00:23 +02:00
Daniel McNab 907b7c7cda Workgroup uniform load (#2201)
Implement the WGSL `workgroupUniformLoad` function.
2023-05-26 13:32:22 -07:00
Teodor Tanasoaia 62b287e761 Change type of constant sized arrays to NonZeroU32 (#2337) 2023-05-12 14:38:50 +02:00
teoxoy d842d6688d Introduce GlobalCtx 2023-05-11 09:52:40 -07:00
Jim Blandy 02ddf6532c Introduce Expression::Literal. 2023-05-11 07:09:53 -07:00
Teodor Tanasoaia dcc8615c5b Introduce Expression::ZeroValue. 2023-05-10 19:30:03 -07:00
Jim Blandyandteoxoy 59a2441a43 [msl-out] Revert af4d989 since #764 removes the need for it (#2331)
Assigning arrays by value works fine since all arrays are now wrapped by a struct.

Co-authored-by: teoxoy <28601907+teoxoy@users.noreply.github.com>
2023-05-09 16:20:15 -07:00