Skip to content

Commit

Permalink
Release 0.7.10
Browse files Browse the repository at this point in the history
  • Loading branch information
pannapudi committed Oct 14, 2022
1 parent d210420 commit e305050
Show file tree
Hide file tree
Showing 9 changed files with 202 additions and 72 deletions.
209 changes: 162 additions & 47 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pilka"
version = "0.7.9"
version = "0.7.10"
authors = ["Alex Komissarov <[email protected]>"]
edition = "2021"
license = "MIT"
Expand All @@ -22,6 +22,7 @@ members = ["pilka_ash", "pilka_wgpu", "pilka_types"]
[dependencies]
# Ecosystem choice for crossplatform window
winit = "0.27.2"
raw-window-handle = "0.5.0"

# Fancy-pants errors
color-eyre = "0.6.0"
Expand Down Expand Up @@ -54,13 +55,13 @@ pollster = "0.2.4"
# GUI profiler dependencies
puffin = "0.13.2"
puffin_egui = "0.16.0"
egui_wgpu_backend = "0.19.0"
egui_wgpu_backend = "0.20.0"
egui_winit_platform = "0.16.0"
egui = "0.19.0"
egui-wgpu = { version = "0.19.0", features = ["winit"] }

#Shader compiler
naga = {version = "0.9.0", features = ["wgsl-in", "span", "spv-out", "wgsl-out", "glsl-validate"] }
naga = {version = "0.10.0", features = ["wgsl-in", "span", "spv-out", "wgsl-out", "validate"] }

[profile.release]
lto = true
Expand Down
6 changes: 3 additions & 3 deletions pilka_ash/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pilka_ash"
version = "0.7.9"
version = "0.7.10"
authors = ["Alex Komissarov <[email protected]>"]
edition = "2021"
license = "MIT"
Expand All @@ -20,8 +20,8 @@ maintenance = { status = "experimental" }
[dependencies]
ash = "0.37.0"
ash-molten = "0.13.0"
ash-window = "0.11.0"
raw-window-handle = "0.4.3"
ash-window = "0.12.0"
raw-window-handle = "0.5.0"
bytemuck = { version = "1.7.3", features = ["derive"] }
ktx = "0.3.2"
pilka_types = { version = "0.7.1", path = "../pilka_types" }
Expand Down
18 changes: 14 additions & 4 deletions pilka_ash/src/pvk/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use ash::{
vk::{self, Handle},
};

use raw_window_handle::HasRawWindowHandle;
use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle};

use std::{ffi::CStr, ops::Deref, os::raw::c_char, sync::Arc};

Expand Down Expand Up @@ -139,9 +139,19 @@ impl VkInstance {
}

