fix directory
This commit is contained in:
@@ -9,6 +9,7 @@ import re
|
|||||||
SHADERS_DIR = "shaders_out"
|
SHADERS_DIR = "shaders_out"
|
||||||
TARGET_ENV = "vulkan1.3"
|
TARGET_ENV = "vulkan1.3"
|
||||||
|
|
||||||
|
if os.path.isdir(SHADERS_DIR):
|
||||||
shutil.rmtree(SHADERS_DIR)
|
shutil.rmtree(SHADERS_DIR)
|
||||||
os.mkdir(SHADERS_DIR)
|
os.mkdir(SHADERS_DIR)
|
||||||
|
|
||||||
|
|||||||
+29
-30
@@ -1,4 +1,3 @@
|
|||||||
#![feature(variant_count)]
|
|
||||||
#![feature(portable_simd)]
|
#![feature(portable_simd)]
|
||||||
#![feature(mpmc_channel)]
|
#![feature(mpmc_channel)]
|
||||||
|
|
||||||
@@ -560,10 +559,10 @@ impl App {
|
|||||||
notify::EventKind::Modify(notify::event::ModifyKind::Data(_)) => {
|
notify::EventKind::Modify(notify::event::ModifyKind::Data(_)) => {
|
||||||
info!("event: {:?}", event);
|
info!("event: {:?}", event);
|
||||||
watcher_glsl_changed.store(true, std::sync::atomic::Ordering::SeqCst);
|
watcher_glsl_changed.store(true, std::sync::atomic::Ordering::SeqCst);
|
||||||
},
|
|
||||||
_ => {},
|
|
||||||
}
|
}
|
||||||
},
|
_ => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
Err(e) => error!("watch error: {:?}", e),
|
Err(e) => error!("watch error: {:?}", e),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -1025,16 +1024,16 @@ impl ApplicationHandler for App {
|
|||||||
match &event {
|
match &event {
|
||||||
WindowEvent::CloseRequested => {
|
WindowEvent::CloseRequested => {
|
||||||
event_loop.exit();
|
event_loop.exit();
|
||||||
},
|
}
|
||||||
WindowEvent::Resized(_) => {
|
WindowEvent::Resized(_) => {
|
||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
},
|
}
|
||||||
WindowEvent::ScaleFactorChanged { .. } => {
|
WindowEvent::ScaleFactorChanged { .. } => {
|
||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
},
|
}
|
||||||
WindowEvent::DroppedFile(_file) => {
|
WindowEvent::DroppedFile(_file) => {
|
||||||
todo!()
|
todo!()
|
||||||
},
|
}
|
||||||
WindowEvent::MouseInput {
|
WindowEvent::MouseInput {
|
||||||
device_id: d,
|
device_id: d,
|
||||||
state: s,
|
state: s,
|
||||||
@@ -1045,7 +1044,7 @@ impl ApplicationHandler for App {
|
|||||||
if b == &MouseButton::Right {
|
if b == &MouseButton::Right {
|
||||||
self.cstate.looking = s == &ElementState::Pressed;
|
self.cstate.looking = s == &ElementState::Pressed;
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
WindowEvent::KeyboardInput {
|
WindowEvent::KeyboardInput {
|
||||||
device_id: _,
|
device_id: _,
|
||||||
event: input,
|
event: input,
|
||||||
@@ -1053,19 +1052,19 @@ impl ApplicationHandler for App {
|
|||||||
} => match input.physical_key {
|
} => match input.physical_key {
|
||||||
PhysicalKey::Code(KeyCode::KeyW) => {
|
PhysicalKey::Code(KeyCode::KeyW) => {
|
||||||
self.cstate.keys.w = input.state == ElementState::Pressed;
|
self.cstate.keys.w = input.state == ElementState::Pressed;
|
||||||
},
|
}
|
||||||
PhysicalKey::Code(KeyCode::KeyS) => {
|
PhysicalKey::Code(KeyCode::KeyS) => {
|
||||||
self.cstate.keys.s = input.state == ElementState::Pressed;
|
self.cstate.keys.s = input.state == ElementState::Pressed;
|
||||||
},
|
}
|
||||||
PhysicalKey::Code(KeyCode::KeyA) => {
|
PhysicalKey::Code(KeyCode::KeyA) => {
|
||||||
self.cstate.keys.a = input.state == ElementState::Pressed;
|
self.cstate.keys.a = input.state == ElementState::Pressed;
|
||||||
},
|
}
|
||||||
PhysicalKey::Code(KeyCode::KeyD) => {
|
PhysicalKey::Code(KeyCode::KeyD) => {
|
||||||
self.cstate.keys.d = input.state == ElementState::Pressed;
|
self.cstate.keys.d = input.state == ElementState::Pressed;
|
||||||
},
|
}
|
||||||
PhysicalKey::Code(KeyCode::ShiftLeft) => {
|
PhysicalKey::Code(KeyCode::ShiftLeft) => {
|
||||||
self.cstate.looking = input.state == ElementState::Pressed;
|
self.cstate.looking = input.state == ElementState::Pressed;
|
||||||
},
|
}
|
||||||
PhysicalKey::Code(KeyCode::Space) => {
|
PhysicalKey::Code(KeyCode::Space) => {
|
||||||
if input.state == ElementState::Pressed {
|
if input.state == ElementState::Pressed {
|
||||||
self.thread_work_creation
|
self.thread_work_creation
|
||||||
@@ -1087,18 +1086,18 @@ impl ApplicationHandler for App {
|
|||||||
))
|
))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
PhysicalKey::Code(KeyCode::KeyG) => {
|
PhysicalKey::Code(KeyCode::KeyG) => {
|
||||||
if input.state == ElementState::Pressed {
|
if input.state == ElementState::Pressed {
|
||||||
self.draw_gui = !self.draw_gui;
|
self.draw_gui = !self.draw_gui;
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
_ => {},
|
_ => {}
|
||||||
},
|
},
|
||||||
WindowEvent::RedrawRequested => {
|
WindowEvent::RedrawRequested => {
|
||||||
self.redraw(rcx);
|
self.redraw(rcx);
|
||||||
},
|
}
|
||||||
_ => {},
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1537,9 +1536,9 @@ impl App {
|
|||||||
} else {
|
} else {
|
||||||
self.gstate.csg[index as usize] = csg;
|
self.gstate.csg[index as usize] = csg;
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
WorkComplete::GetPushConstants(..) => {},
|
WorkComplete::GetPushConstants(..) => {}
|
||||||
WorkComplete::RecompilePipelines(..) => {},
|
WorkComplete::RecompilePipelines(..) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1706,7 +1705,7 @@ impl App {
|
|||||||
match work {
|
match work {
|
||||||
WorkComplete::RecompilePipelines(_index) => {
|
WorkComplete::RecompilePipelines(_index) => {
|
||||||
csg_left -= 1;
|
csg_left -= 1;
|
||||||
},
|
}
|
||||||
other => work_for_later.push(other),
|
other => work_for_later.push(other),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1858,7 +1857,7 @@ impl App {
|
|||||||
match work {
|
match work {
|
||||||
WorkComplete::RecompilePipelines(_index) => {
|
WorkComplete::RecompilePipelines(_index) => {
|
||||||
csg_left -= 1;
|
csg_left -= 1;
|
||||||
},
|
}
|
||||||
other => work_for_later.push(other),
|
other => work_for_later.push(other),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1873,7 +1872,7 @@ impl App {
|
|||||||
Err(VulkanError::OutOfDate) => {
|
Err(VulkanError::OutOfDate) => {
|
||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
return;
|
return;
|
||||||
},
|
}
|
||||||
Err(e) => panic!("Failed to acquire next image: {e}"),
|
Err(e) => panic!("Failed to acquire next image: {e}"),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1976,7 +1975,7 @@ impl App {
|
|||||||
Some(future.boxed())
|
Some(future.boxed())
|
||||||
};
|
};
|
||||||
push_constants_left -= 1;
|
push_constants_left -= 1;
|
||||||
},
|
}
|
||||||
other => work_for_later.push(other),
|
other => work_for_later.push(other),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2051,20 +2050,20 @@ impl App {
|
|||||||
match future.map_err(Validated::unwrap) {
|
match future.map_err(Validated::unwrap) {
|
||||||
Ok(future) => {
|
Ok(future) => {
|
||||||
rcx.previous_frame_end[image_index] = Some(future);
|
rcx.previous_frame_end[image_index] = Some(future);
|
||||||
},
|
}
|
||||||
Err(VulkanError::OutOfDate) => {
|
Err(VulkanError::OutOfDate) => {
|
||||||
rcx.recreate_swapchain = true;
|
rcx.recreate_swapchain = true;
|
||||||
rcx.previous_frame_end[image_index] = None;
|
rcx.previous_frame_end[image_index] = None;
|
||||||
},
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!("Failed to flush future: {e:?}");
|
error!("Failed to flush future: {e:?}");
|
||||||
rcx.previous_frame_end[image_index] = None;
|
rcx.previous_frame_end[image_index] = None;
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for work in self.thread_work_completion.try_iter() {
|
for work in self.thread_work_completion.try_iter() {
|
||||||
match work {
|
match work {
|
||||||
WorkComplete::GetPushConstants(..) => {},
|
WorkComplete::GetPushConstants(..) => {}
|
||||||
other => work_for_later.push(other),
|
other => work_for_later.push(other),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user