diff --git a/CHANGELOG.md b/CHANGELOG.md index eb121071..efc4cfbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,9 @@ The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/ ## Unreleased -### Changed +### 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. 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/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. * 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(