fix(ui): make modal layouts intrinsic

Pin Iced 0.15 so dialogs can measure content before distributing the resolved frame across child panels. Keep the web plugin notice compact and non-resizable.\n\nCloses #582
This commit is contained in:
Hakan Seven committed 2026-07-30 14:47:28 +03:00
1 parent 284d6ef517
commit 3ab8dc3ca5
59 files changed
+2197 -1652

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ impl DeviceCapabilities {
fn from_limits(limits: &wgpu::Limits) -> Self {
Self {
max_storage_buffers_per_shader_stage: limits.max_storage_buffers_per_shader_stage,
max_inter_stage_shader_components: limits.max_inter_stage_shader_components,
max_inter_stage_shader_components: limits.max_inter_stage_shader_variables,
max_vertex_attributes: limits.max_vertex_attributes,
}
}
+5 -5
View File
@@ -68,8 +68,8 @@ impl HatchGpu {
};
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("hatch.pipeline_layout"),
bind_group_layouts: &[frame_bind_group_layout, &bind_group_layout],
push_constant_ranges: &[],
bind_group_layouts: &[frame_bind_group_layout, &bind_group_layout].map(Some),
immediate_size: 0,
});
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: Some(if uses_storage {
@@ -108,8 +108,8 @@ impl HatchGpu {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: true,
depth_compare: wgpu::CompareFunction::LessEqual,
depth_write_enabled: Some(true),
depth_compare: Some(wgpu::CompareFunction::LessEqual),
stencil: content_stencil.clone(),
bias: wgpu::DepthBiasState {
constant: 1,
@@ -132,7 +132,7 @@ impl HatchGpu {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
let backend = match backend_kind {
+1 -1
View File
@@ -122,7 +122,7 @@ impl ImageGpu {
address_mode_w: wgpu::AddressMode::ClampToEdge,
mag_filter: wgpu::FilterMode::Linear,
min_filter: wgpu::FilterMode::Linear,
mipmap_filter: wgpu::FilterMode::Nearest,
mipmap_filter: wgpu::MipmapFilterMode::Nearest,
..Default::default()
});
+1 -1
View File
@@ -501,7 +501,7 @@ pub fn create_material_bind_group(
address_mode_w: address,
mag_filter: wgpu::FilterMode::Linear,
min_filter: wgpu::FilterMode::Linear,
mipmap_filter: wgpu::FilterMode::Linear,
mipmap_filter: wgpu::MipmapFilterMode::Linear,
..Default::default()
})
};
+67 -56
View File
@@ -380,14 +380,14 @@ impl Pipeline {
let wire_const_bgl = wire_mode
.uses_storage()
.then(|| wire_gpu::WireConst::bind_group_layout(device));
let mut wire_bgls: Vec<&wgpu::BindGroupLayout> = vec![&frame_bgl];
let mut wire_bgls: Vec<Option<&wgpu::BindGroupLayout>> = vec![Some(&frame_bgl)];
if let Some(bgl) = &wire_const_bgl {
wire_bgls.push(bgl);
wire_bgls.push(Some(bgl));
}
let wire_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("wire.pipeline_layout"),
bind_group_layouts: &wire_bgls,
push_constant_ranges: &[],
immediate_size: 0,
});
let depth_tex = create_depth_texture(device, Size::new(1, 1));
@@ -438,8 +438,8 @@ impl Pipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: true,
depth_compare: wgpu::CompareFunction::LessEqual,
depth_write_enabled: Some(true),
depth_compare: Some(wgpu::CompareFunction::LessEqual),
stencil: content_stencil.clone(),
bias: wgpu::DepthBiasState::default(),
}),
@@ -458,7 +458,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
@@ -476,7 +476,7 @@ impl Pipeline {
let clip_mask_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("clip_mask.pipeline_layout"),
bind_group_layouts: &[],
push_constant_ranges: &[],
immediate_size: 0,
});
let clip_mask_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
label: Some("clip_mask.pipeline"),
@@ -502,8 +502,8 @@ impl Pipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: false,
depth_compare: wgpu::CompareFunction::Always,
depth_write_enabled: Some(false),
depth_compare: Some(wgpu::CompareFunction::Always),
stencil: wgpu::StencilState {
front: wgpu::StencilFaceState {
compare: wgpu::CompareFunction::Always,
@@ -537,7 +537,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
@@ -559,8 +559,8 @@ impl Pipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: true,
depth_compare: wgpu::CompareFunction::LessEqual,
depth_write_enabled: Some(true),
depth_compare: Some(wgpu::CompareFunction::LessEqual),
stencil: content_stencil.clone(),
bias: wgpu::DepthBiasState::default(),
}),
@@ -579,7 +579,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
@@ -602,8 +602,8 @@ impl Pipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: false,
depth_compare: wgpu::CompareFunction::Always,
depth_write_enabled: Some(false),
depth_compare: Some(wgpu::CompareFunction::Always),
stencil: content_stencil.clone(),
bias: wgpu::DepthBiasState::default(),
}),
@@ -622,7 +622,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
@@ -654,8 +654,8 @@ impl Pipeline {
let wipeout_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("wipeout.pipeline_layout"),
bind_group_layouts: &[&frame_bgl, &wipeout_bgl1],
push_constant_ranges: &[],
bind_group_layouts: &[&frame_bgl, &wipeout_bgl1].map(Some),
immediate_size: 0,
});
let wipeout_shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
@@ -681,8 +681,8 @@ impl Pipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: true,
depth_compare: wgpu::CompareFunction::LessEqual,
depth_write_enabled: Some(true),
depth_compare: Some(wgpu::CompareFunction::LessEqual),
stencil: content_stencil.clone(),
// Bias TOWARD the camera: a wipeout must win against geometry at
// its own depth (a block's wipeout + shapes are coincident at
@@ -710,7 +710,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
@@ -850,8 +850,8 @@ impl Pipeline {
let layout =
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("mesh.cull.layout"),
bind_group_layouts: &[&bgl],
push_constant_ranges: &[],
bind_group_layouts: &[&bgl].map(Some),
immediate_size: 0,
});
let pipeline =
device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
@@ -1027,8 +1027,8 @@ impl Pipeline {
let mesh_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("mesh.pipeline_layout"),
bind_group_layouts: &[&frame_bgl, &mesh_material_bgl],
push_constant_ranges: &[],
bind_group_layouts: &[&frame_bgl, &mesh_material_bgl].map(Some),
immediate_size: 0,
});
let mesh_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
@@ -1047,8 +1047,8 @@ impl Pipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: true,
depth_compare: wgpu::CompareFunction::LessEqual,
depth_write_enabled: Some(true),
depth_compare: Some(wgpu::CompareFunction::LessEqual),
stencil: content_stencil.clone(),
bias: wgpu::DepthBiasState {
constant: 1,
@@ -1071,7 +1071,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
@@ -1096,8 +1096,8 @@ impl Pipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: false,
depth_compare: wgpu::CompareFunction::LessEqual,
depth_write_enabled: Some(false),
depth_compare: Some(wgpu::CompareFunction::LessEqual),
stencil: content_stencil.clone(),
bias: wgpu::DepthBiasState {
constant: 1,
@@ -1120,7 +1120,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
@@ -1144,8 +1144,8 @@ impl Pipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: false,
depth_compare: wgpu::CompareFunction::Always,
depth_write_enabled: Some(false),
depth_compare: Some(wgpu::CompareFunction::Always),
stencil: content_stencil.clone(),
bias: wgpu::DepthBiasState::default(),
}),
@@ -1164,7 +1164,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
})
};
@@ -1199,8 +1199,8 @@ impl Pipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: true,
depth_compare: wgpu::CompareFunction::LessEqual,
depth_write_enabled: Some(true),
depth_compare: Some(wgpu::CompareFunction::LessEqual),
stencil: content_stencil.clone(),
bias: wgpu::DepthBiasState::default(),
}),
@@ -1219,7 +1219,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
})
};
@@ -1246,8 +1246,8 @@ impl Pipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: true,
depth_compare: wgpu::CompareFunction::LessEqual,
depth_write_enabled: Some(true),
depth_compare: Some(wgpu::CompareFunction::LessEqual),
stencil: content_stencil.clone(),
bias: wgpu::DepthBiasState {
constant: 1,
@@ -1270,7 +1270,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
@@ -1284,8 +1284,8 @@ impl Pipeline {
let face3d_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("face3d.pipeline_layout"),
bind_group_layouts: &[&frame_bgl],
push_constant_ranges: &[],
bind_group_layouts: &[&frame_bgl].map(Some),
immediate_size: 0,
});
let face3d_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
@@ -1304,8 +1304,8 @@ impl Pipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: true,
depth_compare: wgpu::CompareFunction::LessEqual,
depth_write_enabled: Some(true),
depth_compare: Some(wgpu::CompareFunction::LessEqual),
stencil: content_stencil.clone(),
bias: wgpu::DepthBiasState {
constant: 1,
@@ -1328,7 +1328,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
@@ -1351,8 +1351,8 @@ impl Pipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: true,
depth_compare: wgpu::CompareFunction::LessEqual,
depth_write_enabled: Some(true),
depth_compare: Some(wgpu::CompareFunction::LessEqual),
stencil: content_stencil.clone(),
bias: wgpu::DepthBiasState {
constant: 1,
@@ -1375,7 +1375,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
@@ -1418,8 +1418,8 @@ impl Pipeline {
let image_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("image.pipeline_layout"),
bind_group_layouts: &[&frame_bgl, &image_bgl1],
push_constant_ranges: &[],
bind_group_layouts: &[&frame_bgl, &image_bgl1].map(Some),
immediate_size: 0,
});
let image_shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
@@ -1445,8 +1445,8 @@ impl Pipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: true,
depth_compare: wgpu::CompareFunction::LessEqual,
depth_write_enabled: Some(true),
depth_compare: Some(wgpu::CompareFunction::LessEqual),
stencil: content_stencil.clone(),
bias: wgpu::DepthBiasState::default(),
}),
@@ -1465,7 +1465,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
@@ -1533,8 +1533,8 @@ impl Pipeline {
let blit_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("blit.pipeline_layout"),
bind_group_layouts: &[&blit_bgl],
push_constant_ranges: &[],
bind_group_layouts: &[&blit_bgl].map(Some),
immediate_size: 0,
});
let blit_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
@@ -1572,7 +1572,7 @@ impl Pipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
@@ -2874,6 +2874,7 @@ impl Pipeline {
}),
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
// MSAA texture is clip-bounds-sized, so viewport starts at (0, 0).
pass.set_viewport(0.0, 0.0, vp.width as f32, vp.height as f32, 0.0, 1.0);
@@ -2918,6 +2919,7 @@ impl Pipeline {
}),
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
pass.set_viewport(0.0, 0.0, vp.width as f32, vp.height as f32, 0.0, 1.0);
pass.set_pipeline(&self.image_pipeline);
@@ -2968,6 +2970,7 @@ impl Pipeline {
}),
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
pass.set_viewport(0.0, 0.0, vp.width as f32, vp.height as f32, 0.0, 1.0);
pass.set_bind_group(0, &self.uniform_bind_group, &[]);
@@ -3373,6 +3376,7 @@ impl Pipeline {
}),
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
pass.set_viewport(0.0, 0.0, vp.width as f32, vp.height as f32, 0.0, 1.0);
pass.set_bind_group(0, &self.uniform_bind_group, &[]);
@@ -3423,6 +3427,7 @@ impl Pipeline {
}),
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
pass.set_viewport(0.0, 0.0, vp.width as f32, vp.height as f32, 0.0, 1.0);
pass.set_pipeline(&self.wire_pipeline);
@@ -3465,6 +3470,7 @@ impl Pipeline {
}),
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
pass.set_viewport(0.0, 0.0, vp.width as f32, vp.height as f32, 0.0, 1.0);
pass.set_pipeline(&self.wire_pipeline);
@@ -3559,6 +3565,7 @@ impl Pipeline {
}),
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
pass.set_viewport(0.0, 0.0, vp.width as f32, vp.height as f32, 0.0, 1.0);
pass.set_pipeline(&self.text_pipeline);
@@ -3604,6 +3611,7 @@ impl Pipeline {
}),
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
pass.set_viewport(0.0, 0.0, vp.width as f32, vp.height as f32, 0.0, 1.0);
pass.set_pipeline(&self.wipeout_pipeline);
@@ -3646,6 +3654,7 @@ impl Pipeline {
}),
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
pass.set_viewport(0.0, 0.0, vp.width as f32, vp.height as f32, 0.0, 1.0);
pass.set_bind_group(0, &self.uniform_bind_group, &[]);
@@ -3697,6 +3706,7 @@ impl Pipeline {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
// No draw calls — the pass itself triggers the MSAA resolve.
}
@@ -3722,6 +3732,7 @@ impl Pipeline {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
pass.set_viewport(
surface_dest.x as f32,
+11 -7
View File
@@ -223,7 +223,7 @@ impl TextAtlasGpu {
address_mode_w: wgpu::AddressMode::ClampToEdge,
mag_filter: wgpu::FilterMode::Linear,
min_filter: wgpu::FilterMode::Linear,
mipmap_filter: wgpu::FilterMode::Nearest,
mipmap_filter: wgpu::MipmapFilterMode::Nearest,
..Default::default()
});
let bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor {
@@ -267,8 +267,8 @@ pub fn create_pipelines(
});
let layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("text.pipeline.layout"),
bind_group_layouts: &[frame_bgl, atlas_bgl],
push_constant_ranges: &[],
bind_group_layouts: &[frame_bgl, atlas_bgl].map(Some),
immediate_size: 0,
});
let create = |label, depth_write_enabled, depth_compare| {
device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
@@ -306,16 +306,20 @@ pub fn create_pipelines(
mask: !0,
alpha_to_coverage_enabled: false,
},
multiview: None,
multiview_mask: None,
cache: None,
})
};
(
create("text.pipeline", true, wgpu::CompareFunction::LessEqual),
create(
"text.pipeline",
Some(true),
Some(wgpu::CompareFunction::LessEqual),
),
create(
"text.highlight.pipeline",
false,
wgpu::CompareFunction::Always,
Some(false),
Some(wgpu::CompareFunction::Always),
),
)
}
+10 -8
View File
@@ -510,8 +510,8 @@ impl ViewCubeText {
});
let layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("vc.text_layout"),
bind_group_layouts: &[&bgl],
push_constant_ranges: &[],
bind_group_layouts: &[&bgl].map(Some),
immediate_size: 0,
});
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: Some("vc.text_shader"),
@@ -545,7 +545,7 @@ impl ViewCubeText {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
let vertex_capacity = MAX_VERTS as u32;
@@ -782,6 +782,7 @@ impl ViewCubeText {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
pass.set_viewport(
clip.x as f32,
@@ -1172,8 +1173,8 @@ impl ViewCubePipeline {
});
let layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("vc.layout"),
bind_group_layouts: &[&bgl],
push_constant_ranges: &[],
bind_group_layouts: &[&bgl].map(Some),
immediate_size: 0,
});
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: Some("vc.shader"),
@@ -1199,8 +1200,8 @@ impl ViewCubePipeline {
},
depth_stencil: Some(wgpu::DepthStencilState {
format: wgpu::TextureFormat::Depth24PlusStencil8,
depth_write_enabled: true,
depth_compare: wgpu::CompareFunction::Less,
depth_write_enabled: Some(true),
depth_compare: Some(wgpu::CompareFunction::Less),
stencil: wgpu::StencilState::default(),
bias: wgpu::DepthBiasState::default(),
}),
@@ -1215,7 +1216,7 @@ impl ViewCubePipeline {
})],
compilation_options: wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});
let text = ViewCubeText::new(device, queue, format);
@@ -1303,6 +1304,7 @@ impl ViewCubePipeline {
}),
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});
pass.set_viewport(
clip.x as f32,
+3 -1
View File
@@ -50,7 +50,9 @@ fn instance_buffer_mapped<T: bytemuck::Pod>(
});
{
let mut view = buf.slice(..).get_mapped_range_mut();
view[..bytes.len()].copy_from_slice(bytes);
if !bytes.is_empty() {
view.slice(..bytes.len()).copy_from_slice(bytes);
}
}
buf.unmap();
buf