mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-30 18:14:18 +01:00
Bring immediate api in line with spec (#8724)
This commit is contained in:
1 parent
5f5d88b96e
commit
e52e8336b0
100 files changed
+322
-647
No files matched your search
@@ -127,7 +127,7 @@ fn setup_pipeline(
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("Compute Pipeline Layout"),
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
||||
|
||||
@@ -107,7 +107,7 @@ impl crate::framework::Example for Example {
|
||||
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("compute"),
|
||||
bind_group_layouts: &[&compute_bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
// create render pipeline with empty bind group layout
|
||||
@@ -116,7 +116,7 @@ impl crate::framework::Example for Example {
|
||||
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("render"),
|
||||
bind_group_layouts: &[],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
|
||||
@@ -201,7 +201,7 @@ impl crate::framework::Example for Example {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&global_bind_group_layout, &local_bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
|
||||
@@ -78,7 +78,7 @@ impl crate::framework::Example for Example {
|
||||
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let shader_triangle_and_lines =
|
||||
@@ -195,7 +195,7 @@ impl crate::framework::Example for Example {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
let shader = device.create_shader_module(wgpu::include_wgsl!("upscale.wgsl"));
|
||||
(
|
||||
|
||||
@@ -158,7 +158,7 @@ impl crate::framework::Example for Example {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
// Create the texture
|
||||
|
||||
@@ -91,7 +91,7 @@ async fn execute(
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
let patient_pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
||||
label: None,
|
||||
|
||||
@@ -47,7 +47,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let swapchain_capabilities = surface.get_capabilities(&adapter);
|
||||
|
||||
@@ -100,7 +100,7 @@ async fn run() {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
let pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
||||
label: None,
|
||||
|
||||
@@ -104,7 +104,7 @@ impl crate::framework::Example for Example {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
let pipeline = device.create_mesh_pipeline(&wgpu::MeshPipelineDescriptor {
|
||||
label: None,
|
||||
|
||||
@@ -161,7 +161,7 @@ impl crate::framework::Example for Example {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let multisampled_framebuffer =
|
||||
|
||||
@@ -112,7 +112,7 @@ impl MultiTargetRenderer {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&texture_bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let sampler = device.create_sampler(&wgpu::SamplerDescriptor {
|
||||
@@ -232,7 +232,7 @@ impl TargetRenderer {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&texture_bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let sampler = device.create_sampler(&wgpu::SamplerDescriptor {
|
||||
|
||||
@@ -186,10 +186,7 @@ impl crate::framework::Example for Example {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
immediates_ranges: &[wgpu::ImmediateRange {
|
||||
stages: wgpu::ShaderStages::FRAGMENT,
|
||||
range: 0..12,
|
||||
}],
|
||||
immediate_size: 12,
|
||||
});
|
||||
|
||||
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
@@ -331,9 +328,9 @@ impl crate::framework::Example for Example {
|
||||
|
||||
rpass.set_pipeline(&self.pipeline);
|
||||
rpass.set_bind_group(0, Some(&self.bind_group), &[]);
|
||||
rpass.set_immediates(wgpu::ShaderStages::FRAGMENT, 0, &0.0_f32.to_ne_bytes());
|
||||
rpass.set_immediates(wgpu::ShaderStages::FRAGMENT, 4, &cos.to_ne_bytes());
|
||||
rpass.set_immediates(wgpu::ShaderStages::FRAGMENT, 8, &sin.to_ne_bytes());
|
||||
rpass.set_immediates(0, &0.0_f32.to_ne_bytes());
|
||||
rpass.set_immediates(4, &cos.to_ne_bytes());
|
||||
rpass.set_immediates(8, &sin.to_ne_bytes());
|
||||
rpass.set_vertex_buffer(0, self.vertex_buf.slice(..));
|
||||
rpass.set_index_buffer(self.index_buf.slice(..), IndexFormat::Uint16);
|
||||
rpass.draw_indexed(0..12, 0, 0..1);
|
||||
|
||||
@@ -269,7 +269,7 @@ impl crate::framework::Example for Example {
|
||||
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("pipeline layout for shader.wgsl"),
|
||||
bind_group_layouts: &[&bgl],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let compute_pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
||||
@@ -284,7 +284,7 @@ impl crate::framework::Example for Example {
|
||||
let blit_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("pipeline layout for blit.wgsl"),
|
||||
bind_group_layouts: &[&blit_bgl],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let blit_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
|
||||
@@ -229,7 +229,7 @@ impl WgpuContext {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
let pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
||||
label: None,
|
||||
|
||||
@@ -466,7 +466,7 @@ impl crate::framework::Example for Example {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("shadow"),
|
||||
bind_group_layouts: &[&bind_group_layout, &local_bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let uniform_buf = device.create_buffer(&wgpu::BufferDescriptor {
|
||||
@@ -582,7 +582,7 @@ impl crate::framework::Example for Example {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("main"),
|
||||
bind_group_layouts: &[&bind_group_layout, &local_bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let mx_total = Self::generate_matrix(config.width as f32 / config.height as f32);
|
||||
|
||||
@@ -187,7 +187,7 @@ impl crate::framework::Example for Example {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
// Create the render pipelines
|
||||
|
||||
@@ -92,7 +92,7 @@ impl<const SRGB: bool> crate::framework::Example for Example<SRGB> {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
// Create bind group
|
||||
|
||||
@@ -48,7 +48,7 @@ impl crate::framework::Example for Example {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let shader = device.create_shader_module(wgpu::include_wgsl!("shader.wgsl"));
|
||||
|
||||
@@ -90,7 +90,7 @@ async fn run(_path: Option<String>) {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
let pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
||||
label: None,
|
||||
|
||||
@@ -328,7 +328,7 @@ impl crate::framework::Example for Example {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("main"),
|
||||
bind_group_layouts: &[&bind_group_layout, &uniform_bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let index_format = wgpu::IndexFormat::Uint16;
|
||||
|
||||
@@ -351,7 +351,7 @@ fn render_pass(
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: None,
|
||||
bind_group_layouts: &[],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
|
||||
@@ -162,7 +162,7 @@ impl WgpuContext {
|
||||
label: None,
|
||||
// (4)
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let swapchain_capabilities = surface.get_capabilities(&adapter);
|
||||
|
||||
@@ -428,14 +428,14 @@ impl crate::framework::Example for Example {
|
||||
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("water"),
|
||||
bind_group_layouts: &[&water_bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let terrain_pipeline_layout =
|
||||
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("terrain"),
|
||||
bind_group_layouts: &[&terrain_bind_group_layout],
|
||||
immediates_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let water_uniform_buf = device.create_buffer(&wgpu::BufferDescriptor {
|
||||
|
||||
Reference in new issue
Block a user