Compare commits

...

25 commits

Author SHA1 Message Date
260051b42c Update Rust crate cc to 1.0.104
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 17m0s
2024-07-01 09:08:41 +00:00
51232b431d Update Rust crate cc to 1.0.102
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 30m18s
2024-06-29 09:07:06 +00:00
6e44e0adf8 Update Rust crate cc to 1.0.99
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 24m40s
2024-06-07 12:08:02 +00:00
c61dcfc70e Update Rust crate serde to 1.0.203
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 19m5s
2024-05-25 18:08:19 +00:00
219c4eff1a Update Rust crate cc to 1.0.98
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 32m8s
2024-05-19 09:07:37 +00:00
4b67acf84f Update Rust crate anyhow to 1.0.86
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 17m50s
2024-05-18 12:10:11 +00:00
93d2705427 Update Rust crate anyhow to 1.0.85
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 15m53s
2024-05-18 00:10:04 +00:00
6d7c889fe9 Update Rust crate serde to 1.0.202
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 15m22s
2024-05-15 09:08:54 +00:00
62c36e3906 Apply visibility to RawBuffer 2024-05-13 14:50:22 +02:00
4c00f52ac2 Update Rust crate serde to 1.0.201
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 17m10s
2024-05-08 03:09:22 +00:00
f5e9b6941c Update Rust crate paste to 1.0.15
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 19m4s
2024-05-07 03:10:44 +00:00
29c596150e Update Rust crate anyhow to 1.0.83
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 17m22s
2024-05-06 21:10:38 +00:00
779e9ae50a Update Rust crate cc to 1.0.97
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 26m54s
2024-05-06 12:08:15 +00:00
1f124e5b09 Update Rust crate serde to 1.0.200
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 16m4s
2024-05-01 18:09:00 +00:00
49a4fe96f5 Update Rust crate cc to 1.0.96
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 17m51s
2024-04-30 15:06:47 +00:00
hodasemi
6724885f0a Setup dynamic cull mode 2024-04-29 13:40:15 +02:00
a5460ebd81 Update Rust crate serde to 1.0.199
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 16m26s
2024-04-27 06:08:59 +00:00
65e480681f Update Rust crate cc to 1.0.95
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 17m25s
2024-04-20 06:07:19 +00:00
fe666addd2 Update Rust crate serde to 1.0.198
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 37m34s
2024-04-17 00:11:19 +00:00
add24bacf3 Update Rust crate cc to 1.0.94
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 9m46s
2024-04-13 18:07:19 +00:00
43fef690b3 Update Rust crate anyhow to 1.0.82
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 8m34s
2024-04-10 06:11:05 +00:00
3a00ab1820 Update Rust crate cc to 1.0.92
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 8m36s
2024-04-08 18:11:08 +00:00
2fa0276bed Update Rust crate cc to 1.0.91
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 8m19s
2024-04-07 12:08:26 +00:00
hodasemi
1fb136bed9 handle special case in swapnchain creation 2024-04-06 21:11:10 +02:00
d57137d798 Update Rust crate image to 0.25.1
All checks were successful
Gavania Merge Build / build (pull_request) Successful in 8m13s
2024-03-31 03:06:32 +00:00
11 changed files with 163 additions and 19 deletions

View file

@ -6,3 +6,4 @@ members = [
"vulkan-sys",
"library_loader",
]
resolver = "2"

View file

@ -7,4 +7,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serde = { version = "1.0.197", features = ["derive"] }
serde = { version = "1.0.203", features = ["derive"] }

View file

@ -9,7 +9,7 @@ build = "build.rs"
[dependencies]
vulkan-sys = { path = "../vulkan-sys" }
anyhow = { version = "1.0.81", features = ["backtrace"] }
anyhow = { version = "1.0.86", features = ["backtrace"] }
[build-dependencies]
cc = "1.0.90"
cc = "1.0.104"

View file

@ -5,9 +5,9 @@ authors = ["hodasemi <superschneider@t-online.de>"]
edition = "2021"
[dependencies]
image = "0.25.0"
image = "0.25.1"
vulkan-sys = { path = "../vulkan-sys" }
vma-rs = { path = "../vma-rs" }
anyhow = { version = "1.0.81", features = ["backtrace"] }
anyhow = { version = "1.0.86", features = ["backtrace"] }
assetpath = { path = "../assetpath" }
utilities = { git = "https://gavania.de/hodasemi/utilities.git" }

View file

