fmt clippy
This commit is contained in:
Generated
+25
-25
@@ -318,7 +318,7 @@ checksum = "cb9f6e1368bd4621d2c86baa7e37de77a938adf5221e5dd3d6133340101b309e"
|
||||
dependencies = [
|
||||
"bitflags 2.10.0",
|
||||
"polling",
|
||||
"rustix 1.1.2",
|
||||
"rustix 1.1.3",
|
||||
"slab",
|
||||
"tracing",
|
||||
]
|
||||
@@ -342,7 +342,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa"
|
||||
dependencies = [
|
||||
"calloop 0.14.3",
|
||||
"rustix 1.1.2",
|
||||
"rustix 1.1.3",
|
||||
"wayland-backend",
|
||||
"wayland-client",
|
||||
]
|
||||
@@ -859,7 +859,7 @@ version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8"
|
||||
dependencies = [
|
||||
"rustix 1.1.2",
|
||||
"rustix 1.1.3",
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
@@ -1050,7 +1050,7 @@ dependencies = [
|
||||
"rgb",
|
||||
"tiff",
|
||||
"zune-core 0.5.0",
|
||||
"zune-jpeg 0.5.7",
|
||||
"zune-jpeg 0.5.8",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1121,9 +1121,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.15"
|
||||
version = "1.0.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
|
||||
checksum = "7ee5b5339afb4c41626dde77b7a611bd4f2c202b897852b4bcf5d03eddc61010"
|
||||
|
||||
[[package]]
|
||||
name = "jni"
|
||||
@@ -1943,7 +1943,7 @@ dependencies = [
|
||||
"concurrent-queue",
|
||||
"hermit-abi",
|
||||
"pin-project-lite",
|
||||
"rustix 1.1.2",
|
||||
"rustix 1.1.3",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
@@ -2246,9 +2246,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
version = "1.1.2"
|
||||
version = "1.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e"
|
||||
checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
|
||||
dependencies = [
|
||||
"bitflags 2.10.0",
|
||||
"errno",
|
||||
@@ -2263,12 +2263,6 @@ version = "1.0.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
|
||||
|
||||
[[package]]
|
||||
name = "same-file"
|
||||
version = "1.0.6"
|
||||
@@ -2335,15 +2329,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.145"
|
||||
version = "1.0.147"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
|
||||
checksum = "6af14725505314343e673e9ecb7cd7e8a36aa9791eb936235a3567cc31447ae4"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"memchr",
|
||||
"ryu",
|
||||
"serde",
|
||||
"serde_core",
|
||||
"zmij",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2455,7 +2449,7 @@ dependencies = [
|
||||
"libc",
|
||||
"log",
|
||||
"memmap2",
|
||||
"rustix 1.1.2",
|
||||
"rustix 1.1.3",
|
||||
"thiserror 2.0.17",
|
||||
"wayland-backend",
|
||||
"wayland-client",
|
||||
@@ -2983,7 +2977,7 @@ checksum = "673a33c33048a5ade91a6b139580fa174e19fb0d23f396dca9fa15f2e1e49b35"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"downcast-rs",
|
||||
"rustix 1.1.2",
|
||||
"rustix 1.1.3",
|
||||
"scoped-tls",
|
||||
"smallvec",
|
||||
"wayland-sys",
|
||||
@@ -2996,7 +2990,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c66a47e840dc20793f2264eb4b3e4ecb4b75d91c0dd4af04b456128e0bdd449d"
|
||||
dependencies = [
|
||||
"bitflags 2.10.0",
|
||||
"rustix 1.1.2",
|
||||
"rustix 1.1.3",
|
||||
"wayland-backend",
|
||||
"wayland-scanner",
|
||||
]
|
||||
@@ -3018,7 +3012,7 @@ version = "0.31.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "447ccc440a881271b19e9989f75726d60faa09b95b0200a9b7eb5cc47c3eeb29"
|
||||
dependencies = [
|
||||
"rustix 1.1.2",
|
||||
"rustix 1.1.3",
|
||||
"wayland-client",
|
||||
"xcursor",
|
||||
]
|
||||
@@ -3493,7 +3487,7 @@ dependencies = [
|
||||
"libc",
|
||||
"libloading",
|
||||
"once_cell",
|
||||
"rustix 1.1.2",
|
||||
"rustix 1.1.3",
|
||||
"x11rb-protocol",
|
||||
]
|
||||
|
||||
@@ -3643,6 +3637,12 @@ dependencies = [
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zmij"
|
||||
version = "0.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d0095ecd462946aa3927d9297b63ef82fb9a5316d7a37d134eeb36e58228615a"
|
||||
|
||||
[[package]]
|
||||
name = "zune-core"
|
||||
version = "0.4.12"
|
||||
@@ -3675,9 +3675,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zune-jpeg"
|
||||
version = "0.5.7"
|
||||
version = "0.5.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "51d915729b0e7d5fe35c2f294c5dc10b30207cc637920e5b59077bfa3da63f28"
|
||||
checksum = "e35aee689668bf9bd6f6f3a6c60bb29ba1244b3b43adfd50edd554a371da37d5"
|
||||
dependencies = [
|
||||
"zune-core 0.5.0",
|
||||
]
|
||||
|
||||
+2
-3
@@ -8,8 +8,8 @@ fn main() {
|
||||
|
||||
let paths = read_dir("src/shaders").unwrap();
|
||||
for path in paths {
|
||||
if let Ok(path) = path {
|
||||
if path
|
||||
if let Ok(path) = path
|
||||
&& path
|
||||
.path()
|
||||
.extension()
|
||||
.map(|ext| ext == "glsl")
|
||||
@@ -19,7 +19,6 @@ fn main() {
|
||||
//writeln!(output, "cargo::rerun-if-changed={}",
|
||||
// path.path().display()).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Command::new("python3")
|
||||
|
||||
+39
-46
@@ -10,8 +10,8 @@ const DEFAULT_SUBDIVISION: u32 = 16;
|
||||
const MAXIMUM_SUBDIVISION: u32 = 64;
|
||||
const MINUMUM_SUBDIVISION: u32 = 8;
|
||||
|
||||
const RUN_STANDARD_PIPELINE: bool = false;
|
||||
const RUN_RT_PIPELINE: bool = true;
|
||||
const RUN_STANDARD_PIPELINE: bool = true;
|
||||
const RUN_RT_PIPELINE: bool = false;
|
||||
|
||||
use std::{
|
||||
error::Error,
|
||||
@@ -417,7 +417,7 @@ impl App {
|
||||
Format::D16_UNORM_S8_UINT,
|
||||
];
|
||||
|
||||
let depth_format = (if IGNORE_STENCIL {
|
||||
let depth_format = *(if IGNORE_STENCIL {
|
||||
DEPTH_FORMAT_ORDERING_IGNORE_STENCIL.iter()
|
||||
} else {
|
||||
DEPTH_FORMAT_ORDERING.iter()
|
||||
@@ -430,8 +430,7 @@ impl App {
|
||||
.contains(FormatFeatures::DEPTH_STENCIL_ATTACHMENT)
|
||||
})
|
||||
.next()
|
||||
.expect("Could not find suitable depth format!")
|
||||
.clone();
|
||||
.expect("Could not find suitable depth format!");
|
||||
|
||||
info!("Using depth format {:?}", depth_format);
|
||||
|
||||
@@ -619,12 +618,9 @@ impl App {
|
||||
move |res: Result<notify::Event, notify::Error>| match res {
|
||||
Ok(event) => {
|
||||
//info!("event: {:?}", event);
|
||||
match event.kind {
|
||||
notify::EventKind::Modify(_) => {
|
||||
info!("event: {:?}", event);
|
||||
watcher_glsl_changed.store(true, std::sync::atomic::Ordering::Relaxed);
|
||||
},
|
||||
_ => {},
|
||||
if let notify::EventKind::Modify(_) = event.kind {
|
||||
info!("event: {:?}", event);
|
||||
watcher_glsl_changed.store(true, std::sync::atomic::Ordering::Relaxed);
|
||||
}
|
||||
},
|
||||
Err(e) => error!("watch error: {:?}", e),
|
||||
@@ -758,7 +754,8 @@ impl ApplicationHandler for App {
|
||||
.surface_present_modes(&surface, Default::default())
|
||||
.unwrap();
|
||||
|
||||
let present_mode = present_modes
|
||||
|
||||
present_modes
|
||||
.into_iter()
|
||||
.min_by_key(|p| {
|
||||
// We assign a lower score to device types that are likely to be
|
||||
@@ -771,8 +768,7 @@ impl ApplicationHandler for App {
|
||||
_ => 4,
|
||||
}
|
||||
})
|
||||
.unwrap();
|
||||
present_mode
|
||||
.unwrap()
|
||||
};
|
||||
|
||||
info!("Using present mode {:?}.", present_mode);
|
||||
@@ -965,7 +961,7 @@ impl ApplicationHandler for App {
|
||||
|
||||
let viewport = Viewport {
|
||||
offset: [0.0, window_size.height as f32],
|
||||
extent: [window_size.width as f32, window_size.height as f32 * -1.],
|
||||
extent: [window_size.width as f32, -(window_size.height as f32)],
|
||||
depth_range: 0.0..=1.0,
|
||||
};
|
||||
|
||||
@@ -1076,14 +1072,13 @@ impl ApplicationHandler for App {
|
||||
_device_id: winit::event::DeviceId,
|
||||
event: DeviceEvent,
|
||||
) {
|
||||
if let DeviceEvent::MouseMotion { delta } = &event {
|
||||
if self.cstate.looking {
|
||||
if let DeviceEvent::MouseMotion { delta } = &event
|
||||
&& self.cstate.looking {
|
||||
self.cstate.forward.x += delta.1 as f32 * self.gstate.cursor_sensitivity * 0.3;
|
||||
self.cstate.forward.y += delta.0 as f32 * self.gstate.cursor_sensitivity * 0.3;
|
||||
self.cstate.forward.x += 360f32 % 360f32;
|
||||
self.cstate.forward.y += 360f32 % 360f32;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn window_event(
|
||||
@@ -1095,11 +1090,10 @@ impl ApplicationHandler for App {
|
||||
let rcx_clone = self.rcx.clone();
|
||||
let mut rcx_lock = rcx_clone.lock().unwrap();
|
||||
let rcx = rcx_lock.as_mut().unwrap();
|
||||
if self.draw_gui {
|
||||
if rcx.gui.update(&event) {
|
||||
if self.draw_gui
|
||||
&& rcx.gui.update(&event) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
match &event {
|
||||
WindowEvent::CloseRequested => {
|
||||
event_loop.exit();
|
||||
@@ -1168,7 +1162,7 @@ impl ApplicationHandler for App {
|
||||
rcx.render_pass.clone(),
|
||||
self.pipeline_cache.clone(),
|
||||
rcx.shader_modules.clone(),
|
||||
self.previous_debug.clone(),
|
||||
self.previous_debug,
|
||||
self.block_enable_allocator.clone(),
|
||||
self.host_visible_allocator.clone(),
|
||||
self.descriptor_set_allocator.clone(),
|
||||
@@ -1207,32 +1201,32 @@ impl App {
|
||||
if self.cstate.looking {
|
||||
if self.cstate.keys.w {
|
||||
self.cstate.position -=
|
||||
Mat3::from_rotation_y(self.cstate.forward.y.to_radians() * -1.)
|
||||
* Mat3::from_rotation_x(self.cstate.forward.x.to_radians() * -1.)
|
||||
Mat3::from_rotation_y(-self.cstate.forward.y.to_radians())
|
||||
* Mat3::from_rotation_x(-self.cstate.forward.x.to_radians())
|
||||
* Vec3::Z
|
||||
* 0.01
|
||||
* self.gstate.move_speed;
|
||||
}
|
||||
if self.cstate.keys.s {
|
||||
self.cstate.position +=
|
||||
Mat3::from_rotation_y(self.cstate.forward.y.to_radians() * -1.)
|
||||
* Mat3::from_rotation_x(self.cstate.forward.x.to_radians() * -1.)
|
||||
Mat3::from_rotation_y(-self.cstate.forward.y.to_radians())
|
||||
* Mat3::from_rotation_x(-self.cstate.forward.x.to_radians())
|
||||
* Vec3::Z
|
||||
* 0.01
|
||||
* self.gstate.move_speed;
|
||||
}
|
||||
if self.cstate.keys.a {
|
||||
self.cstate.position -=
|
||||
Mat3::from_rotation_y(self.cstate.forward.y.to_radians() * -1.)
|
||||
* Mat3::from_rotation_x(self.cstate.forward.x.to_radians() * -1.)
|
||||
Mat3::from_rotation_y(-self.cstate.forward.y.to_radians())
|
||||
* Mat3::from_rotation_x(-self.cstate.forward.x.to_radians())
|
||||
* Vec3::X
|
||||
* 0.01
|
||||
* self.gstate.move_speed;
|
||||
}
|
||||
if self.cstate.keys.d {
|
||||
self.cstate.position +=
|
||||
Mat3::from_rotation_y(self.cstate.forward.y.to_radians() * -1.)
|
||||
* Mat3::from_rotation_x(self.cstate.forward.x.to_radians() * -1.)
|
||||
Mat3::from_rotation_y(-self.cstate.forward.y.to_radians())
|
||||
* Mat3::from_rotation_x(-self.cstate.forward.x.to_radians())
|
||||
* Vec3::X
|
||||
* 0.01
|
||||
* self.gstate.move_speed;
|
||||
@@ -1267,13 +1261,13 @@ impl App {
|
||||
self.cstate.position.z,
|
||||
self.time,
|
||||
],
|
||||
specular: self.gstate.specular.into(),
|
||||
specular_tint: self.gstate.specular_tint.into(),
|
||||
sheen_tint: self.gstate.sheen_tint.into(),
|
||||
sheen: self.gstate.sheen.into(),
|
||||
clear_coat_gloss: self.gstate.clear_coat_gloss.into(),
|
||||
subsurface: self.gstate.subsurface.into(),
|
||||
clear_coat: self.gstate.clear_coat.into(),
|
||||
specular: self.gstate.specular,
|
||||
specular_tint: self.gstate.specular_tint,
|
||||
sheen_tint: self.gstate.sheen_tint,
|
||||
sheen: self.gstate.sheen,
|
||||
clear_coat_gloss: self.gstate.clear_coat_gloss,
|
||||
subsurface: self.gstate.subsurface,
|
||||
clear_coat: self.gstate.clear_coat,
|
||||
};
|
||||
|
||||
if self.cstate.looking {
|
||||
@@ -1784,7 +1778,7 @@ impl App {
|
||||
rcx.render_pass.clone(),
|
||||
self.pipeline_cache.clone(),
|
||||
rcx.shader_modules.clone(),
|
||||
self.previous_debug.clone(),
|
||||
self.previous_debug,
|
||||
i,
|
||||
))
|
||||
.unwrap();
|
||||
@@ -1863,7 +1857,7 @@ impl App {
|
||||
rcx.render_pass.clone(),
|
||||
self.pipeline_cache.clone(),
|
||||
rcx.shader_modules.clone(),
|
||||
self.previous_debug.clone(),
|
||||
self.previous_debug,
|
||||
self.block_enable_allocator.clone(),
|
||||
self.host_visible_allocator.clone(),
|
||||
self.descriptor_set_allocator.clone(),
|
||||
@@ -1928,7 +1922,7 @@ impl App {
|
||||
);
|
||||
|
||||
rcx.viewport.extent[0] = window_size.width as f32;
|
||||
rcx.viewport.extent[1] = window_size.height as f32 * -1.;
|
||||
rcx.viewport.extent[1] = -(window_size.height as f32);
|
||||
rcx.viewport.offset[1] = window_size.height as f32;
|
||||
|
||||
rcx.recreate_swapchain = false;
|
||||
@@ -1953,7 +1947,7 @@ impl App {
|
||||
rcx.render_pass.clone(),
|
||||
self.pipeline_cache.clone(),
|
||||
rcx.shader_modules.clone(),
|
||||
self.previous_debug.clone(),
|
||||
self.previous_debug,
|
||||
i,
|
||||
))
|
||||
.unwrap();
|
||||
@@ -2108,7 +2102,7 @@ impl App {
|
||||
.boxed();
|
||||
}
|
||||
|
||||
if self.gstate.csg.len() > 0 {
|
||||
if !self.gstate.csg.is_empty() {
|
||||
self.add_commands_depth_pass(
|
||||
&mut builder,
|
||||
&push_constants,
|
||||
@@ -2117,7 +2111,7 @@ impl App {
|
||||
);
|
||||
}
|
||||
self.add_commands_primary_subpass(&mut builder);
|
||||
if self.gstate.csg.len() > 0 {
|
||||
if !self.gstate.csg.is_empty() {
|
||||
self.add_commands_normal_pass(
|
||||
&mut builder,
|
||||
&push_constants,
|
||||
@@ -2645,8 +2639,8 @@ where
|
||||
}
|
||||
|
||||
fn dump_pipeline_cache(cache: Arc<PipelineCache>) {
|
||||
if PIPELINE_CACHING {
|
||||
if let Ok(data) = cache.get_data() {
|
||||
if PIPELINE_CACHING
|
||||
&& let Ok(data) = cache.get_data() {
|
||||
info!("Dumping pipeline cache...");
|
||||
let tmp_path = relpath("pipeline_cache.bin.tmp");
|
||||
|
||||
@@ -2660,7 +2654,6 @@ fn dump_pipeline_cache(cache: Arc<PipelineCache>) {
|
||||
}
|
||||
info!("Pipeline cache dump exit");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn get_pipeline_cache(device: Arc<Device>) -> Arc<PipelineCache> {
|
||||
|
||||
@@ -116,12 +116,12 @@ pub fn thread_loop(recv: mpmc::Receiver<WorkItem>, send: mpsc::SyncSender<WorkCo
|
||||
let parts = create_csg(seed);
|
||||
|
||||
let trace_shader_module =
|
||||
sdf_specialize_module(device.clone(), &parts, trace_module, &format!("trace"));
|
||||
sdf_specialize_module(device.clone(), &parts, trace_module, "trace");
|
||||
let normals_shader_module = sdf_specialize_module(
|
||||
device.clone(),
|
||||
&parts,
|
||||
normals_module,
|
||||
&format!("normals"),
|
||||
"normals",
|
||||
);
|
||||
|
||||
let (trace_pipeline, normals_pipeline) = deferred_pipelines_recompile(
|
||||
@@ -135,7 +135,6 @@ pub fn thread_loop(recv: mpmc::Receiver<WorkItem>, send: mpsc::SyncSender<WorkCo
|
||||
);
|
||||
|
||||
let enable_buffer: Vec<Subbuffer<Object>> = (0..frames)
|
||||
.into_iter()
|
||||
.map(|_| {
|
||||
block_enable_allocator
|
||||
.lock()
|
||||
@@ -145,7 +144,6 @@ pub fn thread_loop(recv: mpmc::Receiver<WorkItem>, send: mpsc::SyncSender<WorkCo
|
||||
})
|
||||
.collect();
|
||||
let enable_buffer_host_visible: Vec<Subbuffer<Object>> = (0..frames)
|
||||
.into_iter()
|
||||
.map(|_| {
|
||||
host_visible_allocator
|
||||
.lock()
|
||||
@@ -157,7 +155,6 @@ pub fn thread_loop(recv: mpmc::Receiver<WorkItem>, send: mpsc::SyncSender<WorkCo
|
||||
|
||||
let trace_layout = trace_pipeline.layout().set_layouts()[1].clone();
|
||||
let trace_descriptor_set = (0..frames)
|
||||
.into_iter()
|
||||
.map(|f| {
|
||||
DescriptorSet::new(
|
||||
descriptor_set_allocator.clone(),
|
||||
@@ -174,7 +171,6 @@ pub fn thread_loop(recv: mpmc::Receiver<WorkItem>, send: mpsc::SyncSender<WorkCo
|
||||
|
||||
let normals_layout = normals_pipeline.layout().set_layouts()[1].clone();
|
||||
let normals_descriptor_set = (0..frames)
|
||||
.into_iter()
|
||||
.map(|f| {
|
||||
DescriptorSet::new(
|
||||
descriptor_set_allocator.clone(),
|
||||
@@ -276,13 +272,13 @@ pub fn thread_loop(recv: mpmc::Receiver<WorkItem>, send: mpsc::SyncSender<WorkCo
|
||||
device.clone(),
|
||||
&csg.parts,
|
||||
trace_module,
|
||||
&format!("trace"),
|
||||
"trace",
|
||||
);
|
||||
csg.normals_shader_module = sdf_specialize_module(
|
||||
device.clone(),
|
||||
&csg.parts,
|
||||
normals_module,
|
||||
&format!("normals"),
|
||||
"normals",
|
||||
);
|
||||
|
||||
(csg.trace_pipeline, csg.normals_pipeline) = deferred_pipelines_recompile(
|
||||
@@ -566,7 +562,7 @@ fn interval_check(
|
||||
material,
|
||||
subdivision_log2: csg.subdivision.ilog2(),
|
||||
farplane: ((highest_corner - lowest_corner).length() / csg.subdivision as f32).into(),
|
||||
colour: csg.colour.to_array().into(),
|
||||
colour: csg.colour.to_array(),
|
||||
roughness: csg.roughness,
|
||||
metallic: csg.metallic,
|
||||
};
|
||||
@@ -673,14 +669,13 @@ fn sdf_specialize_module(
|
||||
let module_as_bytes = assembled_module
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(u32::to_le_bytes)
|
||||
.flatten()
|
||||
.flat_map(u32::to_le_bytes)
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
if DUMP_SPV_TO_FILE {
|
||||
File::create(format!("{name}.out.spv"))
|
||||
.unwrap()
|
||||
.write(&module_as_bytes)
|
||||
.write_all(&module_as_bytes)
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
|
||||
@@ -177,6 +177,7 @@ pub enum InstructionSet {
|
||||
OPPosition = ((1 * 64) + 63),
|
||||
#[allow(non_snake_case)]
|
||||
#[allow(dead_code)]
|
||||
#[allow(clippy::erasing_op)]
|
||||
/// Calculates the minimum of two Vec1s, and also carries over the relevant
|
||||
/// material metadata.
|
||||
OPMinMaterial = ((0 * 64) + 63),
|
||||
|
||||
@@ -7,4 +7,4 @@ pub mod types;
|
||||
pub mod vm;
|
||||
|
||||
const BYTECODE_IMITATES_GLSL: bool = false;
|
||||
const DUMP_SPV_DIS_TO_FILE: bool = false;
|
||||
const DUMP_SPV_DIS_TO_FILE: bool = true;
|
||||
|
||||
@@ -474,7 +474,7 @@ impl SSATape {
|
||||
let void = b.type_void();
|
||||
let float = b.type_float(32);
|
||||
let bool = b.type_bool();
|
||||
let choice = b.type_int(2, 0);
|
||||
let choice = b.type_int(8, 0);
|
||||
let vec2 = b.type_vector(float, 2);
|
||||
let vec3 = b.type_vector(float, 3);
|
||||
let vec4 = b.type_vector(float, 4);
|
||||
|
||||
Reference in New Issue
Block a user