perf: remove shader checks
This commit is contained in:
@@ -126,7 +126,9 @@ pub struct BuddhabrotRenderer {
|
||||
|
||||
impl BuddhabrotRenderer {
|
||||
pub fn new(device: &wgpu::Device, target_format: wgpu::TextureFormat) -> Self {
|
||||
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
let shader = unsafe {
|
||||
device.create_shader_module_trusted(
|
||||
wgpu::ShaderModuleDescriptor {
|
||||
label: Some("buddhabrot"),
|
||||
source: wgpu::ShaderSource::Wgsl(
|
||||
concat!(
|
||||
@@ -135,7 +137,10 @@ impl BuddhabrotRenderer {
|
||||
)
|
||||
.into(),
|
||||
),
|
||||
});
|
||||
},
|
||||
wgpu::ShaderRuntimeChecks::unchecked(),
|
||||
)
|
||||
};
|
||||
|
||||
let uniform_buffer = device.create_buffer(&wgpu::BufferDescriptor {
|
||||
label: Some("buddhabrot uniforms"),
|
||||
|
||||
+28
-8
@@ -197,7 +197,9 @@ struct Lipschitz {
|
||||
|
||||
impl Lipschitz {
|
||||
fn new(device: &wgpu::Device) -> Self {
|
||||
let module = device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
let module = unsafe {
|
||||
device.create_shader_module_trusted(
|
||||
wgpu::ShaderModuleDescriptor {
|
||||
label: Some("lipschitz"),
|
||||
source: wgpu::ShaderSource::Wgsl(
|
||||
concat!(
|
||||
@@ -206,7 +208,10 @@ impl Lipschitz {
|
||||
)
|
||||
.into(),
|
||||
),
|
||||
});
|
||||
},
|
||||
wgpu::ShaderRuntimeChecks::unchecked(),
|
||||
)
|
||||
};
|
||||
let texture_entry = |binding| wgpu::BindGroupLayoutEntry {
|
||||
binding,
|
||||
visibility: wgpu::ShaderStages::FRAGMENT,
|
||||
@@ -617,7 +622,9 @@ impl FractalRenderer {
|
||||
}
|
||||
|
||||
pub fn new(device: &wgpu::Device, target_format: wgpu::TextureFormat) -> Self {
|
||||
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
let shader = unsafe {
|
||||
device.create_shader_module_trusted(
|
||||
wgpu::ShaderModuleDescriptor {
|
||||
label: Some("mandelbrot"),
|
||||
source: wgpu::ShaderSource::Wgsl(
|
||||
concat!(
|
||||
@@ -627,7 +634,10 @@ impl FractalRenderer {
|
||||
)
|
||||
.into(),
|
||||
),
|
||||
});
|
||||
},
|
||||
wgpu::ShaderRuntimeChecks::unchecked(),
|
||||
)
|
||||
};
|
||||
|
||||
let uniform_buffer = device.create_buffer(&wgpu::BufferDescriptor {
|
||||
label: Some("fractal uniforms"),
|
||||
@@ -748,7 +758,9 @@ impl FractalRenderer {
|
||||
});
|
||||
|
||||
// Colourise pass: data texture + colour uniforms → colour texture.
|
||||
let colorize_shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
let colorize_shader = unsafe {
|
||||
device.create_shader_module_trusted(
|
||||
wgpu::ShaderModuleDescriptor {
|
||||
label: Some("colorize"),
|
||||
source: wgpu::ShaderSource::Wgsl(
|
||||
concat!(
|
||||
@@ -758,7 +770,10 @@ impl FractalRenderer {
|
||||
)
|
||||
.into(),
|
||||
),
|
||||
});
|
||||
},
|
||||
wgpu::ShaderRuntimeChecks::unchecked(),
|
||||
)
|
||||
};
|
||||
let colorize_bind_group_layout =
|
||||
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
|
||||
label: Some("colorize bind group layout"),
|
||||
@@ -829,7 +844,9 @@ impl FractalRenderer {
|
||||
});
|
||||
|
||||
// Blit pipeline: samples the cache texture onto egui's surface.
|
||||
let blit_shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||
let blit_shader = unsafe {
|
||||
device.create_shader_module_trusted(
|
||||
wgpu::ShaderModuleDescriptor {
|
||||
label: Some("blit"),
|
||||
source: wgpu::ShaderSource::Wgsl(
|
||||
concat!(
|
||||
@@ -838,7 +855,10 @@ impl FractalRenderer {
|
||||
)
|
||||
.into(),
|
||||
),
|
||||
});
|
||||
},
|
||||
wgpu::ShaderRuntimeChecks::unchecked(),
|
||||
)
|
||||
};
|
||||
|
||||
let blit_bind_group_layout =
|
||||
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
|
||||
|
||||
Reference in New Issue
Block a user