Commit Graph

692 Commits

Author SHA1 Message Date
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
Johann Muszynski
d79ebc4db3
Update some docs containing OpenGL or GLSL references (#6271) 2024-09-15 07:07:39 +00:00
Dzmitry Malyshau
eb18854b46 spv-out: configure source language in debug info 2024-09-13 11:37:23 -07:00
Daniel McNab
c2e0ad293f
Vulkan: Avoid undefined behaviour with adversarial debug label (#6257) 2024-09-12 15:03:04 +02:00
Brad Werth
9b36a3e129
Make bind group an Option for set_bind_group calls. (#6216)
This is just an API change for all the "set_bind_group" calls. Calls
that pass a Some() argument should have unchanged behavior. The None
cases are left as TODOs.
2024-09-06 14:29:09 -07:00
Valaphee The Meerkat
07684d3623
Rename Rg11b10UFloat to Rg11b10Ufloat (#6226) 2024-09-06 11:46:49 +02:00
Marijn Suijten
960555a426
[wgpu-hal] Allow importing external WGL contexts as with EGL (#6152) 2024-09-04 15:11:47 +00:00
Jim Blandy
ee35b0e586 [core, hal, types] Clarify wgpu_hal's bounds check promises.
In `wgpu_hal`:

- Document that `wgpu_hal` guarantees that shaders will not access buffer
  contents beyond the bindgroups' bound regions, rounded up to some
  adapter-specific alignment. Introduce the term "accessible region" for
  the portion of the buffer that shaders can actually get at.

- Document that all bets are off if you disable bounds checks with
  `ShaderModuleDescriptor::runtime_checks`.

- Provide this alignment in `wgpu_hal::Alignments`. Update all backends
  appropriately.

- In the Vulkan backend, use Naga to inject bounds checks on buffer accesses
  unless `robustBufferAccess2` is available; `robustBufferAccess` is not
  sufficient. Retrieve `VK_EXT_robustness2`'s properties, as needed to discover
  the alignment above.

In `wgpu_core`:

- Use buffer bindings' accessible regions to determine which parts of the buffer
  need to be initialized.

In `wgpu_types`:

- Document some of the possible effects of using
  `ShaderBoundsChecks::unchecked`.

Fixes #1813.
2024-09-03 12:33:02 -04:00
Erich Gubler
04618b36a8
feat(wgsl): add first and either sampling for @interpolate(flat, …) (#6181) 2024-08-30 15:08:00 +00:00
Marijn Suijten
4454cbfaab
[wgpu-hal] #5956 windows-rs migration followups and cleanups (#6173)
PR #5956 wasn't fully complete and still had some outstanding minor
issues and cleanups to be done, as well as hidden semantic changes.
This addresses a bunch of them:

- Remove unnecessary `Error` mapping to `String` as `windows-rs`'s
  `Error` has a more complete `Display` representation by itself.
- Remove `into_result()` as every call could have formatted the
  `windows-rs` `Error` in a log call directly.
- Pass `None` instead of a pointer to an empty slice wherever possible
  (waiting for https://github.com/microsoft/win32metadata/pull/1971 to
  trickle down into `windows-rs`).
- Remove `.clone()` on COM objects (temporarily increasing the refcount)
  when it can be avoided by inverting the order of operations on `raw`
  variables.
2024-08-30 11:02:38 +02:00
Erich Gubler
7164f3eb4e fix(wgsl): narrow accepted args. of cross to vec3<$float> 2024-08-28 13:26:54 -04:00
Marijn Suijten
71b41c6638 [wgpu-hal] Make raw-gles runnable on X11 and Wayland platforms again
PR #6150 suffered a much larger rebase "hell" than I anticipated.  On
my Linux box I made this change, but lost it while force-pushing from
Windows (and created some other compiler errors while at it...).

By disabling all features on `glutin`/`glutin-winit` (the latter only
uses `x11`, and only forwards `wayland` to `glutin`) we may have dropped
a lot of "unused" dependencies for other GL backends, but also made the
crate unable to import X11 (Xlib/Xcb) and Wayland handles into EGL.

Also import the missing `glutin::context::Version` struct again which
was added last-minute to #6150 (to make sure my Intel card on Windows
creates a GLES 3.0+ instead of GLES 2.0 context) while the import was
accidentally squashed into #6152 (not merged yet).
2024-08-28 09:55:07 +02:00
Jan Procházka
5deaef3b67
Add VideoFrame to ExternalImageSource enum (#6170) 2024-08-27 18:05:45 +00:00
Jerzy Wilczek
a9047c2af5
Change the DropGuard public API to a callback-based one. (#6164)
This patch also unifies the behavior of the the `DropGuard`-ish
constructs in the Vulkan-based implementation.
2024-08-27 16:44:34 +00:00
Imbris
fccd2981d0
Ensure glow::Context is current when dropped (#6114)
Cleanup code in glow needs the context to be current (mainly for debug
message callbacks).

See https://docs.rs/glow/0.14.0/glow/trait.HasContext.html#safety
2024-08-27 12:15:41 -04:00
Daniel McNab
685c2133f2
hal: cargo feature to allow using VK_GOOGLE_display_timing unsafely (#6149)
* Expose the raw swapchain from a vulkan `Surface`

* Allow setting the present timing information on hal Vulkan

* Fix clippy without the feature enabled

* CHANGELOG

* Revert inadvertently formatted Cargo.toml

* Move display timing to a feature

* Update the changelog

* Whitespace and doc wording tweaks

* Apply suggestions from code review

Co-authored-by: Marijn Suijten <marijns95@gmail.com>

* Revert inadvertent formatting changes again

* Remove unused qualification

Co-authored-by: Marijn Suijten <marijns95@gmail.com>

* Address review feedback

* Fix flow of sentence and follow intra-doc-link

* Add more docs to `set_next_present_time`, and rename

* Also rename `next_present_times`

* Apply suggestions from code review

Co-authored-by: Marijn Suijten <marijns95@gmail.com>

---------

Co-authored-by: Marijn Suijten <marijns95@gmail.com>
2024-08-27 11:25:04 -04:00
Teodor Tanasoaia
338678ad5f
Remove IDs from wgpu traits (#6134)
Remove `wgpu`'s `.global_id()` getters.

Implement `PartialEq`, `Eq`, `Hash`, `PartialOrd` and `Ord` for wgpu resources.
2024-08-27 10:00:19 +00:00
Valaphee The Meerkat
b4db97f97b
Add HTMLImageElement/ImageData as external source for copying images (#5668)
* Add `HTMLImageElement` as external source for copying images

* Typo
2024-08-20 12:54:24 -04:00
Marijn Suijten
a157c3cf4b
[wgpu-hal] Migrate d3d12 backend over to windows-rs (#5956)
* windows-rs 0.58

* Clean up suspicious committed allocation workaround

* dx12: Flatten suballocation module
2024-08-20 11:48:37 -04:00
vero
3178ffb0d7
Fix hlsl image type conversion (#6123) 2024-08-19 10:24:40 +02:00
Andreas Reich
92ecafebac changelog entry 2024-08-14 17:34:11 +02:00
Samson
c6a3d92734
Rg11b10Float -> Rg11b10UFloat and deduplicate entries in TEXTURE_FORMAT_LIST (#6108)
* Resync `TEXTURE_FORMAT_LIST` to match `TextureFormat`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* `Rg11b10Float` -> `Rg11b10UFloat`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add changelog entry

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-13 08:28:55 +00:00
James Pruitt
594476c991
Check Opengl version is 3.3+ before creating a GL context over a GL ES context (#5996)
* Retry with GLES if creating a GL context fails

* Cleaner GL context creation retry
2024-08-06 08:19:23 +00:00
Nicolas Silva
9c6ae1beae
Log spring cleaning (#6065)
Remove unused logs in wgpu-core and wgpu-hal
2024-07-31 16:24:23 +00:00
Matthew Wong
339ecf37da
Fix error message in create_render_pass (#6041) 2024-07-26 16:59:41 +00:00
Andreas Reich
d3c38a4fd0
Fix AnyDevice drop implementation dropping the wrong thing (#6052) 2024-07-26 10:31:36 +02:00
teoxoy
03f6d24ea6 deduplicate derived BGLs 2024-07-25 18:15:29 +02:00
Marijn Suijten
2611d18b15 gles/wgl: Migrate from ancient/unmaintained winapi to windows-rs 2024-07-25 11:15:26 +02:00
Samson
2897fb58db
Error instead of panic in check bind (#6012)
Removed zipping of binding entries introduced in 4a19ac279c (to make sure binding numbers actually match) and add unknown error for fallback.
2024-07-24 17:50:18 +02:00
Erich Gubler
fa93676991 docs(CHANGELOG): add entry for const. eval of first{Leading,Trailing}Bit 2024-07-24 09:12:23 -04:00
Imbris
6d7975eb3b [naga hlsl-out glsl-out] Work around backend loop/switch bugs.
Introduce a new module, `naga:🔙:continue_forward`, containing
shared code for rendering Naga `Continue` statements as backend
`break` statements and assignments to introduced `bool` locals.
See the module's documentation for details.

- [hlsl-out] Transform degenerate single body switches into `do-while`
  loops. Properly render `Continue` statements enclosed by
  `Switch` statements enclosed by `Loop` statements.

- [glsl-out] Transform degenerate single body switches into `do-while`
  loops.

Improve `naga xtask validate spv` error message.

Fixes #4485.
Fixes #4514.
2024-07-23 18:12:19 -07:00
Vladas Zakrevskis
5a0e2187f0
Print requested and supported usages on UnsupportedUsage error (#6007)
* Print requested and supported usages on UnsupportedUsage error

* fmt

* changelog
2024-07-21 21:12:28 -04:00
Andreas Reich
c0e7c1ef94 Bump core MSRV to 1.76 2024-07-20 15:55:28 -04:00
Kevin Reid
b5934e89f7 Disable wgpu-core documentation as a workaround for #4905.
This enables `cargo doc` to succeed in a reasonable amount of time,
as long as the reader isn't looking for documentation for `wgpu-core`
itself.
2024-07-19 11:37:00 -04:00
Bruce Mitchener
20973d1cdc
Fix profiling with tracy. (#5988)
The profiling APIs require a `&str`, but since the label here
is now an `Option<String>`, we must get a `&str` from it.
2024-07-19 00:56:16 -04:00
Erich Gubler
e883fa7b8b docs(CHANGELOG): add Unreleased section 2024-07-18 11:55:08 -04:00
Erich Gubler
6a1432c132 chore: release 22.0.0 2024-07-18 11:54:46 -04:00
teoxoy
911d28fd1a add a few missing changelog entries 2024-07-18 14:25:12 +02:00
Teodor Tanasoaia
69a1134e02
[wgpu] remove trace feature temporarily (#5975) 2024-07-17 18:10:49 +00:00
Erich Gubler
32acb207fa
docs(CHANGELOG): backport 0.19.5 entries (#5966) 2024-07-16 15:11:43 +00:00
Dzmitry Malyshau
1b4e8ada63 spv-out: fix acceleration structure in a function argument 2024-07-15 10:05:51 +02:00
Andreas Reich
d3edbc57a9
Compute pass benchmark (#5767)
Adds a benchmark for compute pass recording, very similar to what we have for render passes.
2024-07-14 22:13:50 +02:00
Andreas Reich
9796766e8e
Changelog cleanup round (#5936)
* Add missing changelog entry for `msl-out-if-target-apple`/`hlsl-out-if-target-windows` feature addition

* minor changelog reorganisation

* fix missing author attribution & pr link in changelog

* import patch release changelogs and remove redundant items

* move pipeline overridable constants from bugfixes to features
2024-07-11 09:27:47 +02:00
Nicolas Silva
4c6318c0d2
Expose gpu allocation configuration options (#5875)
* Expose gpu allocation configuration options

This commit adds hints to control memory allocations strategies to the configuration options. These hints allow for automatic profiles such as optimizing for performance (the default, makes sense for a game), optimizing for memory usage (typically more useful for a web browser or UI library) and specifying settings manually.

The details of gpu allocation are still in flux. The goal is to switch vulkan and metal to gpu_allocator which is currently used with d3d12. gpu_allocator will also likely receive more configuration options, in particular the ability to start with smaller memory block sizes and progressively grow the block size. So the manual settings already provision for this upcoming option. Another approach could be to wait and add the manual option after the dust settles.

The reason for providing presets and defining values in the backends is that I am convinced that optimal fonigurations should take hardware capabilities into consideration. It's a deep rabbithole, though, so that will be an exercise for later.

* changelog

* Update CHANGELOG.md

Co-authored-by: Andreas Reich <r_andreas2@web.de>

* Add a comment about not entirely knowing what we are doing

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-07-08 14:49:44 +02:00
teoxoy
9f34acd567 [wgpu-hal] return None in Adapter.surface_capabilities() if the Surface and the Adapter don't share the same WebGL2 context 2024-07-04 10:17:07 +02:00
teoxoy
7910fd8059 [wgpu-hal] require a Surface to be passed to Instance.enumerate_adapters() on WebGL2
Also makes wgpu's `enumerate_adapters()` native only.
2024-07-04 10:17:07 +02:00
Imbris
3a6814770a
Allow unconsumed inputs in fragment shaders (#5531)
* Allow unconsumed inputs in fragment shaders by removing them from vertex
outputs when generating HLSL.

Fixes https://github.com/gfx-rs/wgpu/issues/3748

* Add naga:🔙:hlsl::FragmentEntryPoint for providing information
  about the fragment entry point when generating vertex entry points via
  naga:🔙:hlsl::Writer::write. Vertex outputs not consumed by the
  fragment entry point are omitted in the final output struct.
* Add naga snapshot test for this new feature,
* Remove Features::SHADER_UNUSED_VERTEX_OUTPUT,
  StageError::InputNotConsumed, and associated validation logic.
* Make wgpu dx12 backend pass fragment shader info when generating
  vertex HLSL.
* Add wgpu regression test for allowing unconsumed inputs.

* Address review

* Add note that nesting structs for the inter-stage interface can't
  happen.
* Remove new TODO notes (some addressed and some transferred to an issue
  https://github.com/gfx-rs/wgpu/issues/5577)
* Changed issue that regression test refers to 3748 -> 5553
* Add debug_assert that binding.is_some() in hlsl writer
* Fix typos caught in CI

Also, fix compiling snapshot test when hlsl-out feature is not enabled.
2024-07-04 09:08:46 +02:00
Andreas Reich
0a76c0fa84
Renderpass take resource ownership (#5884)
* share timestamp write struct

* Make name of set_push_constants methods consistently plural

* remove lifetime bounds of resources passed into render pass

* first render pass resource ownership test

* introduce dynrenderpass & immediately create ArcCommands and take ownership of resources passed on pass creation

* Use of dynrenderpass in deno

* Separate active occlusion & pipeline statitics query

* resolve render/compute command is now behind `replay` feature

* add vertex & index buffer to ownership test

* test for pipeline statistics query

* add occlusion query set to pass resource test

* add tests for resource ownership of render pass query timestamps

* RenderPass can now be made 'static just like ComputePass. Add respective test

* Extend encoder_operations_fail_while_pass_alive test to also check encoder locking errors with render passes

* improve changelog entry on lifetime bounds
2024-07-01 18:36:24 +02:00
9SMTM6
a7d4d2c79f
Allow using include_wgsl! in const contexts (#5872)
* include_wgsl! Switch from into() call to construction

This allows usage in const contexts.

* Describe constification of include_wgsl! in changelog
2024-06-24 17:46:30 +00:00
Nicolas Silva
ddff69ba21
Avoid leaking submitted command encoders (#5141)
* Avoid leaking submitted command encoders

* changelog
2024-06-24 12:16:55 +00:00
Kamil Jarosz
355613342e [naga] Add packed as a keyword for GLSL
Turns out that sometimes `packed` is a keyword,
and the produced GLSL had syntax errors due to that.
2024-06-24 11:21:24 +02:00
Erich Gubler
f227ca1258 docs(CHANGELOG): add entry for #5812
Permalink: <https://github.com/gfx-rs/wgpu/issues/5812>
2024-06-23 03:40:32 -07:00
Théo Monnom
0f6abc99ee
[naga-cli] add --defines options for the glsl parser (#5859) 2024-06-23 07:21:56 +00:00
Schell Carl Scivally
6405dcf611 [naga spv-in] Adjust types of globals used by atomic instructions.
To support atomic instructions in the SPIR-V front end, observe which
global variables the input accesses using atomic instructions, and
adjust their types from ordinary scalars to atomic values.

See comments in `naga::front::atomic_upgrade`.
2024-06-21 21:51:25 -07:00
Christofer Nolander
fe31966fdf
ensure that wgpu::Error is Sync (#5820)
* ensure that `wgpu::Error` is `Sync`

This makes it possible to wrap the error in `anyhow::Error` and
`eyre::Report`, which require the inner error to be `Sync`.

* update changelog
2024-06-16 19:48:35 -04:00
Andreas Reich
eb24be47e1
Validate for device mismatch during compute pass recording (#5779)
* compute pass recording device validation

* add changelog entry

* validate device of timestamp query set as well
2024-06-10 12:19:50 +02:00
Vecvec
73401ede25
Fix double decoration if a binding array contains a struct with a runtime array (#5776) 2024-06-10 11:20:33 +02:00
Atlas Dostal
abba12ae4e Add support for 64 bit integer atomic operations in shaders.
Add the following flags to `wgpu_types::Features`:

- `SHADER_INT64_ATOMIC_ALL_OPS` enables all atomic operations on `atomic<i64>` and
  `atomic<u64>` values.

- `SHADER_INT64_ATOMIC_MIN_MAX` is a subset of the above, enabling only
  `AtomicFunction::Min` and `AtomicFunction::Max` operations on `atomic<i64>` and
  `atomic<u64>` values in the `Storage` address space. These are the only 64-bit
  atomic operations available on Metal as of 3.1.

Add corresponding flags to `naga::valid::Capabilities`. These are supported by the
WGSL front end, and all Naga backends.

Platform support:

- On Direct3d 12, in `D3D12_FEATURE_DATA_D3D12_OPTIONS9`, if
  `AtomicInt64OnTypedResourceSupported` and `AtomicInt64OnGroupSharedSupported` are
  both available, then both wgpu features described above are available.

- On Metal, `SHADER_INT64_ATOMIC_MIN_MAX` is available on Apple9 hardware, and on
  hardware that advertises both Apple8 and Mac2 support. This also requires Metal
  Shading Language 2.4 or later. Metal does not yet support the more general
  `SHADER_INT64_ATOMIC_ALL_OPS`.

- On Vulkan, if the `VK_KHR_shader_atomic_int64` extension is available with both the
  `shader_buffer_int64_atomics` and `shader_shared_int64_atomics` features, then both
  wgpu features described above are available.
2024-06-08 18:36:26 -07:00
Andreas Reich
9a27ba53ca
Fix QuerySet ownership of ComputePass (#5671)
* add new tests for checking on query set lifetime

* Fix ownership management of query sets on compute passes for write_timestamp, timestamp_writes (on desc) and pipeline statistic queries

* changelog entry
2024-06-04 07:47:27 +00:00
Andreas Reich
aa2821bff6
Reintroduce computepass->encoder lifetime constraint and make it opt-out via wgpu::ComputePass::forget_lifetime (#5768)
* Reintroduce computepass->encoder lifetime constraint and make it opt-out via `wgpu::ComputePass::make_static`

* improve comments based on review feedback

* use the same lifetime name for all usages of `ComputePass<'encoder>`

* comment improvement that I missed earlier

* more review based comment improvements

* use suggested zero-overhead lifetime removal

* rename make_static to forge_lifetime

* missed comma
2024-06-03 20:04:12 +02:00
Schell Carl Scivally
480d4dbd73
spv-in parsing Op::AtomicIIncrement (#5702)
Parse spirv::Op::AtomicIIncrement, add atomic_i_increment test.
2024-05-30 04:39:32 +00:00
Mads Marquart
60a14c67fb
Remove the link Cargo feature (#5752) 2024-05-29 15:55:33 -07:00
Andreas Reich
588950110a
Remove lifetime dependency of ComputePass to its parent command encoder (#5620)
* lift encoder->computepass lifetime constraint and add now failing test
* compute passes now take an arc to their parent command encoder, thus removing compile time dependency to it
* Command encoder goes now into locked state while compute pass is open
* changelog entry
* share most of the code between get_encoder and lock_encoder
2024-05-29 22:43:24 +00:00
Douglas Dwyer
071fb14e15
Add support for pipeline-overridable constants in web backend (#5688)
* Add support for pipeline-overridable constants in WebGPU

* Add utility function for setting constants map

* Panic on failure to set constants map

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-05-29 19:33:04 +00:00
Valaphee The Meerkat
23307e1dc3
gles: Return the version as driver_info (#5753) 2024-05-29 14:01:32 -04:00
Vladas Zakrevskis
de809c8f96
Fix missing family check flag (#5754)
Co-authored-by: Jim Blandy <jimb@red-bean.com>
Co-authored-by: Xiaopeng Li <x.friday@outlook.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Valaphee The Meerkat <32491319+valaphee@users.noreply.github.com>
Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-05-29 14:00:32 -04:00
Jason de Wolff
cd744ef68b
Buffer as hal (#5724)
* Add `as_hal` for `Buffer`

* fmt & CHANGELOG.md update

* Update CHANGELOG.md

* fixed callback name

* allow nested buffer as_hal callbacks
2024-05-26 08:58:30 +02:00
Andreas Reich
2fd09945cd
Make compute pass end consume the pass (#5575)
* rename `command_encoder_run_*_pass` to `*_pass_end` and make it a method of compute/render pass instead of encoder

* executing a compute pass consumes it now such that it can't be executed again

* use handle_error instead of handle_error_nolabel for wgpu compute pass

* use handle_error instead of handle_error_nolabel for render_pass_end

* changelog addition

* feat: `compute_pass_set_push_constant`: move panics to error variants

Co-Authored-By: Erich Gubler <erichdongubler@gmail.com>

---------

Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2024-05-25 18:54:48 +02:00
Erich Gubler
447e3eee8d fix: ensure render pipelines have at least 1 target 2024-05-17 17:45:03 -04:00
Daniel McNab
4902e470ce
Pipeline cache API and implementation for Vulkan (#5319)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-05-16 13:52:56 +00:00
Andreas Reich
77a83fb0dd
Remove lifetime constraints from wgpu::ComputePass methods (#5570)
* basic test setup

* remove lifetime and drop resources on test - test fails now just as expected

* compute pass recording is now hub dependent (needs gfx_select)

* compute pass recording now bumps reference count of uses resources directly on recording

TODO:
* bind groups don't work because the Binder gets an id only
* wgpu level error handling is missing

* simplify compute pass state flush, compute pass execution no longer needs to lock bind_group storage

* wgpu sided error handling

* make ComputePass hal dependent, removing command cast hack. Introduce DynComputePass on wgpu side

* remove stray repr(C)

* changelog entry

* fix deno issues -> move DynComputePass into wgc

* split out resources setup from test
2024-05-14 20:05:17 +00:00
Vladislav
00456cfb37 Add parsing support for un/pack4xI/U8 2024-05-14 17:57:04 +02:00
Connor Fitzgerald
7078b0a061
Fix Subgroup Ops on VK 1.2 Device (#5624) 2024-05-14 14:21:53 +00:00
Nick Guletskii
65d8c94afd
Issue SetDrawColorBuffers before clearing buffers in GLES, use clear_buffer_f32_slice instead of clear (#5666)
* Issue SetDrawColorBuffers commands before issuing ClearColor

This is necessary for glClearBuffer calls to work correctly on some machines (e.g. AMD Renoir graphics running on Linux). Without this, glClearBuffer calls are ignored.

* Use clear_buffer_f32_slice instead of gl.clear to suppress WebGL warnings

This fixes the following WebGL warning: "WebGL warning: drawBuffers: `buffers[i]` must be NONE or COLOR_ATTACHMENTi."

When using native OpenGL, it is acceptable to call glDrawBuffers with an array of buffers where i != COLOR_ATTACHMENTi. In WebGL, this is not allowed.

* Run cargo fmt

* Add changes for PR GH-5666 to the CHANGELOG
2024-05-14 05:57:18 -04:00
Marijn Suijten
8879733875
[wgpu-hal] Upgrade to ash 0.38 (#5504) 2024-05-13 11:57:44 -04:00
bjorn3
fa48562229
Avoid introducing spurious features for optional dependencies (#5691)
* Avoid introducing spurious features for optional dependencies

If a feature depends on an optional dependency without using the dep:
prefix, a feature with the same name as the optional dependency is
introduced. This feature almost certainly won't have any effect when
enabled other than increasing compile times and polutes the feature list
shown by cargo add. Consistently use dep: for all optional dependencies
to avoid this problem.

* Add changelog entry
2024-05-12 08:45:35 +02:00
Xiaopeng Li
d5d683d3c4
Clean up weak references to texture views and bind groups (#5595)
* Clean up weak references to texture views

* add change to CHANGELOG.md

* drop texture view before clean up

* cleanup weak ref to bind groups

* update changelog

* Trim weak backlinks in their holders' triage functions.

---------

Co-authored-by: Jim Blandy <jimb@red-bean.com>
2024-05-06 12:53:03 +02:00
Valaphee The Meerkat
565a0310e9
Fix OpenGL non-srgb on Linux (#5642) 2024-05-03 22:29:27 +02:00
Andreas Reich
08efa72a83 move shader compilation error query out of 0.20 changelog - it didn't get released with it 2024-04-29 14:29:18 +02:00
stefnotch
f874ed061c
Add get_compilation_info (#5410)
* Add get_compilation_info API

* Rename glsl ParseError to ParseErrors

* Document ParseError label order

* Update line_position to count UTF-8 bytes
2024-04-29 11:35:36 +02:00
Connor Fitzgerald
4521502da6
Release v0.20.0 (#5619) 2024-04-28 18:06:35 -04:00
Jim Blandy
a2cd2b92b3
[hal] Fix cargo doc --document-private-items. Check in CI. (#5617) 2024-04-27 20:21:29 +00:00
vero
9eb1b71d33
Add some more changelog entries (#5611)
* Add some more changelog entries

* Address feedback
2024-04-26 15:06:34 +02:00
Imbris
ae758be2ec
Reword / reclassify a few changelog entries. (#5607) 2024-04-25 05:10:32 +00:00
vero
671a2a8227
Update my username in the changelog (#5602) 2024-04-24 22:30:44 -04:00
Andreas Reich
d00a69615b
Prepare changelog for 0.20 (#5599) 2024-04-24 20:21:54 -04:00
Imbris
82fa580152
[hlsl-out] Fix accesses on zero value expressions (#5587) 2024-04-24 10:40:08 +02:00
Luna
7840e75bf7
Add check to ensure vulkan::CommandEncoder::discard_encoding is not called multiple times in a row (#5557)
Document that `wgpu_hal::CommandEncoder::discard_encoding` must not be called multiple times.

Assert in `wgpu_hal::vulkan::CommandEncoder::discard_encoding` that encoding is actually in progress.

Fixes #5255.
2024-04-22 19:39:08 +00:00
Valaphee The Meerkat
53dd49f839
Allow ETC2 in OpenGL if ES3 compatible (#5568)
* Allow ETC on OpenGL if ES3 compatible

* Update changelog
2024-04-20 15:38:53 +02:00
matt rice
e0ac24aeab
[naga-cli] Add input-kind and shader-stage args (#5411) 2024-04-18 12:41:18 +02:00
Connor Fitzgerald
638fc9db7f
Backport changelog from 0.19.4 (#5552) 2024-04-18 08:20:52 +02:00