Commit Graph

9013 Commits

Author SHA1 Message Date
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
teoxoy
14af686b9f Remove device_unregister_device_lost_closure 2024-11-26 20:31:18 +01:00
teoxoy
86656e182b simplify DeviceLostClosure by removing its C variant 2024-11-26 20:31:18 +01:00
teoxoy
13fbf30813 simplify BufferMapCallback by removing its C variant 2024-11-26 20:31:18 +01:00
teoxoy
8e4622b399 simplify SubmittedWorkDoneClosure by removing its C variant 2024-11-26 20:31:18 +01:00
teoxoy
f4bdd1cb65 remove Dropped & ReplacedCallback variants of DeviceLostReason 2024-11-26 20:31:18 +01:00
teoxoy
f096c66938 remove DeviceLostClosure consumed check 2024-11-26 20:31:18 +01:00
teoxoy
816e9c5856 use FnOnce instead of Fn for the device lost closure 2024-11-26 20:31:18 +01:00
sotaroikeda
9ffafcf7b8 Add Metal SharedEvent to fence if it is supported (#6610)
Co-authored-by: Sotaro Ikeda <you@example.com>
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2024-11-26 19:25:07 +00:00
Sludge
a9f14c7a90 Allow 64-bit hex literals and const-evaluate unary ops (#6616)
* Allow 64-bit hex literals

* Implement const evaluation for unary 64-bit ops

* Test 64-bit hex literals

* Add changelog entry
2024-11-25 18:54:12 -08:00
Erich Gubler
3016c56db6 chore(naga): suppress irrefutable_let_patterns for EnableExtension matching in Error::as_parse_error (#6607) 2024-11-25 13:52:16 +01:00
atlv
05c9f43fa8 Fix atomic storage global use acces (#6600) 2024-11-25 12:06:12 +01:00
Andreas Reich
29bb44b19a Bump version & update changelog following 23.0.1 patch release (#6612)
* put in missing v22.1.0 changelog

* bump wgpu, wgpu-core, wgpu-hal to 23.0.1

* add changelog for v23.0.1, remove lines from v24 line
2024-11-25 09:54:49 +01:00