Commit Graph
34 Commits
Author SHA1 Message Date
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
Dzmitry Malyshau ca58d413b7 Move NeedBakeExpressions into backends (#1716) 2022-02-04 19:31:48 +00:00
Noel Tautges 42bf3545c9 Standardize some docs (#1660)
* Rewrite front/back doc summaries

- Use line comments instead of block comments
- Standardize language for each front/backend
- Add reference link for each format
- Minor punctuation changes

* Add documentation for keywords module

* Clarify contents of keywords module in summary

* Refer to modules by their type name

* Add basic summary for valid module

* Adjust EarlyDepthTest and ConservativeDepth docs

* Remove "in" from list

* Adjust wording

* Standardize format of docstrings

* Adjust module links to be consistent with other links

* Add summary for reserved keywords list

* Remove extraneous doc spaces with `cargo fmt`

* Correct spelling of whether and rewrite some lines

* Fill out GLSL backend docs

* Remove unnecessary link targets

* Fill out DOT backend docs

* Change module line comments to block comments

* Remove unnecessary spaces

* Fix mistake during rebasing
2022-02-03 13:27:21 -05:00
Jim Blandy 6a5b33fa24 Move BoundsCheckPolicy/Policies into proc, from back. (#1537) 2021-11-17 19:15:59 -08:00
João Capucho 63dbd38edc Make default a switch case (#1477)
* Make default a switch case

Previously the default case of a switch statement was encoded as a block
in the statement but the wgsl spec defines it in such a way that the
default case ordering matters.

* [spv-out] Support for the new switch IR

* [dot-out] Use different labels for default cases
2021-10-26 13:31:54 -04:00
Igor Shaposhnik 3b9dcc568f Move Level from msl to backend module 2021-09-06 21:02:56 -04:00
Jim Blandy 8ef92227c1 Document the bake_ref_count hack. (#1315) 2021-09-01 16:34:33 -04:00
Jim Blandy 28547e3d3b Gather index, buffer, and texture bounds check policies into a single struct. 2021-08-26 19:08:06 -04:00
Jim Blandy bdf774aa8b Rename BoundsCheckPolicy::UndefinedBehavior to Unchecked.
When we are leaning on robust buffer access to do the job for us, there's no
undefined behavior going on. So `UndefinedBehavior` suggests people are doing
something reckless even if they're not. The policy just says what Naga is doing,
and it shouldn't pretend to say what the rest of the system is doing.
2021-08-26 19:08:06 -04:00
Jim Blandy de114e479b Rename IndexBoundsCheckPolicy to BoundsCheckPolicy. 2021-08-22 23:41:27 -04:00
Dzmitry Malyshau a7ac13a61d hlsl: special constants for base vertex/index 2021-07-27 01:49:03 -04:00
João Capucho 2f002a0594 [spv-out] Load texture arguments ahead of time 2021-07-05 02:23:00 -04:00
Gordon-F 0292a2897a Move FunctionCtx into back module 2021-06-22 10:23:27 -04:00
Igor Shaposhnik 3a4d6fa295 Reduce code duplication between backends 2021-06-21 15:33:56 -04:00
Jim Blandy c16f2097ad [spv-out]: Ensure array subscripts are in bounds. 2021-06-18 20:44:07 -04:00
Gordon-F 92a11d0978 [hlsl-out] More improvements. Enable quad snapshot testing 2021-06-15 21:08:05 -04:00
Igor Shaposhnik be6a4172c5 Fix Expression::Load generating (#925)
* [glsl-out] Fix writing named expressions with array types

* [wgsl-out] Remove unsupported builtin from baked expression

* [glsl-out] Add a newline between globals for readability

* Set bake_ref_count to 1 for Expression::Load

* Update snapshot data
2021-06-08 10:15:26 -04:00
Gordon-F 4f5b6c5270 Share some functions between backends 2021-04-25 11:18:31 -04:00
Igor Shaposhnik c1675d06f9 Start wgsl-out (#727) 2021-04-19 00:23:27 -04:00
Timo de Kort 5d487941b2 Start hlsl-out (#408)
* Add hlsl-out feature

* Integrate hlsl-out with snapshots

* Add snapshot
2021-04-11 11:36:26 -04:00
Dzmitry Malyshau 58a4e330dc [glsl-out] fix cached expressions 2021-03-13 11:52:23 -05:00
Dzmitry Malyshau 3fcc0759ed GraphViz backend 2021-03-03 21:20:12 -05:00
Dzmitry Malyshau 89e37d6e90 Explicitly emit expressions by Statement::Emit 2021-03-02 21:50:06 -05:00
Dzmitry Malyshau d6cc17f051 Refactor feature names 2020-09-15 07:51:45 -04:00
Dzmitry Malyshau e99c715160 glsl: use typifier in the backend 2020-09-15 07:51:45 -04:00
Dzmitry Malyshau dc442343d6 Make TypeInner to be non-clonable 2020-08-28 19:37:39 -04:00
Dzmitry Malyshau 4797773152 Image IR refactor (#153) 2020-08-26 13:26:51 -04:00
João Capucho a16204456e WIP: glsl 450 backend and common glsl module (#123)
* Initial backend implementation

* Refractored glsl450 backend to have a common module between further glsl backends
Implemented more missing functionality

* Error handling

* Implemented most of the suggestions

* Addresed all comments
Fixed some bugs

* Made code style consistent
2020-08-11 16:20:23 -04:00
Gabriel Majeri c2a220840f Document almost everything 2020-06-29 12:25:48 -04:00
Dzmitry Malyshau e0a1e80fb5 Remove spirv-headers use from IR, make it optional 2020-06-25 00:37:33 -04:00
Timo de Kort 82573b288b Implement basic SPIR-V back-end (#46) 2020-06-15 16:01:00 -04:00
João Capucho f94b486d8b Run cargo fmt and enable monocodus (#63) 2020-06-09 14:49:12 -04:00
Dzmitry Malyshau 0e38eef82d Restructure the project with frontends and backends 2020-02-21 08:23:44 -05:00