Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to wgpu 24.0.0 #455

Merged
merged 53 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
2baea09
Update library to latest webgpu-native headers
PJB3005 Sep 19, 2024
0c60733
Update C examples to new headers
PJB3005 Sep 19, 2024
980c2ff
Fix WGPUBufferMapAsyncStatus tomfoolery
PJB3005 Sep 19, 2024
8f34e48
Fix macOS typos in examples
PJB3005 Sep 19, 2024
b36e558
Update headers again
PJB3005 Sep 27, 2024
a4626db
Update wgpu.h to match new flag scheme
PJB3005 Sep 27, 2024
a256544
Update headers again, WGPUStringView
PJB3005 Oct 2, 2024
8947cf2
Only specify major version for bitflags dependency
PJB3005 Oct 2, 2024
fe965c8
Remove redundant unsafe block
PJB3005 Oct 2, 2024
f5040ed
Start upgrading, try to use Box<ComputePass>
eliemichel Oct 13, 2024
2afb356
Switch to *mut for ComputePass and RenderPass
eliemichel Oct 13, 2024
2293063
Adapt C examples
eliemichel Oct 13, 2024
eaa44b1
Clean up dependencies to point to wgpu repo
eliemichel Oct 13, 2024
23d8907
Format code
eliemichel Oct 13, 2024
482bc24
Add wgpuGetInstanceFeatures stuff
PJB3005 Oct 19, 2024
8f80a2c
I forgot to cargo fmt again
PJB3005 Oct 19, 2024
77dfe52
Implement "NotUsed" bind group entry types
PJB3005 Oct 19, 2024
3c3c292
Update to new undefined enums
PJB3005 Oct 20, 2024
aa6b617
Update for other enum changes
PJB3005 Oct 20, 2024
2cb389b
Update for new header features
PJB3005 Oct 20, 2024
b6b6903
Fix getFeatures chained struct handling.
PJB3005 Oct 20, 2024
4d49d7f
Flatten limits structures
PJB3005 Oct 20, 2024
24ec452
Merge remote-tracking branch 'upstream/trunk' into 24-09-19-update-he…
PJB3005 Oct 20, 2024
620405f
Some day I will learn to run cargo fmt and check compile before merges
PJB3005 Oct 20, 2024
ab33119
Merge branch 'trunk' into eliemichel/2024-10-14-upgrade-wgpu
eliemichel Oct 20, 2024
2d1888b
Upgrade timestamp functions
eliemichel Oct 20, 2024
e81dd63
Fix push_constant example
eliemichel Oct 20, 2024
76df580
Upgrade to what is almost wgpu 23.0.0
eliemichel Oct 27, 2024
ecc0266
Upgrade to official v23.0.0
eliemichel Nov 12, 2024
e36359f
Upgrade to latest webgpu.h
eliemichel Nov 12, 2024
6eb8945
Add missing unimplemented symbols
eliemichel Nov 15, 2024
cae717c
Update wgpu dependencies to v24 and multiple crate versions
ygdrasil-io Jan 24, 2025
5ff04d1
Add handling for R64Uint texture format in conversion logic
ygdrasil-io Jan 24, 2025
f8c1945
Handle unknown SurfaceStatus in texture status mapping
ygdrasil-io Jan 24, 2025
b5136f8
Update shader bound checks to runtime checks
ygdrasil-io Jan 24, 2025
ab9338b
Add usage mapping to TextureViewDescriptor construction
ygdrasil-io Jan 24, 2025
6a7cd2c
Remove unused texture view usage check and TODO comment
ygdrasil-io Jan 24, 2025
345e112
Refactor to remove unused `texture_usage` variable.
ygdrasil-io Jan 24, 2025
8e8de3c
Update error variant for surface capabilities retrieval
ygdrasil-io Jan 24, 2025
69aabec
Update ShaderModuleDescriptor to use runtime_checks field
ygdrasil-io Jan 24, 2025
0021838
Refactor texture copy types and update experimental features.
ygdrasil-io Jan 24, 2025
8e70d82
Remove redundant return statement in NULL_FUTURE usage
ygdrasil-io Jan 24, 2025
ee635ae
Refactor load/store op mapping and enhance DX12 compiler handling
ygdrasil-io Jan 24, 2025
e4cb7b5
Fix DXC path assignment and update backend options structure
ygdrasil-io Jan 24, 2025
90d7ce2
Refactor callback and closure handling for clarity
ygdrasil-io Jan 24, 2025
da90331
Remove redundant return statements for NULL_FUTURE
ygdrasil-io Jan 25, 2025
452b21e
Refactor surface handling logic in texture release.
ygdrasil-io Jan 25, 2025
61c9e75
Merge remote-tracking branch 'origin-real/trunk' into feature/upgrade…
ygdrasil-io Jan 25, 2025
2411bb8
Fix type mismatch in wgpuRenderBundleEncoderSetPushConstants
ygdrasil-io Jan 25, 2025
9ab239b
Run cargo fmt
ygdrasil-io Jan 25, 2025
70a8705
Fix incorrect initialization and state updates for command buffers
ygdrasil-io Jan 26, 2025
df33227
Remove `map_load_op_and_color` and update load operation mapping.
ygdrasil-io Jan 26, 2025
4fbdf65
Merge branch 'trunk' into feature/upgrade-to-wgpu-24.0.0
ygdrasil-io Jan 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update wgpu.h to match new flag scheme
Upstream removed the "Flags" suffix from flags types and moved them to no longer be C enums. This matches that change. WGPUInstanceFlag still has "Flag" in the name because, well, there'd be nothing left to distinguish it from WGPUInstance, and it makes sense for it.
  • Loading branch information