/// Make surface and surface loader.
pub fn create_surface<W: HasRawWindowHandle>(&self, window: &W) -> VkResult<VkSurface> {
let surface =
unsafe { ash_window::create_surface(&self.entry, &self.instance, window, None) }?;
pub fn create_surface<W: HasRawWindowHandle + HasRawDisplayHandle>(
&self,
window: &W,
) -> VkResult<VkSurface> {
let surface = unsafe {
ash_window::create_surface(
&self.entry,
&self.instance,
window.raw_display_handle(),
window.raw_window_handle(),
None,
)
}?;
let surface_loader = Surface::new(&self.entry, &self.instance);

Ok(VkSurface {
Expand Down
6 changes: 4 additions & 2 deletions pilka_ash/src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ mod screenshot;
use pilka_types::{
dispatch_optimal_size, Frame, ImageDimentions, PushConstant, ShaderCreateInfo, Uniform,
};
use raw_window_handle::HasRawDisplayHandle;

use crate::pvk::*;
use ash::{
Expand Down Expand Up @@ -295,7 +296,7 @@ impl<'a> AshRender<'a> {
Ok(name)
}

pub fn new<W: HasRawWindowHandle>(
pub fn new<W: HasRawWindowHandle + HasRawDisplayHandle>(
window: &W,
push_constants_range: u32,
) -> Result<Self, Box<dyn std::error::Error>> {
Expand All @@ -305,7 +306,8 @@ impl<'a> AshRender<'a> {
vec![]
};
// let validation_layers = vec!["VK_LAYER_KHRONOS_validation\0"];
let extention_names = ash_window::enumerate_required_extensions(window)?;
let extention_names =
ash_window::enumerate_required_extensions(window.raw_display_handle())?;

let instance = VkInstance::new(&validation_layers, extention_names)?;

Expand Down
2 changes: 1 addition & 1 deletion pilka_types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pilka_types"
version = "0.7.1"
version = "0.7.10"
edition = "2021"
authors = ["Alex Komissarov <[email protected]>"]
description = "Pilka types"
Expand Down
8 changes: 4 additions & 4 deletions pilka_wgpu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pilka_wgpu"
version = "0.7.9"
version = "0.7.10"
edition = "2021"
authors = ["Alex Komissarov <[email protected]>"]
license = "MIT"
Expand All @@ -13,15 +13,15 @@ categories = ["graphics", "rendering"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
wgpu = { version = "0.13.1", features = ["spirv"] }
raw-window-handle = "0.4.2"
wgpu = { version = "0.14.0", features = ["spirv"] }
raw-window-handle = "0.5.0"
bytemuck = { version = "1.7.3", features = ["derive"] }
color-eyre = "0.6.0"
env_logger = "0.9.0"
pilka_types = { version = "0.7.1", path = "../pilka_types" }
puffin = "0.13.2"
pollster = "0.2.4"
smaa = "0.7.0"
smaa = "0.8.0"
# smaa = { git = "https://github.com/pudnax/smaa-rs", branch = "webgpu12" }
# naga = { git = "https://github.com/gfx-rs/naga", branch = "master", features = ["glsl-in",
# "wgsl-in", "spv-in", "span", "spv-out", "wgsl-out", "glsl-validate"] }
Expand Down
7 changes: 4 additions & 3 deletions pilka_wgpu/src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use pilka_types::{
ShaderCreateInfo, Uniform,
};
use pollster::block_on;
use raw_window_handle::HasRawWindowHandle;
use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle};
use wgpu::{
Adapter, BindGroup, BindGroupLayout, BindGroupLayoutDescriptor, ComputePipeline, Device,
PrimitiveState, PrimitiveTopology, Queue, RenderPipeline, Surface, Texture, TextureFormat,
Expand Down Expand Up @@ -421,8 +421,8 @@ impl WgpuRender {
}
}

pub fn new(
window: &impl HasRawWindowHandle,
pub fn new<W: HasRawWindowHandle + HasRawDisplayHandle>(
window: &W,
push_constant_ranges: u32,
width: u32,
height: u32,
Expand Down Expand Up @@ -467,6 +467,7 @@ impl WgpuRender {
width: extent.width,
height: extent.height,
present_mode: wgpu::PresentMode::Immediate,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
};
surface.configure(&device, &surface_config);

Expand Down
11 changes: 6 additions & 5 deletions src/render_bundle.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use std::path::PathBuf;

use crate::shader_compiler::ShaderCompiler;
use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle};

use color_eyre::Result;
use pilka_ash::{AshRender, HasRawWindowHandle};
use pilka_ash::AshRender;
use pilka_types::{
ContiniousHashMap, Frame, ImageDimentions, PipelineInfo, PushConstant, ShaderCreateInfo,
};
Expand Down Expand Up @@ -41,8 +42,8 @@ pub struct RenderBundleStatic<'a> {
}

impl<'a> RenderBundleStatic<'a> {
pub fn new(
window: &impl HasRawWindowHandle,
pub fn new<W: HasRawWindowHandle + HasRawDisplayHandle>(
window: &W,
push_constant_range: u32,
(width, height): (u32, u32),
) -> Result<RenderBundleStatic<'a>> {
Expand Down Expand Up @@ -181,9 +182,9 @@ impl<'a> RenderBundleStatic<'a> {
pub fn shader_list(&self) -> Vec<PathBuf> {
self.shader_set.keys().cloned().collect()
}
pub fn switch(
pub fn switch<W: HasRawDisplayHandle + HasRawWindowHandle>(
&mut self,
window: &impl HasRawWindowHandle,
window: &W,
shader_compiler: &mut ShaderCompiler,
) -> Result<()> {
puffin::profile_function!();
Expand Down

0 comments on commit e305050

Please sign in to comment.