Commit Graph

682 Commits

Author SHA1 Message Date
Jasper St. Pierre
9ccea8179d naga: Fix textureNumLevels in the GLSL backend
... and reactivate the GLSL test for it.

Fixes issue #6435.
2024-11-04 08:07:23 -08:00
Elie Michel
6a75a73300
[wgpu-core] Return submission index for map_async and on_submitted_work_done to track down completion of async callbacks (#6360) 2024-11-04 14:21:09 +00:00
Erich Gubler
3ecfe7e220
docs(CHANGELOG): ref. #4400 directly in v23 entry (#6488) 2024-11-02 19:41:59 +01:00
Erich Gubler
16f012bc93 fix(naga-cli): allow output files with --stdin-file-path 2024-10-31 16:13:48 -07:00
Jerzy Wilczek
4e47ba4ac0
[wgpu-hal] Change the DropCallback API to use FnOnce instead of FnMut (#6482) 2024-10-31 11:28:41 -04:00
Erich Gubler
8c13d8ff56 feat(wgsl-in): parse diagnostic(…) directives (with unimpl. err.) 2024-10-30 15:39:16 -07:00
Erich Gubler
08c9d8c397 chore: bump WGPU workspace crates to 23 2024-10-30 07:14:10 -07:00
Andreas Reich
1ab5f65c24 docs(CHANGELOG): add missing entry for #6107 2024-10-30 07:14:10 -07:00
Erich Gubler
9bf9bb8de6 style(CHANGELOG): join soft-wrapped lines in Unreleased 2024-10-30 07:14:10 -07:00
Erich Gubler
0ad2753737 docs(CHANGELOG): add Major changes item for Optional entry points 2024-10-30 07:14:10 -07:00
Erich Gubler
cd5f52b154 docs(CHANGELOG): add Major changes item for windows ecosystem migration 2024-10-30 07:14:10 -07:00
Erich Gubler
5e06e2a470 style(CHANGELOG): end entries with periods 2024-10-30 07:14:10 -07:00
Erich Gubler
1a26cc0909 style(CHANGELOG): use imperative tense in #6276 entry 2024-10-30 07:14:10 -07:00
Erich Gubler
276a8a64f4 typo(CHANGELOG): add missing "in" b/w author and PR num. 2024-10-30 07:14:10 -07:00
Erich Gubler
3dfeed691d docs(CHANGELOG): add high-level content for release 2024-10-30 07:14:10 -07:00
Erich Gubler
6a053cf74b docs(CHANGELOG): use imperative tense for #6108 entry 2024-10-30 07:14:10 -07:00
Erich Gubler
14ea19ad4c docs(CHANGELOG): change #6257 entry to match PR title 2024-10-30 07:14:10 -07:00
Erich Gubler
c7587737e1 style(CHANGELOG): restyle unreleased contents a bit 2024-10-30 07:14:10 -07:00
atlv
64a61ee5c6
refactor texture format to scalar conversion (#6451)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2024-10-23 20:06:40 +00:00
Andreas Reich
e23146aa3e
Avoid breaking change: set_bind_group now takes Into<Option<...>> rather than Option<...> (#6452) 2024-10-23 15:29:42 -04:00
Erich Gubler
973084320b docs(CHANGELOG): re-word directive parsing item a bit 2024-10-23 11:01:46 -04:00
Erich Gubler
18f33b0474 feat: implement requires directives 2024-10-23 11:01:46 -04:00
Erich Gubler
bf4cd9cd31 feat(wgsl-in): create skeleton for enable directives
Co-Authored-By: FL33TW00D <chris@fleetwood.dev>
2024-10-22 16:31:07 -04:00
Erich Gubler
28912feb00 fix(naga-cli): reimpl. emit_annotated_error with WithSpan::emit_to_stderr_with_path 2024-10-22 14:42:27 -04:00
Erich Gubler
6f43ee9f17 fix(naga): use Diagnostic from inner in valid. err. presentation
For some reason, the implementation of `Display` for
`ShaderError<WithSpan<ValidationError>>>` is building its own
`Diagnostic` with _only_ the labels populated: no messages or notes.
I don't know why this is, but it seems to have a strict subset of the
information already present in the private implementation of
`WithSpan::diagnostic`.

Fix this by exposing `WithSpan::diagnostic` as `pub(crate)`, and
re-using its output in `impl Display for
ShaderError<WithSpan<ValidationError>>>`.
2024-10-22 14:42:27 -04:00
Erich Gubler
36fab5ce3d fix(msl-out): use namer for <fun>{Input,Output} structs 2024-10-22 10:14:26 -04:00
N.E.C.
e711a35998
Add bounds check to Buffer slice method (#6432)
* Add bounds check to Buffer slice method

* avoid unwrap / double option check by using `map_or`

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-10-22 15:33:05 +02:00
dependabot[bot]
e06f10e0a4
build(deps): bump crate-ci/typos from 1.24.6 to 1.26.0 (#6399)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-10-21 00:23:43 +00:00
Nathan Adams
759c3262ad
Optimise GL fence checking by querying less (#6427) 2024-10-20 20:02:10 -04:00
Erich Gubler
b3f665be7d feat(wgsl-in): create skeleton for parsing directives 2024-10-18 16:08:46 -04:00
Jasper St. Pierre
1b2ef8612d
naga: Add support for textureQueryLevels to GLSL parser (#6415) 2024-10-18 10:07:58 +02:00
Andreas Reich
59f56e0263
Add utils for WebGPU support detection & Instance creation (#6371)
* Utils for WebGPU support detection & Instance creation
Clarifies the docs on `wgpu::Instance` accordingly
* changelog entry
* fix adapter check

---------

Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
2024-10-15 13:15:37 +02:00
teoxoy
bbee35b145 [d3d12] get num_workgroups builtin working for indirect dispatches 2024-10-14 15:22:18 +02:00
Teodor Tanasoaia
7f708edd1f
Ensure safety of indirect dispatch (#5714)
by injecting a compute shader that validates the content of the indirect buffer
2024-10-14 15:02:01 +02:00
Schell Carl Scivally
76b1605090
[spv-in] sampling from depth textures returns a scalar and is splatted (#6384) 2024-10-11 20:24:16 +02:00
Jim Blandy
ed3006ccc6 [naga spv-out] Spill arrays and matrices for runtime indexing.
Improve handling of `Access` expressions whose base is an array or
matrix (not a pointer to such), and whose index is not known at
compile time. SPIR-V does not have instructions that can do this
directly, so spill such values to temporary variables, and perform the
accesses using `OpAccessChain` instructions applied to the
temporaries.

When performing chains of accesses like `a[i].x[j]`, do not reify
intermediate values; generate a single `OpAccessChain` for the entire
thing.

Remove special cases for arrays; the same code now handles arrays and
matrices.

Update validation to permit dynamic indexing of matrices.

For details, see the comments on the new tracking structures in
`naga:🔙:spv::Function`.

Add snapshot test `index-by-value.wgsl`.

Fixes #6358.
Fixes #4337.
Alternative to #6362.
2024-10-11 08:27:15 -07:00
Ronny Chan
73764fdc6a
[naga/wgsl-out]: polyfill inverse function (#6385) 2024-10-11 15:56:12 +02:00
Asher Jingkong Chen
bf33e481f3
[naga msl-out] Implement atomicCompareExchangeWeak for MSL backend (#6265) 2024-10-10 12:45:24 +02:00
Teodor Tanasoaia
d9178a1876 add more changelog items 2024-10-09 16:39:51 -07:00
ChosenName
43cb730d58
[naga] added DrawID (#6325) 2024-10-08 13:00:00 +00:00
Imbris
c5a4b4ecc3
Fix unaligned slice::from_raw_parts in gles push contant handling. (#6341) 2024-10-03 20:40:43 +00:00
Samson
ec89e06a92
Update CHANGELOG with @sagudev contributions to naga (#6339) 2024-09-29 15:13:49 -04:00
Erich Gubler
765c20235e
refactor: use include_wgsl!(…) more (#6326)
This change uses `include_wgsl!(…)` in usages where an
`include_str!("….wgsl")` was used to construct
a `ShaderModuleDescriptor`'s `source, but the `label` was set to `None`.
This should (1) showcase a nice idiomatic convenience we offer in our
examples better, (2) make code more concise, and (3) get some
automatically generated labels in diagnostics where it seems it won't
hurt.
2024-09-26 08:47:57 +02:00
Jasper St. Pierre
390a4169fb naga: Don't consider per-polygon inputs to be subgroup uniform
Implementations can absolutely pack multiple triangles per subgroup.

Fixes #6270.
2024-09-22 03:57:41 -04:00
Erich Gubler
9977edc51f
chore!: remove #[no_mangle] … extern "C" … from fns in bundle_ffi (#6272) 2024-09-21 16:33:13 +00:00
Ben Reeves
9f85f8aeea
fix(wgpu): Raise validation error instead of panicking in get_bind_group_layout. (#6280) 2024-09-20 09:32:01 +02:00
Vecvec
dfc384a7fd
Stop Vulkan generating validation error in build acceleration structures (#6282) 2024-09-18 23:02:25 +02:00
mahkoh
ab9a78c64b
Update parking_lot dependency (#6287)
wgpu-hal does not compile with parking_lot versions that don't contain const Mutex::new.
2024-09-18 13:53:50 +00:00
Schell Carl Scivally
fc85e4f970
spv-in parse more atomic ops (#5824)
* add parsing for spirv::Op::AtomicLoad and spirv::Op::AtomicStore

* spv-in parse AtomicExchange and AtomicCompareExchange

* add atomic i decrement

* bookend atomic store statement with emmitter.finish/emitter.start to suppress a double load expression

bookend atomic result expressions with emitter.finish/start to prevent double defs

* add atomic iadd, isub, smin, umin, smax, umax, and, or, xor

* parse atomic flag test and set, parse atomic flag clear

* remove atomic compare exchange work

* changelog

* moved spirv tests into front/spv/mod.rs

* feature gate atomic spv tests because they require wgsl-[in,out]

* BlockContext::get_contained_global_variable returns Result

* Generate spans covering the entire instruction.

Granted, there is pre-existing code in the SPIR-V front end that gets
this wrong, but:

It doesn't make sense to read `self.data_offset`, and then immediately
pass that to `self.span_from_with_op`. The point of that function is
to make the span cover the entire instruction, operands included.

* Move `From` implementation into spv front end

* doc comments, minor cleanups

* remove parsing of OpAtomicFlagClear and OpAtomicFlagTestAndSet

* sync atomic spvasm files

---------

Co-authored-by: Jim Blandy <jimb@red-bean.com>
2024-09-18 05:39:36 +00:00
Ben Reeves
2fac5e983e
Properly handle the case where Navigator.gpu is undefined and WebGPU is the only compiled backend (#6197)
* Properly handle the case where `Navigator.gpu` is undefined and WebGPU is the only compiled backend.

Previously, `Instance::request_adapter` would invoke a wasm binding with an undefined arg0,
thus crashing the program. Now it will cleanly return `None` instead.

Fixes #6196.

* Fix typo in `Instance::new` doc comment.
* Add note to CHANGELOG.md
* Introduce `DefinedNonNullJsValue` type.
* Assert definedness of self.gpu in surface_get_capabilities.
* Use DefinedNonNullJsValue in signature of get_browser_gpu_property().
* Clarify meaning of gpu field with a comment.
2024-09-15 08:07:40 +00:00