Commit Graph
9463 Commits
Author SHA1 Message Date
Erich Gubler cc0f4ac4bf refactor(wgpu)!: use WebGpuError for error classification 2025-06-30 10:58:56 -04:00
Erich Gubler 43eee99b29 refactor: extract did_fill_error_scope test helper from did_fail 2025-06-30 10:58:56 -04:00
Erich Gubler 964c5bbf4c feat(core): impl WebGpuError for API errors 2025-06-30 10:58:56 -04:00
Erich Gubler c8752e5118 feat(types): add error::{ErrorType, WebGpuError} APIs 2025-06-30 10:58:56 -04:00
Erich Gubler c3922d53d7 docs(types): Make docs. on DeviceLostReason variants less terse 2025-06-30 10:58:56 -04:00
Erich Gubler d8d1af24b6 refactor(deno): impl From<wgpu_types::DeviceLostReason> for GPUDeviceLostReason 2025-06-30 10:58:56 -04:00
renovate[bot] d1c40f3c68 Update Cargo.lock (#7866)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-30 09:36:19 -04:00
Vecvec 27212104f8 Unify debug groups and markers. 2025-06-30 15:00:46 +02:00
Vecvec 6237dbf0b9 Unify timestamp writes. 2025-06-30 15:00:46 +02:00
Vecvec afa96af76f Unify set push constants. 2025-06-30 15:00:46 +02:00
Vecvec acd8cb18bb Unify rebinding resources. 2025-06-30 15:00:46 +02:00
Vecvec 4d36a02691 Unify set bind group. 2025-06-30 15:00:46 +02:00
Andy Leiserson 768d5f4879 [metal] Increase MAX_COMMAND_BUFFERS (#7858) 2025-06-27 14:18:40 -04:00
Andy LeisersonandNicolas Silva d13e9f5ebf [tests] Test destruction of a used resource before submission (#7853)
* [tests] Test destruction of a used resource before submission

Fixes #5031

---------

Co-authored-by: Nicolas Silva <nical@fastmail.com>
2025-06-27 10:54:19 -07:00
Andy Leiserson 201b2fba76 [deno] Don't report support for native-only features (#7813) 2025-06-27 10:05:13 -07:00
Andy Leiserson e936c065fc Additional comments on render and compute pass encoding 2025-06-26 15:39:53 -07:00
Andy Leiserson 7722c341e0 Defer destroyed resource errors until cmdbuf submission 2025-06-26 15:39:53 -07:00
Andy Leiserson 41badaedfb Update tests and changelog for deferred error reporting 2025-06-26 15:39:53 -07:00
Andy Leiserson fc26fbc561 Deferred error reporting for render passes 2025-06-26 15:39:53 -07:00
Andy Leiserson 460f073a67 Deferred error reporting for compute passes 2025-06-26 15:39:53 -07:00
Andy Leiserson 09c08037c9 Add a field in BasePass to store errors 2025-06-26 15:39:53 -07:00
Andy Leiserson 0c629bb3c2 [naga] cli support for process_overrides compaction (#7792) 2025-06-26 14:12:18 -07:00
Zachary HarroldandConnor Fitzgerald 4c39227510 Allow Naga spv-in and spv-out in no_std (#7760)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-26 16:45:47 -04:00
VecvecandConnor Fitzgerald 0d61648eeb Allow enabling additional vulkan extensions in Adapter::open and Instance::init (#7829)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-26 20:39:41 +00:00
Simon Hausmann 208fe4c23d Expose the DxgiAdapter in the Hal adapter (#7852) 2025-06-26 16:34:59 -04:00
Andreas Reich 12808193fe Fix warnings for unrecognized Vulkan present mode (#7850) 2025-06-26 09:33:20 -04:00
Zachary Harrold 995efddc62 Fix portable-atomic on wgpu-hal (#7735) 2025-06-26 08:48:41 +02:00
SupaMaggie70IncorporatedandConnor Fitzgerald e40e66d205 DXIL & HLSL passthrough (#7831)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-25 18:12:58 -04:00
Mendy BergerandConnor Fitzgerald 4c08c37a46 Expose raw_factory (#7827)
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2025-06-25 19:43:23 +00:00
Erich Gubler df272d3cfc chore(CHANGELOG): merge Unreleased/New features/Naga sections (#7802) 2025-06-25 15:02:56 -04:00
Vecvec dc0d457a9a Add limits for acceleration structures (#7845) 2025-06-25 14:49:55 -04:00
Erich Gubler 9d14871f01 Fix OpenBSD compilation of wgpu_hal::vulkan::drm (#7810) 2025-06-25 18:02:35 +00:00
Andy Leiserson 402a479027 [metal] Retain references with command buffers (#7842) 2025-06-25 11:40:25 -04:00
atlv 0c05dbf5c9 fix(webgpu): set_unclipped_depth (#7841) 2025-06-24 15:12:47 +02:00
renovate[bot] 440b33f4c6 Update Cargo.lock (#7839)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-23 10:47:28 -04:00
Jim Blandy 3f96ba2980 Skip wgpu_gpu::oom::query_set_oom_test on Vulkan.
Vulkan's `VK_EXT_memory_budget` extension doesn't cover query sets, so
`wgpu_hal::vulkan::Device::error_if_would_oom_on_resource_allocation`'s
tactic doesn't work to anticipate OOM errors from the Vulkan driver
when creating query sets.

Without these checks, `wgpu_gpu::oom::query_set_oom_test` actually
consumes a significant amount of memory and attracts the attention of
the system's OOM killer. While it does get killed, the situation tends
to adversely affect the stability of the rest of the system, and thus
is not a friendly thing for a test run to do (#7817).

This change can be reverted once a suitable accounting method for
query sets has been implemented on Vulkan.
2025-06-18 08:21:13 -07:00
Andy Leiserson 3a5d0f2747 Deferred error reporting for other command encoder operations
* clear commands
* query set functions
* command_encoder_as_hal_mut
* ray_tracing
2025-06-17 16:17:43 -07:00
Andy Leiserson e702d1c116 Deferred error reporting for transfer commands 2025-06-17 16:00:49 -07:00
Jamie Nicol 8cdbcc1755 Add ExternalTexture BindingType behind new Feature flag
Adds a new feature flag, `EXTERNAL_TEXTURE`, indicating device support
for our implementation of WebGPU's `GPUExternalTexture` [1] which will
land in upcoming patches. Conceptually this would make more sense as a
downlevel flag, as it is a core part of the WebGPU spec which we do not
yet support. We do not want, however, to cause applications to reject
adapters because we have not finished implementing this, so for now we
are making it an opt-in feature.

As an initial step towards supporting this feature, this patch adds a
new `BindingType` corresponding to WebGPU's
`GPUExternalTextureBindingLayout` [2]. This binding type dictates that
when creating a bind group the corresponding entry must be either an
external texture or a texture view with certain additional requirements
[3].

As of yet wgpu has no concept of an external texture (that will follow
in later patches) but for now this patch ensures that texture views
corresponding to an external texture binding type are validated
correctly. Note that as the feature flag is not yet supported on any
real backends, bind group layout creation will fail before getting the
chance to attempt to create a bind group. But in the added tests using
the noop backend we can see this validation taking place.

[1] https://www.w3.org/TR/webgpu/#gpuexternaltexture
[1] https://www.w3.org/TR/webgpu/#dictdef-gpuexternaltexturebindinglayout
[2] https://gpuweb.github.io/gpuweb/#bind-group-creation
2025-06-17 15:00:29 -07:00
Jamie Nicol 111a95b822 [cts_runner] Add texture2d<f32> textureSampleBaseClampToEdge() shader execution tests to CTS test list 2025-06-17 14:27:18 -07:00
Jamie Nicol 55a2c3095d [naga] Support textureSampleBaseClampToEdge() for texture2d
Adds a new flag to the IR indicating when image sample coordinates are
to be clamped. Adds wgsl-in support for parsing and lowering to
IR. Validation ensures this flag is only used when sampling a 2D
non-arrayed sampled texture, without offset, gather, or depth
comparison. This matches the WGSL requirements, with the exception of
supporting `texture_external` textures, which will follow in a later
patch.

SPIRV, HLSL, and Metal backends are supported so far, with GLSL left
for a follow up. (In GLSL the texture will simply be sampled without
the coordinates being clamped.)

It may seem unfortunate to have to handle this separately for each
backend, and indeed it would have been possible to implement this simply
in the WGSL frontend. However, future patches will add support for using
textureSampleBaseClampToEdge() with external textures, which will
actually have to be handled by each backend. This patch is laying the
groundwork for that.
2025-06-17 14:27:18 -07:00
Jamie Nicol a5f328613d [cts_runner] Run some textureSample CTS shader execution tests
Limit to the `sampled_1d_coords` subtests for now as otherwise the tests
take a very long time to execute, and there are also some failures with
certain texture formats that are used in higher dimensions.
2025-06-17 20:20:25 +01:00
Jamie Nicol d811258424 [naga msl-out] Add padding to end of structs if required 2025-06-17 20:20:25 +01:00
Jamie Nicol 5f8d408fb8 [deno_webgpu] Add stub GPUExternalTexture implementation
This doesn't do anything yet, but unblocks running some CTS tests.
2025-06-17 20:20:25 +01:00
Jim Blandy 48eae68156 [naga spv-in] Lay out entry point output structs correctly.
In the SPIR-V front end, when generating Naga IR `Struct` types to
represent a SPIR-V entry point's `Output` variables, instead of saying
"0xFFFF, // shouldn't matter", follow the usual rules in assigning
struct member offsets and computing an overall
size (`TypeInner::Struct::span`) for the resulting struct type.
2025-06-17 09:56:57 -07:00
Jamie Nicol 0aa1baface [CI] Install WARP for CTS run
This means we use a reliable version rather than depending on whatever
the worker has installed.
2025-06-17 09:14:44 -04:00
Jamie Nicol 3ba583cd61 [CI] Refactor DXC and WARP installation steps to composite actions
This avoids having to duplicate the steps and version numbers across
mutiple workflows.
2025-06-17 09:14:44 -04:00
Jamie Nicol ad4286102a [dx12] Return OOM error when GetResourceAllocationInfo() returns SizeInBytes == 0
Some versions of WARP return an allocation info with SizeInBytes == 0
for very large allocations. Proceeding to attempt to allocate a zero-
sized resource results in a device lost error. It's preferable to
instead return an out of memory error.
2025-06-17 09:14:44 -04:00
Jamie Nicol aeb2c3e6c7 chore(cts): Fix parsing of Git for Windows version string
Git for Windows adds an extra suffix to the version string. This is a
follow up to #7800 that ensures we parse such git versions correctly
rather than returning an error.
2025-06-17 21:27:25 +09:00
Andy Leiserson 45ebc73610 [naga] Always compact the module in process_overrides
Fixes #7638
2025-06-16 16:42:02 -07:00