Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
- main
pull_request:
merge_group:
workflow_dispatch:

name: CI

Expand Down
4 changes: 2 additions & 2 deletions generated/graphics/cargo-gpu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
members = [
"ash",
"shaders"
"mygraphics",
"mygraphics-shaders"
]
resolver = "3"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "graphics-shaders"
name = "mygraphics-shaders"
version = "0.1.0"
edition = "2024"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "graphics-ash"
name = "mygraphics"
publish = false
version.workspace = true
authors.workspace = true
Expand All @@ -11,7 +11,7 @@ repository.workspace = true
workspace = true

[dependencies]
graphics-shaders = { path = "../shaders" }
mygraphics-shaders = { path = "../mygraphics-shaders" }

ash.workspace = true
ash-window.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::path::PathBuf;

pub fn main() -> anyhow::Result<()> {
let manifest_dir = env!("CARGO_MANIFEST_DIR");
let crate_path = [manifest_dir, "..", "shaders"]
let crate_path = [manifest_dir, "..", "mygraphics-shaders"]
.iter()
.copied()
.collect::<PathBuf>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::device::MyDevice;
use crate::single_command_buffer::SingleCommandBuffer;
use crate::swapchain::DrawFrame;
use crate::ash_renderer::device::MyDevice;
use crate::ash_renderer::single_command_buffer::SingleCommandBuffer;
use crate::ash_renderer::swapchain::DrawFrame;
use anyhow::Context;
use ash::vk;
use graphics_shaders::ShaderConstants;
use mygraphics_shaders::ShaderConstants;
use std::sync::Arc;

/// Manages the creation and recreation of [`MyRenderPipeline`], whenever new shader code ([`Self::set_shader_code`])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,80 +1,9 @@
// FIXME(eddyb) update/review these lints.
//
// BEGIN - Embark standard lints v0.4
// do not change or add/remove here, but one can add exceptions after this section
// for more info see: <https://github.com/EmbarkStudios/rust-ecosystem/issues/59>
//#![deny(unsafe_code)] // impractical in this crate dealing with unsafe `ash`
#![warn(
clippy::all,
clippy::await_holding_lock,
clippy::char_lit_as_u8,
clippy::checked_conversions,
clippy::dbg_macro,
clippy::debug_assert_with_mut_call,
clippy::doc_markdown,
clippy::empty_enum,
clippy::enum_glob_use,
clippy::exit,
clippy::expl_impl_clone_on_copy,
clippy::explicit_deref_methods,
clippy::explicit_into_iter_loop,
clippy::fallible_impl_from,
clippy::filter_map_next,
clippy::float_cmp_const,
clippy::fn_params_excessive_bools,
clippy::if_let_mutex,
clippy::implicit_clone,
clippy::imprecise_flops,
clippy::inefficient_to_string,
clippy::invalid_upcast_comparisons,
clippy::large_types_passed_by_value,
clippy::let_unit_value,
clippy::linkedlist,
clippy::lossy_float_literal,
clippy::macro_use_imports,
clippy::manual_ok_or,
clippy::map_err_ignore,
clippy::map_flatten,
clippy::map_unwrap_or,
clippy::match_same_arms,
clippy::match_wildcard_for_single_variants,
clippy::mem_forget,
clippy::mut_mut,
clippy::mutex_integer,
clippy::needless_borrow,
clippy::needless_continue,
clippy::option_option,
clippy::path_buf_push_overwrite,
clippy::ptr_as_ptr,
clippy::ref_option_ref,
clippy::rest_pat_in_fully_bound_structs,
clippy::same_functions_in_if_condition,
clippy::semicolon_if_nothing_returned,
clippy::string_add_assign,
clippy::string_add,
clippy::string_lit_as_bytes,
clippy::string_to_string,
clippy::todo,
clippy::trait_duplication_in_bounds,
clippy::unimplemented,
clippy::unnested_or_patterns,
clippy::unused_self,
clippy::useless_transmute,
clippy::verbose_file_reads,
clippy::zero_sized_map_values,
future_incompatible,
nonstandard_style,
rust_2018_idioms
)]
// END - Embark standard lints v0.4
// crate-specific exceptions:
// #![allow()]

