Commit Graph

8525 Commits

Author SHA1 Message Date
Andreas Reich
ed694eda89 Improve logging around surface creation (#6511)
* additional debug logging for request_adapter, demote some messages to debug

* unrelated log messages that annoyed me in Vulkan: debug utils disabled is now `debug`, it being enabled is `info`

* document compatible_surface requirement for WebGL directly on wgt::RequestAdapterOptions

* make adapterenumarge_adapters & request_adapters results info log again when api_log is enabled
2024-12-08 14:44:55 +01:00
Nathan Adams
11b51693d3 Fix dropping Device if not using indirect validation (#6681) 2024-12-07 22:17:12 +01:00
Aloke Desai
ebdd958d4b Make Surface#configure and Surface#get_current_texture non-fatal (#6253)
* Make Surface#configure non-fatal
* Make Surface#get_current_texture non-fatal

---------

Co-authored-by: Andreas Reich <r_andreas2@web.de>
2024-12-07 17:13:09 +00:00
Erich Gubler
f8b67a752a docs: remove last paragraph from CommandBuffer::data (#6680) 2024-12-07 01:30:09 -05:00
Marijn Suijten
76f307c92f Remove stale references to d3d12 bindings wrapper crate (#6675)
While looking through some recent activity for the D3D12 crate, in
particular a spelling fix for the crates.io link to `d3d12`, I realized
that I completely forgot to remove these references to the now unused
and removed `d3d12` crate in #5956.
2024-12-06 11:57:05 +01:00
Kent Slaney
b56960b8e8 Add Pipeline Overrides for workgroup_size (#6635) 2024-12-06 11:44:05 +01:00
Jim Blandy
e15e1a1c82 CONTRIBUTING.md: Clarify meaning of assigned field on PRs. (#6669) 2024-12-05 17:37:01 +00:00
Andreas Reich
3808661e07 fix doc string for SurfaceConfiguration::usage (#6668) 2024-12-05 10:55:00 -06:00
Connor Fitzgerald
c933487697 Improve Snapshot Test Configuration Deserialization (#6661) 2024-12-05 10:32:23 -06:00
dependabot[bot]
b876b8c281 chore(deps): bump generator from 0.8.3 to 0.8.4 in the patch-updates group across 1 directory (#6664)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-05 00:27:43 -05:00
Connor Fitzgerald
503e34b0a5 Update Deps (#6663) 2024-12-04 23:45:48 -05:00
Connor Fitzgerald
4e139ed199 Rework wgpu-rs Context (#6619) 2024-12-04 12:00:14 -05:00
Jim Blandy
41ad18f107 meta: add CONTRIBUTING.md (#6657)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2024-12-04 16:47:48 +00:00
Connor Fitzgerald
791d95e78f Changelog 2024-12-04 01:26:05 -05:00
atlv
0b6571a68d Align Storage Access enums to spec (#6642) 2024-12-03 17:37:23 +01:00
Vecvec
ed2940d869 Add minor ray tracing tests (#6651) 2024-12-03 11:25:35 +01:00
atlv
eb89f13928 Move TextureDataOrder to wgpu-types (#6648) 2024-12-03 11:09:05 +01:00
atlv
b9937cb56b Move SamplerDescriptor to wgpu-types (#6649) 2024-12-03 11:08:04 +01:00
atlv
1e17fa4973 Move TextureViewDescriptor to wgpu-types (#6650) 2024-12-03 11:07:13 +01:00
dependabot[bot]
1fbf53fbd1 chore(deps): bump crate-ci/typos from 1.27.3 to 1.28.1 (#6637)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-12-03 10:25:06 +01:00
teoxoy
02b28e28f0 use EncoderGuard for the other command encoder operations
The spec requires us to invalidate the encoder if there was any error during the body of these operations.
2024-12-02 15:59:14 -08:00
teoxoy
5e1fbd7176 move CommandEncoderStatus on the CommandBuffer and change its variants to hold CommandBufferMutable
This makes the code more straightforward, we were previously holding invalidity state in 2 places: `CommandBuffer::data` could hold `None` and in `CommandEncoderStatus::Error`.

This commit also implements `Drop` for `CommandEncoder` which makes the destruction/reclamation code automatic. We were previously not reclaiming all command encoders (`CommandBufferMutable::destroy` didn't call `release_encoder`) even though all encoders are coming from a pool.
2024-12-02 15:59:14 -08:00
teoxoy
68d336ef79 use CommandEncoder for BakedCommands & EncoderInFlight 2024-12-02 15:59:14 -08:00
teoxoy
ba416c1dad remove hal::Device::destroy_command_encoder, use Drop implementations instead
Co-Authored-By: Erich Gubler <erichdongubler@gmail.com>
2024-12-02 15:59:14 -08:00
Jim Blandy
26124c77ac [naga] Add naga::common::wgsl shared by WGSL front and backends. (#6628)
Create a new module, `naga::common`, to hold code that can be
shared between front and back ends for a given language.

Create a new module, `naga::common::wgsl`, and populate it with some
code that we expect to be useful by both the WGSL front and back ends,
once the back end generates diagnostic filters.

Move some WGSL front end tests into `naga::front::wgsl::tests`.
2024-12-02 15:22:22 -06:00
atlv
cf793f7c0f clean up bitflag serde (#6644) 2024-12-02 16:03:37 -05:00
Christofer Nolander
00625a711a chore: update webgpu_sys to draft 2024-11-22 (#6641) 2024-12-02 14:15:56 -05:00
Jim Blandy
246ed3ee8e [naga wgsl-in] Remove support for -> void return type syntax. (#6633) 2024-12-02 12:58:59 -05:00
teoxoy
66d51b6059 add changelog entry 2024-12-02 16:45:13 +01:00
teoxoy
5b9c526c55 [d3d12] don't expose adapter if it doesn't support DXIL when the DXC container is present 2024-12-02 16:45:13 +01:00
teoxoy
201d9ea79f [d3d12] remove complex DXC loading rules 2024-12-02 16:45:13 +01:00
teoxoy
2aac44bb73 [d3d12] don't fallback on FXC if DXC failed to load 2024-12-02 16:45:13 +01:00
dependabot[bot]
74fe56fa83 chore(deps): bump the patch-updates group across 1 directory with 45 updates (#6640)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
2024-12-02 00:50:00 -05:00
atlv
d5253be7fd rename TFFF::STORAGE_READ_WRITE to STORAGE_WRITE (#6622) 2024-12-01 23:26:47 -05:00
dependabot[bot]
131d08e6e1 chore(deps): bump JamesIves/github-pages-deploy-action from 4.6.9 to 4.7.1 (#6638)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-01 23:24:14 -05:00
Douglas Dwyer
be02606118 Static linking for DXC via mach-dxcompiler (#6574) 2024-12-01 23:14:10 -05:00
atlv
5e52a313b9 rename TFC::STORAGE to STORAGE_WRITE (#6621) 2024-12-01 16:53:27 -06:00
Jim
61dc75edc5 Allow CAMetalLayer images to be used as storage textures (#6603) 2024-12-01 16:11:11 -06:00
Jim Blandy
1ea5498038 [naga] Leave Module as the last thing in naga/src/lib.rs.
Move the definitions of `RayFlag` and `RayQueryIntersection` above the
definition of `Module`, so that `Module` remains the last definition
in `lib.rs`. This is helpful for navigation.

This commit is purely code motion, and makes no changes to
functionality.
2024-11-28 11:48:46 +01:00
Teodor Tanasoaia
1a643291c2 Simplify WeakVec (#6587)
* simplify `WeakVec`

* iterate backwards & avoid rescans

Co-authored-by: Jim Blandy <jimb@red-bean.com>

---------

Co-authored-by: Jim Blandy <jimb@red-bean.com>
2024-11-27 07:16:11 -08:00
Dzmitry Malyshau
314e196c90 Implement candidate intersections 2024-11-27 11:49:32 +01:00
Dzmitry Malyshau
051efbe594 Changelog entry for Ray Query constants 2024-11-27 11:49:32 +01:00
Dzmitry Malyshau
cdcba54d06 Declare ray flags in IR, parse all of them in WGSL 2024-11-27 11:49:32 +01:00
Jim Blandy
8fce9f6191 [core] Make insert_or_merge a method of BufferUsageScope.
Change `wgpu_core::track::buffer::insert_or_merge` into a
method of `BufferUsageScope`, replacing three arguments with `self`.
2024-11-27 02:00:03 -05:00
Jim Blandy
eaa5fea40d [core] Make insert_or_barrier_update a method of BufferTracker.
Change `wgpu_core::track::buffer::insert_or_barrier_update` into a
method of `BufferTracker`, and replace four arguments with `self`.
2024-11-27 02:00:03 -05:00
Erich Gubler
170f457f71 refactor: handle 2024-08 spec. rename for image copy APIs in deno_webgpu/ 2024-11-26 23:16:35 -05:00
Erich Gubler
9436d56271 feat(types): add deprecated type aliases for idents. in 2024-08 spec. rename 2024-11-26 23:16:35 -05:00
Erich Gubler
c05aa105f2 refactor!: handle 2024-08 spec. rename of image copy APIs
This commit was authored by running the following Nushell script, using
the `nu` binary and the lovely `fastmod` tool:

```nushell
# Copy-pasted from the OP in [`gpuweb`#4838](https://github.com/gpuweb/gpuweb/pull/4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update old { strip_gpu_prefix | str trim }
  | update new { strip_gpu_prefix | str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

def strip_gpu_prefix []: string -> string {
  $in | str replace --regex '^GPU' ''
}

# Rename image APIs.
for entry in $renames_table {
  fastmod --accept-all --fixed-strings $entry.old $entry.new --iglob '!CHANGELOG.md' --iglob "!xtask/src/vendor_web_sys.rs" --iglob '!wgpu/src/backend/webgpu/webgpu_sys/' --iglob '!deno_webgpu/' --iglob '!wgpu/src/backend/webgpu.rs'
}
cargo fmt
```

…and cleaning up `deno_webgpu/`'s Rust compilation errors.
2024-11-26 23:16:35 -05:00
Jasper St. Pierre
7fff667c5a [glsl-in] Don't reinterpret function arguments twice in the normal case
We already lowered the function expression if it's a normal in argument; no need to do it again. This eliminates an unused variable and expression. With chained function calls, this could lead to a lot of waste.

There's still an extra unused expression in the case of an out/inout argument; ideally we'd remove these expressions, but it might be tricky.

Fixes #6602
2024-11-26 11:32:15 -08:00
teoxoy
e2eeba7dae [wgpu-core] document which closures are guaranteed to be called 2024-11-26 20:31:18 +01:00