PJB3005 committed Sep 27, 2024
commit a4626db10b06c18ac351d972b75eafa059d98a48
50 changes: 23 additions & 27 deletions ffi/wgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,26 @@ typedef enum WGPULogLevel {
WGPULogLevel_Force32 = 0x7FFFFFFF
} WGPULogLevel;

typedef enum WGPUInstanceBackend {
WGPUInstanceBackend_All = 0x00000000,
WGPUInstanceBackend_Vulkan = 1 << 0,
WGPUInstanceBackend_GL = 1 << 1,
WGPUInstanceBackend_Metal = 1 << 2,
WGPUInstanceBackend_DX12 = 1 << 3,
WGPUInstanceBackend_DX11 = 1 << 4,
WGPUInstanceBackend_BrowserWebGPU = 1 << 5,
WGPUInstanceBackend_Primary = WGPUInstanceBackend_Vulkan | WGPUInstanceBackend_Metal |
WGPUInstanceBackend_DX12 |
WGPUInstanceBackend_BrowserWebGPU,
WGPUInstanceBackend_Secondary = WGPUInstanceBackend_GL | WGPUInstanceBackend_DX11,
WGPUInstanceBackend_Force32 = 0x7FFFFFFF
} WGPUInstanceBackend;
typedef WGPUFlags WGPUInstanceBackendFlags;

typedef enum WGPUInstanceFlag {
WGPUInstanceFlag_Default = 0x00000000,
WGPUInstanceFlag_Debug = 1 << 0,
WGPUInstanceFlag_Validation = 1 << 1,
WGPUInstanceFlag_DiscardHalLabels = 1 << 2,
WGPUInstanceFlag_Force32 = 0x7FFFFFFF
} WGPUInstanceFlag;
typedef WGPUFlags WGPUInstanceFlags;
typedef WGPUFlags WGPUInstanceBackend;
static const WGPUInstanceBackend WGPUInstanceBackend_All = 0x00000000;
static const WGPUInstanceBackend WGPUInstanceBackend_Vulkan = 1 << 0;
static const WGPUInstanceBackend WGPUInstanceBackend_GL = 1 << 1;
static const WGPUInstanceBackend WGPUInstanceBackend_Metal = 1 << 2;
static const WGPUInstanceBackend WGPUInstanceBackend_DX12 = 1 << 3;
static const WGPUInstanceBackend WGPUInstanceBackend_DX11 = 1 << 4;
static const WGPUInstanceBackend WGPUInstanceBackend_BrowserWebGPU = 1 << 5;
// Vulkan, Metal, DX12 and BrowserWebGPU
static const WGPUInstanceBackend WGPUInstanceBackend_Primary = (1 << 0) | (1 << 2) | (1 << 3) | (1 << 5);
// GL and DX11
static const WGPUInstanceBackend WGPUInstanceBackend_Secondary = (1 << 1) | (1 << 4);
static const WGPUInstanceBackend WGPUInstanceBackend_Force32 = 0x7FFFFFFF;

typedef WGPUFlags WGPUInstanceFlag;
static const WGPUInstanceFlag WGPUInstanceFlag_Default = 0x00000000;
static const WGPUInstanceFlag WGPUInstanceFlag_Debug = 1 << 0;
static const WGPUInstanceFlag WGPUInstanceFlag_Validation = 1 << 1;
static const WGPUInstanceFlag WGPUInstanceFlag_DiscardHalLabels = 1 << 2;
static const WGPUInstanceFlag WGPUInstanceFlag_Force32 = 0x7FFFFFFF;

typedef enum WGPUDx12Compiler {
WGPUDx12Compiler_Undefined = 0x00000000,
Expand Down Expand Up @@ -122,8 +118,8 @@ typedef enum WGPUNativeQueryType {

typedef struct WGPUInstanceExtras {
WGPUChainedStruct chain;
WGPUInstanceBackendFlags backends;
WGPUInstanceFlags flags;
WGPUInstanceBackend backends;
WGPUInstanceFlag flags;
WGPUDx12Compiler dx12ShaderCompiler;
WGPUGles3MinorVersion gles3MinorVersion;
const char * dxilPath;
Expand Down Expand Up @@ -220,7 +216,7 @@ typedef struct WGPUGlobalReport {

typedef struct WGPUInstanceEnumerateAdapterOptions {
WGPUChainedStruct const * nextInChain;
WGPUInstanceBackendFlags backends;
WGPUInstanceBackend backends;
} WGPUInstanceEnumerateAdapterOptions;

typedef struct WGPUBindGroupEntryExtras {
Expand Down
2 changes: 1 addition & 1 deletion src/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ pub fn map_instance_descriptor(
backends: map_instance_backend_flags(extras.backends as native::WGPUInstanceBackend),
dx12_shader_compiler,
gles_minor_version: map_gles3_minor_version(extras.gles3MinorVersion),
flags: match extras.flags as native::WGPUInstanceFlag {
flags: match extras.flags {
native::WGPUInstanceFlag_Default => wgt::InstanceFlags::default(),
flags => map_instance_flags(flags),
},
Expand Down
Loading