use crate::device::MyDevice;
use crate::graphics::{MyRenderPipelineManager, MyRenderer};
use crate::swapchain::MySwapchainManager;
use crate::ash_renderer::device::MyDevice;
use crate::ash_renderer::graphics::{MyRenderPipelineManager, MyRenderer};
use crate::ash_renderer::swapchain::MySwapchainManager;
use crate::enable_debug_layer;
use ash::util::read_spv;
use graphics_shaders::ShaderConstants;
use mygraphics_shaders::ShaderConstants;
use raw_window_handle::HasDisplayHandle as _;
use winit::event_loop::ActiveEventLoop;
use winit::{
Expand All @@ -88,10 +17,6 @@ pub mod single_command_buffer;
pub mod swapchain;

pub fn main() -> anyhow::Result<()> {
let enable_debug_layer = std::env::var("DEBUG_LAYER")
.map(|e| !(e == "0" || e == "false"))
.unwrap_or(false);

// runtime setup
let event_loop = EventLoop::new()?;
// FIXME(eddyb) incomplete `winit` upgrade, follow the guides in:
Expand All @@ -107,7 +32,7 @@ pub fn main() -> anyhow::Result<()> {
)?;

let extensions = ash_window::enumerate_required_extensions(window.display_handle()?.as_raw())?;
let device = MyDevice::new(extensions, enable_debug_layer)?;
let device = MyDevice::new(extensions, enable_debug_layer())?;
let mut swapchain = MySwapchainManager::new(device.clone(), window)?;
let mut renderer = MyRenderer::new(MyRenderPipelineManager::new(
device.clone(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::device::MyDevice;
use crate::ash_renderer::device::MyDevice;
use ash::vk;
use std::sync::Arc;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::device::MyDevice;
use crate::ash_renderer::device::MyDevice;
use anyhow::Context;
use ash::vk;
use raw_window_handle::{HasDisplayHandle, HasWindowHandle};
Expand Down
83 changes: 83 additions & 0 deletions generated/graphics/cargo-gpu/mygraphics/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// FIXME(eddyb) update/review these lints.
//
// BEGIN - Embark standard lints v0.4
// do not change or add/remove here, but one can add exceptions after this section
// for more info see: <https://github.com/EmbarkStudios/rust-ecosystem/issues/59>
//#![deny(unsafe_code)] // impractical in this crate dealing with unsafe `ash`
#![warn(
clippy::all,
clippy::await_holding_lock,
clippy::char_lit_as_u8,
clippy::checked_conversions,
clippy::dbg_macro,
clippy::debug_assert_with_mut_call,
clippy::doc_markdown,
clippy::empty_enum,
clippy::enum_glob_use,
clippy::exit,
clippy::expl_impl_clone_on_copy,
clippy::explicit_deref_methods,
clippy::explicit_into_iter_loop,
clippy::fallible_impl_from,
clippy::filter_map_next,
clippy::float_cmp_const,
clippy::fn_params_excessive_bools,
clippy::if_let_mutex,
clippy::implicit_clone,
clippy::imprecise_flops,
clippy::inefficient_to_string,
clippy::invalid_upcast_comparisons,
clippy::large_types_passed_by_value,
clippy::let_unit_value,
clippy::linkedlist,
clippy::lossy_float_literal,
clippy::macro_use_imports,
clippy::manual_ok_or,
clippy::map_err_ignore,
clippy::map_flatten,
clippy::map_unwrap_or,
clippy::match_same_arms,
clippy::match_wildcard_for_single_variants,
clippy::mem_forget,
clippy::mut_mut,
clippy::mutex_integer,
clippy::needless_borrow,
clippy::needless_continue,
clippy::option_option,
clippy::path_buf_push_overwrite,
clippy::ptr_as_ptr,
clippy::ref_option_ref,
clippy::rest_pat_in_fully_bound_structs,
clippy::same_functions_in_if_condition,
clippy::semicolon_if_nothing_returned,
clippy::string_add_assign,
clippy::string_add,
clippy::string_lit_as_bytes,
clippy::string_to_string,
clippy::todo,
clippy::trait_duplication_in_bounds,
clippy::unimplemented,
clippy::unnested_or_patterns,
clippy::unused_self,
clippy::useless_transmute,
clippy::verbose_file_reads,
clippy::zero_sized_map_values,
future_incompatible,
nonstandard_style,
rust_2018_idioms
)]
// END - Embark standard lints v0.4
// crate-specific exceptions:
// #![allow()]

pub mod ash_renderer;

pub fn main() -> anyhow::Result<()> {
ash_renderer::main()
}

pub fn enable_debug_layer() -> bool {
std::env::var("DEBUG_LAYER")
.map(|e| !(e == "0" || e == "false"))
.unwrap_or(false)
}
4 changes: 2 additions & 2 deletions generated/graphics/spirv-builder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace]
members = [
"ash",
"shaders"
"mygraphics",
"mygraphics-shaders"
]
resolver = "3"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "graphics-shaders"
name = "mygraphics-shaders"
version = "0.1.0"
edition = "2024"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "graphics-ash"
name = "mygraphics"
publish = false
version.workspace = true
authors.workspace = true
Expand All @@ -15,7 +15,7 @@ default = ["use-compiled-tools"]
use-installed-tools = ["spirv-builder/use-installed-tools"]
use-compiled-tools = ["spirv-builder/use-compiled-tools"]
[dependencies]
graphics-shaders = { path = "../shaders" }
mygraphics-shaders = { path = "../mygraphics-shaders" }

ash.workspace = true
ash-window.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::path::PathBuf;

pub fn main() -> anyhow::Result<()> {
let manifest_dir = env!("CARGO_MANIFEST_DIR");
let crate_path = [manifest_dir, "..", "shaders"]
let crate_path = [manifest_dir, "..", "mygraphics-shaders"]
.iter()
.copied()
.collect::<PathBuf>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::device::MyDevice;
use crate::single_command_buffer::SingleCommandBuffer;
use crate::swapchain::DrawFrame;
use crate::ash_renderer::device::MyDevice;
use crate::ash_renderer::single_command_buffer::SingleCommandBuffer;
use crate::ash_renderer::swapchain::DrawFrame;
use anyhow::Context;
use ash::vk;
use graphics_shaders::ShaderConstants;
use mygraphics_shaders::ShaderConstants;
use std::sync::Arc;

/// Manages the creation and recreation of [`MyRenderPipeline`], whenever new shader code ([`Self::set_shader_code`])
Expand Down
Loading