@ -505,6 +505,10 @@ impl<'a> CommandBufferRecorder<'a> {
self.device.cmd_set_scissor(self.buffer, 0, scissors);
}
pub fn set_cull_mode(&self, cull_mode: VkCullModeFlags) {
self.device.cmd_set_cull_mode(self.buffer, cull_mode.into());
}
pub fn draw(
&self,
vertex_count: u32,

View file

@ -1864,6 +1864,14 @@ impl Device {
}
}
#[inline]
pub fn cmd_set_cull_mode(&self, command_buffer: VkCommandBuffer, cull_mode: VkCullModeFlags) {
unsafe {
self.device_functions
.vkCmdSetCullMode(command_buffer, cull_mode)
}
}
#[inline]
pub fn cmd_set_depth_bias(
&self,

View file

@ -12,7 +12,7 @@ impl_reprc!(
#[derive(Debug, Copy)]
pub struct RawBuffer {
#[assume_reprc]
d: u8,
pub d: u8,
}
);

View file

@ -50,11 +50,15 @@ impl Swapchain {
image_usage: impl Into<VkImageUsageFlagBits>,
prefered_format: VkFormat,
array_layers: u32,
window_size: (u32, u32),
) -> Result<Arc<Swapchain>> {
let surface_caps = surface.capabilities(&device)?;
let extent = if surface_caps.currentExtent.width == u32::max_value() {
return Err(anyhow::Error::msg("Surface has no extent"));
VkExtent2D {
width: window_size.0,
height: window_size.1,
}
} else {
VkExtent2D {
width: surface_caps.currentExtent.width,
@ -178,7 +182,7 @@ impl Swapchain {
})
}
pub fn recreate(&self) -> Result<()> {
pub fn recreate(&self, window_size: (u32, u32)) -> Result<()> {
// wait for the device to get idle
self.device.wait_idle()?;
@ -187,7 +191,10 @@ impl Swapchain {
let extent = if surface_caps.currentExtent.width == u32::max_value()
|| surface_caps.currentExtent.height == u32::max_value()
{
return Err(anyhow::Error::msg("Surface has no extent"));
VkExtent2D {
width: window_size.0,
height: window_size.1,
}
} else if surface_caps.currentExtent.width == 0 || surface_caps.currentExtent.height == 0 {
// don't recreate swapchain
return Ok(());

View file

@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
library_loader = { path = "../library_loader" }
paste = "1.0.14"
paste = "1.0.15"
shared_library = "0.1.9"
anyhow = { version = "1.0.81", features = ["backtrace"] }
anyhow = { version = "1.0.86", features = ["backtrace"] }
utilities = { git = "https://gavania.de/hodasemi/utilities.git" }

View file

@ -12,11 +12,130 @@ pub enum VkDynamicState {
VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6,
VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7,
VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8,
VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1_000_087_000,
VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1_000_099_000,
VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1_000_143_000,
VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV = 1_000_164_004,
VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV = 1_000_164_006,
VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV = 1_000_205_001,
VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR = 1_000_347_000,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_CULL_MODE = 1000267000,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_FRONT_FACE = 1000267001,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY = 1000267002,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT = 1000267003,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT = 1000267004,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE = 1000267005,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE = 1000267006,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE = 1000267007,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_DEPTH_COMPARE_OP = 1000267008,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE = 1000267009,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE = 1000267010,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_STENCIL_OP = 1000267011,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE = 1000377001,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE = 1000377002,
// Provided by VK_VERSION_1_3
VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE = 1000377004,
// Provided by VK_NV_clip_space_w_scaling
VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000,
// Provided by VK_EXT_discard_rectangles
VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000,
// Provided by VK_EXT_discard_rectangles
VK_DYNAMIC_STATE_DISCARD_RECTANGLE_ENABLE_EXT = 1000099001,
// Provided by VK_EXT_discard_rectangles
VK_DYNAMIC_STATE_DISCARD_RECTANGLE_MODE_EXT = 1000099002,
// Provided by VK_EXT_sample_locations
VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_EXT = 1000143000,
// Provided by VK_KHR_ray_tracing_pipeline
VK_DYNAMIC_STATE_RAY_TRACING_PIPELINE_STACK_SIZE_KHR = 1000347000,
// Provided by VK_NV_shading_rate_image
VK_DYNAMIC_STATE_VIEWPORT_SHADING_RATE_PALETTE_NV = 1000164004,
// Provided by VK_NV_shading_rate_image
VK_DYNAMIC_STATE_VIEWPORT_COARSE_SAMPLE_ORDER_NV = 1000164006,
// Provided by VK_NV_scissor_exclusive
VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_ENABLE_NV = 1000205000,
// Provided by VK_NV_scissor_exclusive
VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV = 1000205001,
// Provided by VK_KHR_fragment_shading_rate
VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR = 1000226000,
// Provided by VK_EXT_vertex_input_dynamic_state
VK_DYNAMIC_STATE_VERTEX_INPUT_EXT = 1000352000,
// Provided by VK_EXT_extended_dynamic_state2
VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT = 1000377000,
// Provided by VK_EXT_extended_dynamic_state2
VK_DYNAMIC_STATE_LOGIC_OP_EXT = 1000377003,
// Provided by VK_EXT_color_write_enable
VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT = 1000381000,
// Provided by VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_DEPTH_CLAMP_ENABLE_EXT = 1000455003,
// Provided by VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_POLYGON_MODE_EXT = 1000455004,
// Provided by VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT = 1000455005,
// Provided by VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_SAMPLE_MASK_EXT = 1000455006,
// Provided by VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT = 1000455007,
// Provided by VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT = 1000455008,
// Provided by VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_LOGIC_OP_ENABLE_EXT = 1000455009,
// Provided by VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_COLOR_BLEND_ENABLE_EXT = 1000455010,
// Provided by VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_COLOR_BLEND_EQUATION_EXT = 1000455011,
// Provided by VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT = 1000455012,
// Provided by VK_EXT_extended_dynamic_state3 with VK_KHR_maintenance2 or
VK_DYNAMIC_STATE_TESSELLATION_DOMAIN_ORIGIN_EXT = 1000455002,
// Provided by VK_EXT_extended_dynamic_state3 with VK_EXT_transform_feedback
VK_DYNAMIC_STATE_RASTERIZATION_STREAM_EXT = 1000455013,
// Provided by VK_EXT_conservative_rasterization with VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_CONSERVATIVE_RASTERIZATION_MODE_EXT = 1000455014,
// Provided by VK_EXT_conservative_rasterization with VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_EXTRA_PRIMITIVE_OVERESTIMATION_SIZE_EXT = 1000455015,
// Provided by VK_EXT_depth_clip_enable with VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_DEPTH_CLIP_ENABLE_EXT = 1000455016,
// Provided by VK_EXT_extended_dynamic_state3 with VK_EXT_sample_locations
VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_ENABLE_EXT = 1000455017,
// Provided by VK_EXT_blend_operation_advanced with VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_COLOR_BLEND_ADVANCED_EXT = 1000455018,
// Provided by VK_EXT_extended_dynamic_state3 with VK_EXT_provoking_vertex
VK_DYNAMIC_STATE_PROVOKING_VERTEX_MODE_EXT = 1000455019,
// Provided by VK_EXT_extended_dynamic_state3 with VK_EXT_line_rasterization
VK_DYNAMIC_STATE_LINE_RASTERIZATION_MODE_EXT = 1000455020,
// Provided by VK_EXT_extended_dynamic_state3 with VK_EXT_line_rasterization
VK_DYNAMIC_STATE_LINE_STIPPLE_ENABLE_EXT = 1000455021,
// Provided by VK_EXT_depth_clip_control with VK_EXT_extended_dynamic_state3
VK_DYNAMIC_STATE_DEPTH_CLIP_NEGATIVE_ONE_TO_ONE_EXT = 1000455022,
// Provided by VK_EXT_extended_dynamic_state3 with VK_NV_clip_space_w_scaling
VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_ENABLE_NV = 1000455023,
// Provided by VK_EXT_extended_dynamic_state3 with VK_NV_viewport_swizzle
VK_DYNAMIC_STATE_VIEWPORT_SWIZZLE_NV = 1000455024,
// Provided by VK_EXT_extended_dynamic_state3 with VK_NV_fragment_coverage_to_color
VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_ENABLE_NV = 1000455025,
// Provided by VK_EXT_extended_dynamic_state3 with VK_NV_fragment_coverage_to_color
VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_LOCATION_NV = 1000455026,
// Provided by VK_EXT_extended_dynamic_state3 with VK_NV_framebuffer_mixed_samples
VK_DYNAMIC_STATE_COVERAGE_MODULATION_MODE_NV = 1000455027,
// Provided by VK_EXT_extended_dynamic_state3 with VK_NV_framebuffer_mixed_samples
VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_ENABLE_NV = 1000455028,
// Provided by VK_EXT_extended_dynamic_state3 with VK_NV_framebuffer_mixed_samples
VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_NV = 1000455029,
// Provided by VK_EXT_extended_dynamic_state3 with VK_NV_shading_rate_image
VK_DYNAMIC_STATE_SHADING_RATE_IMAGE_ENABLE_NV = 1000455030,
// Provided by VK_EXT_extended_dynamic_state3 with VK_NV_representative_fragment_test
VK_DYNAMIC_STATE_REPRESENTATIVE_FRAGMENT_TEST_ENABLE_NV = 1000455031,
// Provided by VK_EXT_extended_dynamic_state3 with VK_NV_coverage_reduction_mode
VK_DYNAMIC_STATE_COVERAGE_REDUCTION_MODE_NV = 1000455032,
// Provided by VK_EXT_attachment_feedback_loop_dynamic_state
VK_DYNAMIC_STATE_ATTACHMENT_FEEDBACK_LOOP_ENABLE_EXT = 1000524000,
// Provided by VK_KHR_line_rasterization
VK_DYNAMIC_STATE_LINE_STIPPLE_KHR = 1000259000,
}

View file

@ -399,6 +399,11 @@ load_function_ptrs!(DeviceFunctions, {
pScissors: *const VkRect2D
) -> (),
vkCmdSetCullMode(
commandBuffer: VkCommandBuffer,
cullMode: VkCullModeFlags
) -> (),
vkCmdSetLineWidth(commandBuffer: VkCommandBuffer, lineWidth: f32) -> (),
vkCmdSetDepthBias(