From 2e48faf95d931bf5285848da2a5c7e997b442faf Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Fri, 10 Oct 2025 18:11:16 +0200 Subject: [PATCH] Map more limits in WebGPU (#8328) --- CHANGELOG.md | 1 + wgpu/src/backend/webgpu.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac01874cd..400f9624a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,6 +83,7 @@ SamplerDescriptor { #### General - Reject fragment shader output `location`s > `max_color_attachments` limit. By @ErichDonGubler in [#8316](https://github.com/gfx-rs/wgpu/pull/8316). +- WebGPU device requests now support the required limits `maxColorAttachments` and `maxColorAttachmentBytesPerSample`. By @evilpie in [#8328](https://github.com/gfx-rs/wgpu/pull/8328) ## v27.0.2 (2025-10-03) diff --git a/wgpu/src/backend/webgpu.rs b/wgpu/src/backend/webgpu.rs index 5ea8e50d7..be5418bb1 100644 --- a/wgpu/src/backend/webgpu.rs +++ b/wgpu/src/backend/webgpu.rs @@ -858,6 +858,7 @@ fn map_js_sys_limits(limits: &wgt::Limits) -> js_sys::Object { } } + // https://gpuweb.github.io/gpuweb/#gpusupportedlimits set_properties![ (limits) => (object): (maxTextureDimension1D, max_texture_dimension_1d), @@ -865,6 +866,7 @@ fn map_js_sys_limits(limits: &wgt::Limits) -> js_sys::Object { (maxTextureDimension3D, max_texture_dimension_3d), (maxTextureArrayLayers, max_texture_array_layers), (maxBindGroups, max_bind_groups), + // TODO: (maxBindGroupsPlusVertexBuffers, max_bind_groups_plus_vertex_buffers), (maxBindingsPerBindGroup, max_bindings_per_bind_group), (maxDynamicUniformBuffersPerPipelineLayout, max_dynamic_uniform_buffers_per_pipeline_layout), (maxDynamicStorageBuffersPerPipelineLayout, max_dynamic_storage_buffers_per_pipeline_layout), @@ -881,6 +883,9 @@ fn map_js_sys_limits(limits: &wgt::Limits) -> js_sys::Object { (maxBufferSize, max_buffer_size), (maxVertexAttributes, max_vertex_attributes), (maxVertexBufferArrayStride, max_vertex_buffer_array_stride), + // TODO: (maxInterStageShaderVariables, max_inter_stage_shader_variables), + (maxColorAttachments, max_color_attachments), + (maxColorAttachmentBytesPerSample, max_color_attachment_bytes_per_sample), (maxComputeWorkgroupStorageSize, max_compute_workgroup_storage_size), (maxComputeInvocationsPerWorkgroup, max_compute_invocations_per_workgroup), (maxComputeWorkgroupSizeX, max_compute_workgroup_size_x),