Commit Graph
68 Commits
Author SHA1 Message Date
Pelle Johnsen 2fa8eb596d [spv-out] Add initial Rosetta test (#181)
* [spv-out] Add initial Rosetta test

For now just check that spv-out succeeds

* [spv-out] Check spv output has len > 0
2020-09-10 00:32:02 -04:00
Dzmitry Malyshau c122e064a7 Move storage class from image type into the global declaration (#182) 2020-09-09 13:59:29 -04:00
Timo de Kort a3bac5ee0f [Spirv-out] Move instructions to own module (#174)
* [spirv-out] Move instructions to own module

* [spirv-out] Fix wrong function use of some instructions

* [spirv-out] Update instruction parameters

* [spirv-out] Update current instruction tests

* [spirv-out] Order current instruction tests

* [spirv-out] Add missing instruction tests
2020-09-06 00:35:59 -04:00
Timo de Kort 9ba075c990 [spirv-out] Implement FunctionCall 2020-09-01 23:56:43 -04:00
Timo de Kort c56013b46e [spirv-out] Implement FunctionParameter 2020-09-01 23:56:43 -04:00
Timo de Kort b7d834ed33 [spirv-out] Implement return value for functions 2020-09-01 23:56:43 -04:00
Timo de Kort dc38fc115b [spirv-out] Add OpFunctionParameter 2020-09-01 23:56:43 -04:00
Matus Talcik b67739034e Implement Execution Modes (#169)
Add documentation, make clippy happy


Compilation errors


Add some more docs


Few more compilation errors


Changes based on the review


glsl-new parser fix


Set default local size to (0, 0, 0)


final cleanup


Last design


New design
2020-08-31 14:34:38 -04:00
Dzmitry Malyshau dc442343d6 Make TypeInner to be non-clonable 2020-08-28 19:37:39 -04:00
Matus Talcik 7a43c78e29 Add storage formats (#167)
Add GLSL backend


Add SPIR-V back + front
2020-08-28 14:55:30 -04:00
João Capucho 73204d094c glsl-out: fixes (#164)
* Fixed not generating wrong op on booleans
Correctly handle storage images and sampled images

* Fixed comments
2020-08-27 18:01:19 -04:00
Dzmitry Malyshau bd9efe5915 Allow struct members without an origin 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau 462c82fb71 As expressions 2020-08-27 11:49:38 -04:00
Dzmitry Malyshau 4a61705201 Add matrix transposition expression 2020-08-27 11:49:38 -04:00
João Capucho 64bb2104cf glsl-out: Less allocations, handle struct member origin and correctly handle empty names (#160)
* Removed half of the clones
Fixed struct field names with invalid ident

* Fix struct member origin not being respected

* is_valid_ident handles empty names
2020-08-27 10:26:55 -04:00
Dzmitry Malyshau 4797773152 Image IR refactor (#153) 2020-08-26 13:26:51 -04:00
João Capucho f7c5e4873e Made the output of glsl-out more human readable (#154) 2020-08-26 12:29:33 -04:00
João Capucho ac66d149a4 Fixed names beginning with digits and arguments without names (#151) 2020-08-25 15:54:13 -04:00
João Capucho 5d9489871d Add support for glsl es in the glsl backend (#128)
* Initial glsl es 300 support

* Set float default precision

* Generate interface blocks and check storage class in es

* Added more checks on es and fixed uniform blocks with same name type

* Added image checks

* Added the test to the makefile

* applied comments
2020-08-22 10:50:54 -04:00
Lachlan Sneff 8c0b1636ea Interpolation support for wgsl, glsl, glsl-new, spirv (front and back), and glsl-out (#140)
* Add interpolation support to naga core and wgsl

* Add glsl-new fragment shader support to examples/convert.rs

* Add interpolation support to glsl_new

* Add interpolation support to spirv frontend

* Add interpolation support to spirv backend

* Add interpolation support to glsl backend

* Add interpolation support to old glsl backend

* Fix interpolation field syntax in glsl backend

* Formatting fix

* thanks clippy

* Add wgsl struct interpolation decoration

* Change wgsl interpolation syntax

* Modify interpolation enum

* Changes responding to review

* Remove interpolation struct member qualifier

* code changes after review
2020-08-19 20:22:21 -04:00
Timo de Kort 58dd54f938 [spirv-out] Refactor lookup (#88) 2020-08-17 18:16:31 -04:00
Lachlan Sneff fccefaccde Add support for initialization of local variables to glsl backend (#129)
* Add support for initialization of local variables to glsl backend

* Cleanup
2020-08-15 01:46:10 -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
Josh Groves 115c29c022 [msl] Cast single-component scalars (#115)
* [msl] Cast single-component scalars

* [msl] Allow `BinaryOperator::And`
2020-07-24 22:48:14 -04:00
Timo de Kort e55c6b56e2 Fix SPIR-V back-end, width will now be multiplied by 8 (#108) 2020-07-12 14:22:47 -04:00
Dzmitry Malyshau 39998a4c38 Differenciate between local and external function calls at IR level 2020-07-06 14:10:38 -04:00
Paul Kernfeld ec52598d61 Deny on panics with clippy 2020-07-06 00:13:51 -04:00
Dzmitry Malyshau 4a769c10b5 [spv] remove the pointer indirection to variables 2020-07-05 09:33:07 -04:00
Dzmitry Malyshau 33fe3a3dba Struct member origin enum 2020-07-04 11:10:37 -04:00
Dzmitry Malyshau 5d6406b018 Add DepthImage IR type.
Fix all the usage of Bytes type to really mean bytes.
Have logic in the SPIR-V front-end to detect the comparison properties of samplers and images.
2020-07-04 11:10:37 -04:00
Gabriel Majeri c2a220840f Document almost everything 2020-06-29 12:25:48 -04:00
Timo de Kort 713fcaaa11 Spirv backend - Extract instructions to own functions 2020-06-27 08:41:33 -04:00
Dzmitry Malyshau e0a1e80fb5 Remove spirv-headers use from IR, make it optional 2020-06-25 00:37:33 -04:00
Gabriel Majeri 84615eead3 Add support for return value to SPIR-V backend (#79)
* Add test for `glsl_phong_lighting`

* Implement `ReturnValue` op for SPIR-V backend
2020-06-22 16:11:40 +02:00
Timo de Kort 9940460fe6 Add basic tests for SPIR-V back-end writer 2020-06-21 15:11:03 -04:00
Dzmitry Malyshau a9228d2aed Add member offsets and array strides 2020-06-19 08:45:04 -04:00
Timo de Kort 0a781f4ce7 Add Layout Tests
Add Physical Layout test

Add Instruction tests

Add Logical Layout test
2020-06-18 17:19:36 -04:00
Dzmitry Malyshau d55cd79a21 Minor improvements, expose Handle, move glsl module inside the dir. 2020-06-16 22:54:26 -04:00
Dzmitry Malyshau 89d2afa11b Comparison sampler API (#66) 2020-06-16 14:55:40 -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
João Capucho 706a88e21c Fix clippy errors (#62)
* Move from travis to github actions (#58)

* Added github actions

* Remove travis

* Fixed clippy warnings

* Add the clippy check to ci

* Move workflows to .github

* Fix missing clippy
2020-06-08 16:00:46 -04:00
Paul Kernfeld 2a3fc6dc54 Replace panics with errors in Metal backend
Fixes #31
2020-05-20 11:18:18 -04:00
Paul Kernfeld e2bd93aa21 Replace write! with TypedGlobalVariable::try_fmt
A step towards #31
2020-05-19 12:48:32 -04:00
Timo de Kort 1a1f6a47b0 add support for ConstantComposite 2020-03-28 14:58:45 -04:00
Dzmitry Malyshau 3ea6ca428f Move the global usage into the IR function 2020-03-20 16:23:35 -04:00
Dzmitry Malyshau 55fab04353 Refactor the interface processor, many improvements in global variables handling in MSL 2020-03-19 22:36:26 -04:00
Dzmitry Malyshau 80a9254dbe Interface processor 2020-03-19 18:04:58 -04:00
Dzmitry Malyshau 0de28d1656 [msl] operators, array access, and built-in calls 2020-03-15 23:59:49 -04:00
AIOOB 1ac92cd942 Fixup clippy lints and remove unsafe 2020-03-15 21:09:08 -04:00