Skip to content

Commit 3d4cf73

Browse files
Add read-only and read-write storage texture accesses (#21033)
1 parent de06cab commit 3d4cf73

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

src/library_webgpu.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,8 @@ var LibraryWebGPU = {
491491
StorageTextureAccess: [
492492
undefined,
493493
'write-only',
494+
'read-only',
495+
'read-write',
494496
],
495497
StoreOp: [
496498
undefined,

system/include/webgpu/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Dawn additionally autogenerates two "snippets" that are used in Emscripten:
1919
Once that's done, you need to update the auto-generated files with the commands below:
2020

2121
```
22-
./tools/gen_struct_info.py
23-
./tools/gen_struct_info.py --wasm64
24-
./tools/gen_sig_info.py
22+
./tools/maint/gen_struct_info.py
23+
./tools/maint/gen_struct_info.py --wasm64
24+
./tools/maint/gen_sig_info.py
2525
```
2626

2727
## Testing

system/include/webgpu/webgpu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,8 @@ typedef enum WGPUStencilOperation {
451451
typedef enum WGPUStorageTextureAccess {
452452
WGPUStorageTextureAccess_Undefined = 0x00000000,
453453
WGPUStorageTextureAccess_WriteOnly = 0x00000001,
454+
WGPUStorageTextureAccess_ReadOnly = 0x00000002,
455+
WGPUStorageTextureAccess_ReadWrite = 0x00000003,
454456
WGPUStorageTextureAccess_Force32 = 0x7FFFFFFF
455457
} WGPUStorageTextureAccess WGPU_ENUM_ATTRIBUTE;
456458

system/include/webgpu/webgpu_cpp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ namespace wgpu {
394394
enum class StorageTextureAccess : uint32_t {
395395
Undefined = 0x00000000,
396396
WriteOnly = 0x00000001,
397+
ReadOnly = 0x00000002,
398+
ReadWrite = 0x00000003,
397399
};
398400

399401
enum class StoreOp : uint32_t {

system/lib/webgpu/webgpu_cpp.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,8 @@ namespace wgpu {
358358

359359
static_assert(static_cast<uint32_t>(StorageTextureAccess::Undefined) == WGPUStorageTextureAccess_Undefined, "value mismatch for StorageTextureAccess::Undefined");
360360
static_assert(static_cast<uint32_t>(StorageTextureAccess::WriteOnly) == WGPUStorageTextureAccess_WriteOnly, "value mismatch for StorageTextureAccess::WriteOnly");
361+
static_assert(static_cast<uint32_t>(StorageTextureAccess::ReadOnly) == WGPUStorageTextureAccess_ReadOnly, "value mismatch for StorageTextureAccess::ReadOnly");
362+
static_assert(static_cast<uint32_t>(StorageTextureAccess::ReadWrite) == WGPUStorageTextureAccess_ReadWrite, "value mismatch for StorageTextureAccess::ReadWrite");
361363

362364
// StoreOp
363365

0 commit comments

Comments
 (0)