Commit Graph

28 Commits

Author SHA1 Message Date
charles-r-earp
32c2ea58bc
Compute Shaders + ExecutionMode's (#195)
* Created examples/ wgpu-example-compute-runner + wgpu-example-compute-shader.

* Working compute example, can compile and run, set local_size. Validated changes do not break rendering example.

* Added complete list of ExecutionMode's to be specified underneath ExecutionModel. Replaced SpirvAttribute::Entry ExecutionModel with an Entry struct, which includes a Vec of ExecutionMode, ExecutionModeExtra to be submitted in entry.rs. Compute example runs. Passes all tests.

* Changed Cargo license info for compute examples. Simplified compute runner to be more similar to other wgpu example. Split of entry logic in symbol.rs to separate function. Fixed issue in builder/mod.rs.

* Pulled in reorganization changes to crates + examples. In symbols.rs moved really_unsafe_ignore_bitcasts to its own Symbol match. In entry.rs, entry stubs now return the fn_id, so that entry_stub() can add the execution modes in one place. Passed all tests.

* cargo fmt

* Removed duplicate examples. Fixed cargo fmt bug in compute runner.
2020-11-10 08:10:21 +00:00
Johan Andersson
8bec12831a Upgrade to latest glam fork rev 2020-10-31 00:38:23 +01:00
Gray Olson
b12a2f3f6a
Cleanup pass on example shader and vk example-runner (#109)
* get rid of vertex buffers in example

* get rid of unused attributes in example shader

* use negative viewport height to match wgpu

* remove depth buffer

* use SRGB surface

* improve tonemapping

remove 'gamma correction' in favor of hardware srgb support

* make clippy happy

* move tonemapping out of sky(), rename gl_pos to builtin_pos

* rename shaders and use sky shader in wgpu example runner

* apply srgb OETF and invert clip space for cpu example runner

* restructure example directory structure according to #170

* update winit in wgpu example runner

* fix deny.toml example crate refs

* fix ci example name on maOS

* example-shader -> sky-shader in docs

* update sky shader image

* re-enable clippy and make it happy
2020-10-30 11:38:47 -07:00
Johan Andersson
98eb8d369c
Convert to use glam for math types (#149)
* [spirv-std] Remove math types

* Temp implementation of copysign

https://github.com/EmbarkStudios/rust-gpu/issues/148

* Convert shader to use glam

* Rustfmt

* Fix wgpu-example-shader to use glam

* [spirv-std] Disable clippy::use_self

* Upgrade to latest glam branch

* Use latest glam fork

* Remove incorrect assert_uninit

After discussions with @khyperia

* Update lockfile

* Update to latest glam fork with fixes

* Use real copysign intrinsic

* Disable clippy on example-shader for now

Tracked in https://github.com/EmbarkStudios/rust-gpu/issues/186
2020-10-30 14:58:38 +01:00
Jake Shadle
307d0da66b
Add spirv-tools and spirv-tools-sys crates to wrap usage of spirv-tools (#179)
* Add spirv-headers and spirv-tools as submodules

* Add simple generator and the generated code needed for compilation

* Add first pass on spirv-tools-sys

* Add first pass on spirv-tools

* Replace invocation of spirv-opt with spirv-tools crate

* Use C++11

* Placate clippy

* Add validation, replacing spirv-val with the spirv-tools crate

* Fix MSVC warning

* Use patched spirv-tools

* Fixup metadata

* Add same compiler flags as "official" build scripts

* Update spirv-tools and generated files

* Fixup

* Add assembler and example

* Use assembler in tests

* Oops, fix macos TARGET_OS

* write -> write_all

* Start splitting spirv-tools into a compiled vs tool feature set

* Checkpointing

* Checkpoint

* Boop

* Get tests to work both with installed and compiled tools

* Cleanup CI config

* Splits steps to clearly show how long each part of a longer (eg test)
step actually takes
* Label all steps

* Explicitly disable submodule checkout

* Rustfmt

* Rename features for consistency and fix clippy warnings

* Split "core" crates from examples

* Add run_clippy bash script

* Add test script

* Remove x flag

* Newline

* Actually print out errors from running val/opt

* Revert drive-by import merging

* Change intro to take the changes this PR has into account

* Actually run tests on Windows

* Fetch only the host target to reduce fetch times

* Add more info when a spirv tool returns a non-zero exit code

* Rustfmt

* Switch tool assembler to use files to see if it fixes windows

* Use files for input and output for now until I can figure out Windows being dumb

* Fix API docs generation

* Compile and use C++ code to check Windows issue

* Return to use installed tools
2020-10-29 23:03:07 +01:00
Jake Shadle
5aa7453b19 Revert "Replace usage of spirv-* binaries with spirv-tools rust crate (#117)"
This reverts commit 0bfe303a64.
2020-10-29 22:34:26 +01:00
Jake Shadle
0bfe303a64
Replace usage of spirv-* binaries with spirv-tools rust crate (#117)
* Add spirv-headers and spirv-tools as submodules

* Add simple generator and the generated code needed for compilation

* Add first pass on spirv-tools-sys

* Add first pass on spirv-tools

* Replace invocation of spirv-opt with spirv-tools crate

* Use C++11

* Add validation, replacing spirv-val with the spirv-tools crate

* Use patched spirv-tools

* Fixup metadata

* Add same compiler flags as "official" build scripts

* Update spirv-tools and generated files

* Add assembler and example

* Use assembler in tests

* Start splitting spirv-tools into a compiled vs tool feature set

* Get tests to work both with installed and compiled tools

* Cleanup CI config

* Splits steps to clearly show how long each part of a longer (eg test)
step actually takes
* Label all steps

* Explicitly disable submodule checkout

* Rename features for consistency and fix clippy warnings

* Split "core" crates from examples

* Add run_clippy bash script

* Add test script

* Change intro to take the changes this PR has into account

* Fetch only the host target to reduce fetch times

* Add more info when a spirv tool returns a non-zero exit code

* Use files for input and output for now until I can figure out Windows being dumb
2020-10-29 21:54:25 +01:00
Ashley
1b99a9ce20
Fix compilation of wgpu runner on wasm (#159) 2020-10-27 14:34:02 +00:00
Ashley Hauck
06fdb85d61
Add dis_fn testing function (#155)
* Add dis_fn testing function

* Update spirv-builder/src/test/mod.rs

Co-authored-by: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com>

Co-authored-by: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com>
2020-10-27 10:35:53 +00:00
Viktor Zoutman
27df71f492
WGPU example (#92) 2020-10-27 02:39:56 +01:00
Johan Andersson
fe18434bff
Add example to evaluate sky shader on CPU (#141) 2020-10-26 15:49:01 +01:00
Ashley Hauck
8681464af7
Add framework for compiler tests (#118) 2020-10-23 18:22:36 +02:00
Ashley Hauck
0710f9d4b5
Include example-shader in the workspace (#87)
* Include example-shader in the workspace

* Fix clippy warnings

* Fix up tests and clippy warnings

* Change clamp_ to saturate

Co-authored-by: Jasper Bekkers <bekkers@gmail.com>
2020-10-22 12:30:17 +02:00
Ashley Hauck
8516dc161d
Winit update to v0.23 (#86)
* Extremely hacky winit update

* Only render when redraw is requested

* cargo fmt

* Renamed smoothstep

Co-authored-by: Jasper Bekkers <bekkers@gmail.com>
2020-10-22 12:23:11 +02:00
Johan Andersson
14352a79be [example] Remove unused image crate dependency 2020-10-21 20:43:46 +02:00
khyperia
96bb94f9fe Merge rspirv-linker into rustc_codegen_spirv 2020-10-19 10:20:29 +02:00
Ashley Hauck
fb2ed4d26c
Convert panics to compiler errors (#66)
This is a first pass, some fatals could probably be turned into errors.
2020-10-16 12:59:04 +02:00
XAMPPRocky
16f7268edb
Add support for macos in example-runner (#60) 2020-10-14 18:33:37 +02:00
Johan Andersson
9d98620d24
Togglable Vulkan debug layer in example (#53)
Disabled it by default as it requires the Vulkan SDK to be installed.

Can be enabled with  `-d` / `--debug-layer`
2020-10-13 23:42:15 +02:00
khyperia
80398d8149 Rebuild shader crates if changed 2020-10-10 12:25:05 +02:00
khyperia
60a4164ca1 Reference rustc_codegen_spirv in spirv-builder
This makes the UX much better. It's also kind of bonkers, but, in a good
way. I think.
2020-10-09 20:01:35 +02:00
khyperia
1516d864f3 First try at spirv-builder 2020-10-09 17:22:07 +02:00
khyperia
01845cf930 use bimaps, they're neat! 2020-09-23 10:39:51 +02:00
khyperia
cc916c784e Documentation, code shuffling, and RPO block sorting 2020-09-22 15:51:30 +02:00
khyperia
82b596cb97 rustup update 2020-09-22 09:15:08 +02:00
Jasper Bekkers
9697c22740
Linker perf (#33)
* Improve linker performance - this should loop over data significantly less

* Remove Rc and RefCell because they weren't needed in the end

* Moved some code into a DefUseAnalyer

* Point to same rspirv

* Link to rspirv git instead of locally
2020-09-17 10:55:44 +02:00
khyperia
2a66153840 Add spirv-std crate 2020-09-15 15:17:27 +02:00
khyperia
c5dfee6e1e Start work on integrating linker 2020-09-11 13:09:06 +02:00