slang fast

This commit is contained in:
2026-09-12 16:16:21 +02:00
parent 3835a6fa78
commit 9015ed85d6
7 changed files with 733 additions and 11 deletions
+26 -8
View File
@@ -32,6 +32,8 @@ use wgpu::RenderPipeline;
use wgpu::Texture;
use wgpu::TextureUsages;
use wgpu::TextureView;
use wgpu::include_spirv;
use wgpu::include_wgsl;
use wgpu::util::BufferInitDescriptor;
use wgpu::util::DeviceExt;
use wgpu::util::DownloadBuffer;
@@ -44,6 +46,7 @@ use winit::event_loop::ActiveEventLoop;
use winit::event_loop::ControlFlow;
use winit::event_loop::EventLoop;
use winit::event_loop::OwnedDisplayHandle;
use winit::platform::x11::EventLoopBuilderExtX11;
use winit::window::Window;
use winit::window::WindowId;
@@ -200,14 +203,29 @@ impl State
usage: BufferUsages::COPY_DST | BufferUsages::VERTEX,
});
let shader_module = device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: Some("Main shader module"),
source: wgpu::ShaderSource::Wgsl(
std::fs::read_to_string("shaders/voxel.wgsl")
.unwrap()
.into(),
),
});
// let shader_module = unsafe {
// device.create_shader_module_trusted(
// wgpu::ShaderModuleDescriptor {
// label: Some("Main shader module"),
// source: wgpu::ShaderSource::Wgsl(
// std::fs::read_to_string("shaders/voxel.wgsl")
// .unwrap()
// .into(),
// ),
// },
// wgpu::ShaderRuntimeChecks {
// bounds_checks: false,
// force_loop_bounding: false,
// ray_query_initialization_tracking: false,
// task_shader_dispatch_tracking: false,
// mesh_shader_primitive_indices_clamp: false,
// int_div_checks: false,
// },
// )
// };
//let shader_module = device.create_shader_module(include_wgsl!("../shaders/voxel.wgsl"));
let shader_module = device.create_shader_module(include_spirv!("../shaders/voxel.spv"));
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("Voxel pipeline layout"),