Commit Graph

318 Commits

Author SHA1 Message Date
Ashley
14e2152198
Add an read_clock_khr function that calls OpReadClockKHR (#757)
* Add support for OpReadClockKHR

* Use a const scope

* Use full scope import path

* Apply some suggestions

* Add cfg flags and scopes as raw u32s

* Run cargo fmt

* Fix comment accuracy

* Update crates/rustc_codegen_spirv/src/spirv_type_constraints.rs

Co-authored-by: Ashley Hauck <953151+khyperia@users.noreply.github.com>

* Run rustfmt

* Add the shader clock feature and capability to the compile test rust flags and bless the changed test errors

Co-authored-by: Ashley Hauck <953151+khyperia@users.noreply.github.com>
2021-10-08 15:56:00 +02:00
Ashley
4e5f347239
Add SampledImage::sample_by_lod (#755)
* Add 'SampledImage::sample_by_lod'

* Add a compiletest

* Format the compiletest, but manually because running cargo fmt doesn't seem to do anything 🤷

* Run rustfmt
2021-10-08 10:33:00 +02:00
Ashley Hauck
b692ab5afc
Convert Image<> parameters from enums to integers to make spirv-std build on stable (#761)
* Convert Image<> parameters from enums to integers to make spirv-std build on stable

* Remove access_qualifier from Image type

It's kernel-mode-only, and we won't ever support kernel mode.
2021-10-07 13:28:33 +02:00
Johan Andersson
2540106965
Support glam 0.18 (#760) 2021-10-05 09:24:18 +02:00
Eduard-Mihai Burtescu
6780432b37 rustup: update to nightly-2021-09-29. 2021-09-30 09:26:11 +03:00
Jake Shadle
35172f7edb
Update spirv-tools to 0.7.0 (#753)
This moves to the v2021.3 version of SPIRV-Tools
2021-09-17 11:42:43 +00:00
Ashley Hauck
eeb67ae748
Replace <const INTERSECTION: u32> with two functions (#750)
* Replace <const INTERSECTION: u32> with two functions

* Fix doc URLs
2021-09-07 11:30:56 +02:00
Eduard-Mihai Burtescu
6807c5973d Re-add -Zsymbol-mangling-version=v0. 2021-09-07 12:24:38 +03:00
Eduard-Mihai Burtescu
75f81814ec rustup: update to nightly-2021-08-27. 2021-09-07 12:24:38 +03:00
Ashley Hauck
92dc64bd06
Make byte addressable buffer take &self, add support for matrix (#749) 2021-09-06 08:47:34 +00:00
Ashley Hauck
95da8981ad
Add load/store_unchecked to ByteAddressableBuffer without bounds check (#746) 2021-09-03 12:10:01 +00:00
Ashley Hauck
71d6001bed
Actually set the SPIR-V generator magic number (#743)
wow this took a while to do
2021-09-01 13:32:11 +02:00
Ashley Hauck
032286e217
Add a spirv-builder option to include all debug info (#742) 2021-09-01 06:05:43 +00:00
Ashley Hauck
66d6c554d8
Implement ByteAddressableBuffer prototype detached from bindless (#735) 2021-08-31 10:26:30 +02:00
Markus Siglreithmaier
f0560824fe
std: fix ray query initialization and proceed result (#740) 2021-08-31 10:09:05 +02:00
hatoo
b0676cba61
Implement OpTypeMatrix (#738)
* Implement OpTypeMatrix

* clippy

* Use cached Symbol

* Implement #[spirv(matrix(ty, m, n))] instead of Matrix trait

* Update #[spirv(matrix(..))]

- #[spirv(matrix(ty, m, n))]
  Specify all of type, rows, columns.
- #[spirv(matrix(ty, m))]
  Specify all of type, rows. Infer columns.
- #[spirv(matrix(ty))]
  Specify all of type. Infer others.
- #[spirv(matrix)]
  Infer all.

* Drop #[spirv(matrix(..))] (with arguments)

* Fix IntrinsicType::Matrix type construction

* Update matrix-type.rs

* Update tests/ui/spirv-attr/multiple.rs to test Matrix

* Fix tests/ui/spirv-attr/matrix-type.rs

* Add failing tests for #[spirv(matrix)

* Update error messages for #[spirv(matrix)]
2021-08-30 15:45:29 +02:00
Ashley Hauck
1e3881bfcb
Various fixes and cleanup (#726)
* Various fixes and cleanup

While working on other patches that ended up not being applicable, I've
gathered these changes unrelated to the irrelevant patch. So, submitting
them as a seperate change, since the bigger change isn't going in.

* Revert change superseded by #732
2021-08-21 21:41:46 +02:00
khyperia
44ae4411ee Revert no-longer-needed OpTypeArray support 2021-08-20 12:20:14 +03:00
khyperia
f9c7829bdc Fix typo 2021-08-20 12:20:14 +03:00
khyperia
0bd0bf0f11 Fix issues with some raytracing functions and add tests 2021-08-20 12:20:14 +03:00
Eduard-Mihai Burtescu
2d5b8e6b0e Get the default panic hook for ICEs, from std::panic::set_hook. 2021-08-20 11:45:39 +03:00
Ashley Hauck
ee3d5afe63
Update rspirv to 0.10 (#724) 2021-08-20 11:24:26 +03:00
Eduard-Mihai Burtescu
9a69d6dccc specializer: allow unused fully-constrained interface variables. 2021-08-19 18:20:27 +03:00
Eduard-Mihai Burtescu
f14046477a
link: remove workaround for mdsteele/rust-ar#19. (#730) 2021-08-19 08:45:29 +02:00
Eduard-Mihai Burtescu
4dcb50169f link: rely on the default metadata loader. 2021-08-13 17:32:10 +03:00
Eduard-Mihai Burtescu
731a5e86aa link: switch from tar to ar for .rlibs. 2021-08-13 17:32:10 +03:00
Eduard-Mihai Burtescu
5a431e65a1 link: use METADATA_FILENAME instead of hardcoding ".metadata". 2021-08-13 17:32:10 +03:00
Markus Siglreithmaier
acda7716db
asm: add support for noreturn option (#717)
* asm: add support for noreturn option

OpUnreachable will be appended as terminator at the end of the asm block.

* asm: implicit label after return or abort terminator

* rework handling

* fix tests and add few comments

* fix tests
2021-08-13 08:50:44 +02:00
khyperia
df5b41137b Cargo update 2021-08-12 17:16:07 +03:00
Ashley Hauck
44c9fdd8c5
Release v0.4.0-alpha.12 (#719) 2021-08-12 10:46:32 +00:00
Eduard-Mihai Burtescu
908499744f spirv-builder: switch to \x1f-separated CARGO_ENCODED_RUSTFLAGS. 2021-08-10 16:53:28 +03:00
Eduard-Mihai Burtescu
7501f1895c rustup: update to nightly-2021-08-10. 2021-08-10 16:53:28 +03:00
Ashley Hauck
1a3a12f505
Implement some float packing/unpacking instructions (#709)
* Implement some float packing/unpacking instructions

* Rename f32xN to vecN in packing functions
2021-08-10 13:54:44 +02:00
Eduard-Mihai Burtescu
7f5e2e778e Fix unit tests to not have dead params. 2021-08-10 12:43:15 +03:00
Eduard-Mihai Burtescu
0bbea9e93e Introduce remove_unused_params pass, to run just before zombie removal. 2021-08-10 12:43:15 +03:00
Eduard-Mihai Burtescu
5e23a73c85 Move CallGraph into a new ipo module. 2021-08-10 12:43:15 +03:00
Eduard-Mihai Burtescu
340816ae75 abi: make dig_scalar_pointee search for offsets in all layout fields. 2021-08-10 10:55:39 +03:00
Eduard-Mihai Burtescu
7393c3884f abi: switch scalar_pair_field_index to an offset. 2021-08-10 10:55:39 +03:00
Eduard-Mihai Burtescu
c1cdc4707c abi: use scalar_pair_field_index instead of index in some places. 2021-08-10 10:55:39 +03:00
Ashley Hauck
12c09cbc5a
Remove implicit bindless and kernel modes (#710)
* Remove +bindless mode

* Remove +kernel mode
2021-08-10 08:23:24 +02:00
Daniel McNab
9fcc4824af
Use just the small version (#705) 2021-08-09 08:58:52 +02:00
Ashley Hauck
a93d6e0f2a
Add sample_bias and gather functions (#704)
* Add sample_bias function

* Update line numbers

* Add gather function

* Update spirv-tools

CI was failing on "Capability SampledRect is not allowed by Vulkan 1.1
specification (or requires extension)", except locally it was fine, and
I have more up to date spirv-tools than CI, so try bumping the CI
version to see if it's just an out-of-date spirv-val

* Fix gather() in vulkan

* Convert compiler valication into marker traits
2021-08-06 15:26:30 +02:00
Alex Es
bca7656c8c
Added a transformation that gets rid of temporary composites. (#690)
* Added an optimization that gets rid of temporary composites.

Those temporary composites result from inlining of multi-argument
closures. Not only are they rather useless, they're also sometimes
invalid, when an argument to said closure is e.g. a pointer.

* Correctness fixes to transitive unused removal:

- delay only if the instruction is in reference set
- properly mark composites being inserted into composites as used

* cargo fmt

* clippy

* Make transformation per-function & rely on DCE for eliminating dead constructs.

* Forgot to mark CompositeInsert as pure & additional line cleaning

* Rustfmt

* Remove duplicate lines only once
2021-08-06 10:52:56 +02:00
Alex Es
d548268140
Aggressively prune no-side-effect instructions during DCE. (#691)
* Aggressively prune no-side-effect instructions during DCE.

Since we're walking all the instructions anyway, it's practically
zero-cost.

* Reverse iteration order within a function.

This allows to root more instructions per `spread_roots`
invocation, becoming zero-cost in absence of loops.

* Manually iterate over function instructions in reverse order.
2021-08-04 08:03:38 +00:00
bjorn3
cccb9737d7
Use DefaultMetadataLoader for loading dylib metadata (#698) 2021-08-03 10:20:46 +00:00
Ashley Hauck
819365cbae
Release v0.4.0-alpha.11 (#702) 2021-08-02 14:02:02 +00:00
Ashley Hauck
62799d06cc
Make BuilderSpirv::has_capability and has_extension O(1) (#688) 2021-08-02 13:13:48 +02:00
khyperia
febd253d7b Bypass rspirv O(n^2) deduplication 2021-06-24 16:55:40 +03:00
Ashley Hauck
06f0aa2c3a
Release v0.4.0-alpha.10 (#679) 2021-06-23 09:32:09 +02:00
Ashley Hauck
428824be94
Add option to treat warnings as errors (#683) 2021-06-22 13:44:51 +00:00