From 11cf1c1b6019331f2c93eb1815066ce0bbb09f2b Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 16 Apr 2026 22:58:47 +0200 Subject: [PATCH 1/5] don't use layout extras --- examples/immediates/main.c | 11 ++--------- src/conv.rs | 3 +-- src/lib.rs | 6 +----- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/examples/immediates/main.c b/examples/immediates/main.c index e23f3e5b..96370a82 100644 --- a/examples/immediates/main.c +++ b/examples/immediates/main.c @@ -100,14 +100,6 @@ int main(int argc, char *argv[]) { }); assert(staging_buffer); - WGPUPipelineLayoutExtras pipeline_layout_extras = { - .chain = - { - .sType = WGPUSType_PipelineLayoutExtras, - }, - .immediateDataSize = sizeof(uint32_t), - }; - WGPUBindGroupLayoutEntry bind_group_layout_entries[] = { { .binding = 0, @@ -130,9 +122,10 @@ int main(int argc, char *argv[]) { WGPUPipelineLayoutDescriptor pipeline_layout_desc = { .label = {"pipeline_layout", WGPU_STRLEN}, - .nextInChain = &pipeline_layout_extras.chain, + .nextInChain = NULL, .bindGroupLayouts = &bind_group_layout, .bindGroupLayoutCount = 1, + .immediateSize = sizeof(uint32_t), }; WGPUPipelineLayout pipeline_layout = wgpuDeviceCreatePipelineLayout(device, &pipeline_layout_desc); diff --git a/src/conv.rs b/src/conv.rs index 2a241d9f..c03b11bd 100644 --- a/src/conv.rs +++ b/src/conv.rs @@ -495,7 +495,6 @@ pub(crate) unsafe fn map_device_descriptor<'a>( #[inline] pub unsafe fn map_pipeline_layout_descriptor<'a>( des: &native::WGPUPipelineLayoutDescriptor, - extras: Option<&native::WGPUPipelineLayoutExtras>, ) -> wgc::binding_model::PipelineLayoutDescriptor<'a> { let bind_group_layouts = make_slice(des.bindGroupLayouts, des.bindGroupLayoutCount) .iter() @@ -509,7 +508,7 @@ pub unsafe fn map_pipeline_layout_descriptor<'a>( }) .collect::>(); - let immediate_size = extras.map_or(0, |extras| extras.immediateDataSize); + let immediate_size = des.immediateSize; wgc::binding_model::PipelineLayoutDescriptor { label: string_view_into_label(des.label), diff --git a/src/lib.rs b/src/lib.rs index 7488e584..7a40f1a2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2071,11 +2071,7 @@ pub unsafe extern "C" fn wgpuDeviceCreatePipelineLayout( }; let descriptor = descriptor.expect("invalid descriptor"); - let desc = follow_chain!( - map_pipeline_layout_descriptor( - (descriptor), - WGPUSType_PipelineLayoutExtras => native::WGPUPipelineLayoutExtras) - ); + let desc = map_pipeline_layout_descriptor(descriptor); let (pipeline_layout_id, error) = context.device_create_pipeline_layout(device_id, &desc, None); if let Some(cause) = error { handle_error( From b91fab414a8f9d36eb6ab4381e0a79c964b57f27 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 16 Apr 2026 23:03:00 +0200 Subject: [PATCH 2/5] update header --- ffi/wgpu.h | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/ffi/wgpu.h b/ffi/wgpu.h index e370ea4e..c325ce2d 100644 --- a/ffi/wgpu.h +++ b/ffi/wgpu.h @@ -21,8 +21,6 @@ typedef enum WGPUNativeSType WGPUSType_DeviceExtras = 0x00030001, /** Identifies @ref WGPUNativeLimits. */ WGPUSType_NativeLimits = 0x00030002, - /** Identifies @ref WGPUPipelineLayoutExtras. */ - WGPUSType_PipelineLayoutExtras = 0x00030003, /** Identifies @ref WGPUShaderSourceGLSL. */ WGPUSType_ShaderSourceGLSL = 0x00030004, /** Identifies @ref WGPUInstanceExtras. */ @@ -96,8 +94,8 @@ typedef enum WGPUNativeFeature * Enables @ref wgpuRenderPassEncoderSetImmediates, * @ref wgpuComputePassEncoderSetImmediates, * @ref wgpuRenderBundleEncoderSetImmediates, - * non-zero @c immediateDataSize in @ref WGPUPipelineLayoutExtras, - * and non-zero @c maxImmediateSize in @ref WGPUNativeLimits. + * non-zero @c immediateSize in @ref WGPUPipelineLayout, + * and non-zero @c maxImmediateSize in @ref WGPULimits. * * A block of immediate data can be declared in WGSL with * @c var: @@ -1224,20 +1222,6 @@ typedef struct WGPUNativeLimits /*.maxMultiviewViewCount=*/WGPU_LIMIT_U32_UNDEFINED _wgpu_COMMA \ }) -typedef struct WGPUPipelineLayoutExtras -{ - WGPUChainedStruct chain; - /** - * The number of bytes of immediate data allocated for use in shaders - * attached to this pipeline. - * - * The @c var declarations in the shader must be equal or - * smaller than this size. If this value is non-zero, - * @ref WGPUNativeFeature_Immediates must be enabled. - */ - uint32_t immediateDataSize; -} WGPUPipelineLayoutExtras; - /** * Identifier for a particular call to @ref wgpuQueueSubmitForIndex. * From b0aee59b5ee0314183601d793202de51acc92af3 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 16 Apr 2026 23:22:28 +0200 Subject: [PATCH 3/5] add changelog entry --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb121071..c4b22e23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,18 @@ The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/ #### Table of Contents - [Unreleased](#unreleased) +- [v29.0.0.0](#v290000) - [Diffs](#diffs) + ## Unreleased +### Changed +- Immediates no longer uses `WGPUPipelineLayoutExtras` chain, the `WGPUPipelineLayoutDescriptor` takes `uint32_t immediateSize` directily. @Vipitis + + +## [v29.0.0.0](https://github.com/gfx-rs/wgpu-native/releases/tag/v29.0.0.0) + ### Changed - Updated all wgpu crates to v29 From 2a6765308e64f27c2fe911f69946bf11eabb24bc Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 18 Apr 2026 01:14:16 +0200 Subject: [PATCH 4/5] reduce changelog change --- CHANGELOG.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4b22e23..efc4cfbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,20 +7,13 @@ The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/ #### Table of Contents - [Unreleased](#unreleased) -- [v29.0.0.0](#v290000) - [Diffs](#diffs) - ## Unreleased -### Changed -- Immediates no longer uses `WGPUPipelineLayoutExtras` chain, the `WGPUPipelineLayoutDescriptor` takes `uint32_t immediateSize` directily. @Vipitis - - -## [v29.0.0.0](https://github.com/gfx-rs/wgpu-native/releases/tag/v29.0.0.0) ### Changed - +- Immediates no longer uses `WGPUPipelineLayoutExtras` chain, the `WGPUPipelineLayoutDescriptor` takes `uint32_t immediateSize` directily. By @Vipitis in [#583](https://github.com/gfx-rs/wgpu-native/pull/583). - Updated all wgpu crates to v29 - MSRV bumped from 1.82 to 1.87. - **Push constants renamed to immediates.** This matches the upstream wgpu rename. From c1fd6a244427d71cf5da8e6bd289b3926e75395c Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 30 Apr 2026 22:50:02 +0200 Subject: [PATCH 5/5] reenumerate Stypes enum --- ffi/wgpu.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ffi/wgpu.h b/ffi/wgpu.h index c325ce2d..ebf09e54 100644 --- a/ffi/wgpu.h +++ b/ffi/wgpu.h @@ -22,21 +22,21 @@ typedef enum WGPUNativeSType /** Identifies @ref WGPUNativeLimits. */ WGPUSType_NativeLimits = 0x00030002, /** Identifies @ref WGPUShaderSourceGLSL. */ - WGPUSType_ShaderSourceGLSL = 0x00030004, + WGPUSType_ShaderSourceGLSL = 0x00030003, /** Identifies @ref WGPUInstanceExtras. */ - WGPUSType_InstanceExtras = 0x00030006, + WGPUSType_InstanceExtras = 0x00030004, /** Identifies @ref WGPUBindGroupEntryExtras. */ - WGPUSType_BindGroupEntryExtras = 0x00030007, + WGPUSType_BindGroupEntryExtras = 0x00030005, /** Identifies @ref WGPUBindGroupLayoutEntryExtras. */ - WGPUSType_BindGroupLayoutEntryExtras = 0x00030008, + WGPUSType_BindGroupLayoutEntryExtras = 0x00030006, /** Identifies @ref WGPUQuerySetDescriptorExtras. */ - WGPUSType_QuerySetDescriptorExtras = 0x00030009, + WGPUSType_QuerySetDescriptorExtras = 0x00030007, /** Identifies @ref WGPUSurfaceConfigurationExtras. */ - WGPUSType_SurfaceConfigurationExtras = 0x0003000A, + WGPUSType_SurfaceConfigurationExtras = 0x00030008, /** Identifies @ref WGPUSurfaceSourceSwapChainPanel. */ - WGPUSType_SurfaceSourceSwapChainPanel = 0x0003000B, + WGPUSType_SurfaceSourceSwapChainPanel = 0x00030009, /** Identifies @ref WGPUPrimitiveStateExtras. */ - WGPUSType_PrimitiveStateExtras = 0x0003000C, + WGPUSType_PrimitiveStateExtras = 0x0003000A, WGPUNativeSType_Force32 = 0x7FFFFFFF } WGPUNativeSType;