Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValidationError-ify GraphicsPipeline #2234

Merged
merged 7 commits into from
Jun 25, 2023
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
14 changes: 7 additions & 7 deletions examples/src/bin/async-update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ use vulkano::{
},
layout::PipelineDescriptorSetLayoutCreateInfo,
GraphicsPipeline, Pipeline, PipelineBindPoint, PipelineLayout,
PipelineShaderStageCreateInfo,
},
render_pass::{Framebuffer, FramebufferCreateInfo, RenderPass, Subpass},
sampler::{Sampler, SamplerCreateInfo},
shader::PipelineShaderStageCreateInfo,
swapchain::{
acquire_next_image, AcquireError, Surface, Swapchain, SwapchainCreateInfo,
SwapchainCreationError, SwapchainPresentInfo,
Expand Down Expand Up @@ -438,8 +438,8 @@ fn main() {
.definition(&vs.info().input_interface)
.unwrap();
let stages = [
PipelineShaderStageCreateInfo::entry_point(vs),
PipelineShaderStageCreateInfo::entry_point(fs),
PipelineShaderStageCreateInfo::new(vs),
PipelineShaderStageCreateInfo::new(fs),
];
let layout = PipelineLayout::new(
device.clone(),
Expand Down Expand Up @@ -471,9 +471,9 @@ fn main() {
};

let mut viewport = Viewport {
origin: [0.0, 0.0],
dimensions: [0.0, 0.0],
depth_range: 0.0..1.0,
offset: [0.0, 0.0],
extent: [0.0, 0.0],
depth_range: 0.0..=1.0,
};
let mut framebuffers = window_size_dependent_setup(&images, render_pass.clone(), &mut viewport);

Expand Down Expand Up @@ -850,7 +850,7 @@ fn window_size_dependent_setup(
viewport: &mut Viewport,
) -> Vec<Arc<Framebuffer>> {
let dimensions = images[0].dimensions().width_height();
viewport.dimensions = [dimensions[0] as f32, dimensions[1] as f32];
viewport.extent = [dimensions[0] as f32, dimensions[1] as f32];

images
.iter()
Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/basic-compute-shader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ use vulkano::{
pipeline::{
compute::ComputePipelineCreateInfo, layout::PipelineDescriptorSetLayoutCreateInfo,
ComputePipeline, Pipeline, PipelineBindPoint, PipelineLayout,
PipelineShaderStageCreateInfo,
},
shader::PipelineShaderStageCreateInfo,
sync::{self, GpuFuture},
VulkanLibrary,
};
Expand Down Expand Up @@ -142,7 +142,7 @@ fn main() {
.unwrap()
.entry_point("main")
.unwrap();
let stage = PipelineShaderStageCreateInfo::entry_point(cs);
let stage = PipelineShaderStageCreateInfo::new(cs);
let layout = PipelineLayout::new(
device.clone(),
PipelineDescriptorSetLayoutCreateInfo::from_stages([&stage])
Expand Down
15 changes: 7 additions & 8 deletions examples/src/bin/buffer-allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ use vulkano::{
GraphicsPipelineCreateInfo,
},
layout::PipelineDescriptorSetLayoutCreateInfo,
GraphicsPipeline, PipelineLayout,
GraphicsPipeline, PipelineLayout, PipelineShaderStageCreateInfo,
},
render_pass::{Framebuffer, FramebufferCreateInfo, RenderPass, Subpass},
shader::PipelineShaderStageCreateInfo,
swapchain::{
acquire_next_image, AcquireError, Surface, Swapchain, SwapchainCreateInfo,
SwapchainCreationError, SwapchainPresentInfo,
Expand Down Expand Up @@ -237,8 +236,8 @@ fn main() {
.definition(&vs.info().input_interface)
.unwrap();
let stages = [
PipelineShaderStageCreateInfo::entry_point(vs),
PipelineShaderStageCreateInfo::entry_point(fs),
PipelineShaderStageCreateInfo::new(vs),
PipelineShaderStageCreateInfo::new(fs),
];
let layout = PipelineLayout::new(
device.clone(),
Expand Down Expand Up @@ -267,9 +266,9 @@ fn main() {
};

let mut viewport = Viewport {
origin: [0.0, 0.0],
dimensions: [0.0, 0.0],
depth_range: 0.0..1.0,
offset: [0.0, 0.0],
extent: [0.0, 0.0],
depth_range: 0.0..=1.0,
};
let mut framebuffers = window_size_dependent_setup(&images, render_pass.clone(), &mut viewport);
let mut recreate_swapchain = false;
Expand Down Expand Up @@ -435,7 +434,7 @@ fn window_size_dependent_setup(
viewport: &mut Viewport,
) -> Vec<Arc<Framebuffer>> {
let dimensions = images[0].dimensions().width_height();
viewport.dimensions = [dimensions[0] as f32, dimensions[1] as f32];
viewport.extent = [dimensions[0] as f32, dimensions[1] as f32];

images
.iter()
Expand Down
24 changes: 12 additions & 12 deletions examples/src/bin/deferred/frame/ambient_lighting_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ use vulkano::{
},
layout::PipelineDescriptorSetLayoutCreateInfo,
GraphicsPipeline, Pipeline, PipelineBindPoint, PipelineLayout,
PipelineShaderStageCreateInfo,
},
render_pass::Subpass,
shader::PipelineShaderStageCreateInfo,
};

use super::LightingVertex;
Expand Down Expand Up @@ -99,8 +99,8 @@ impl AmbientLightingSystem {
.definition(&vs.info().input_interface)
.unwrap();
let stages = [
PipelineShaderStageCreateInfo::entry_point(vs),
PipelineShaderStageCreateInfo::entry_point(fs),
PipelineShaderStageCreateInfo::new(vs),
PipelineShaderStageCreateInfo::new(fs),
];
let layout = PipelineLayout::new(
device.clone(),
Expand All @@ -122,12 +122,12 @@ impl AmbientLightingSystem {
color_blend_state: Some(
ColorBlendState::new(subpass.num_color_attachments()).blend(
AttachmentBlend {
color_op: BlendOp::Add,
color_source: BlendFactor::One,
color_destination: BlendFactor::One,
alpha_op: BlendOp::Max,
alpha_source: BlendFactor::One,
alpha_destination: BlendFactor::One,
color_blend_op: BlendOp::Add,
src_color_blend_factor: BlendFactor::One,
dst_color_blend_factor: BlendFactor::One,
alpha_blend_op: BlendOp::Max,
src_alpha_blend_factor: BlendFactor::One,
dst_alpha_blend_factor: BlendFactor::One,
},
),
),
Expand Down Expand Up @@ -179,9 +179,9 @@ impl AmbientLightingSystem {
.unwrap();

let viewport = Viewport {
origin: [0.0, 0.0],
dimensions: [viewport_dimensions[0] as f32, viewport_dimensions[1] as f32],
depth_range: 0.0..1.0,
offset: [0.0, 0.0],
extent: [viewport_dimensions[0] as f32, viewport_dimensions[1] as f32],
depth_range: 0.0..=1.0,
};

let mut builder = AutoCommandBufferBuilder::secondary(
Expand Down
24 changes: 12 additions & 12 deletions examples/src/bin/deferred/frame/directional_lighting_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ use vulkano::{
},
layout::PipelineDescriptorSetLayoutCreateInfo,
GraphicsPipeline, Pipeline, PipelineBindPoint, PipelineLayout,
PipelineShaderStageCreateInfo,
},
render_pass::Subpass,
shader::PipelineShaderStageCreateInfo,
};

use super::LightingVertex;
Expand Down Expand Up @@ -102,8 +102,8 @@ impl DirectionalLightingSystem {
.definition(&vs.info().input_interface)
.unwrap();
let stages = [
PipelineShaderStageCreateInfo::entry_point(vs),
PipelineShaderStageCreateInfo::entry_point(fs),
PipelineShaderStageCreateInfo::new(vs),
PipelineShaderStageCreateInfo::new(fs),
];
let layout = PipelineLayout::new(
device.clone(),
Expand All @@ -125,12 +125,12 @@ impl DirectionalLightingSystem {
color_blend_state: Some(
ColorBlendState::new(subpass.num_color_attachments()).blend(
AttachmentBlend {
color_op: BlendOp::Add,
color_source: BlendFactor::One,
color_destination: BlendFactor::One,
alpha_op: BlendOp::Max,
alpha_source: BlendFactor::One,
alpha_destination: BlendFactor::One,
color_blend_op: BlendOp::Add,
src_color_blend_factor: BlendFactor::One,
dst_color_blend_factor: BlendFactor::One,
alpha_blend_op: BlendOp::Max,
src_alpha_blend_factor: BlendFactor::One,
dst_alpha_blend_factor: BlendFactor::One,
},
),
),
Expand Down Expand Up @@ -195,9 +195,9 @@ impl DirectionalLightingSystem {
.unwrap();

let viewport = Viewport {
origin: [0.0, 0.0],
dimensions: [viewport_dimensions[0] as f32, viewport_dimensions[1] as f32],
depth_range: 0.0..1.0,
offset: [0.0, 0.0],
extent: [viewport_dimensions[0] as f32, viewport_dimensions[1] as f32],
depth_range: 0.0..=1.0,
};

let mut builder = AutoCommandBufferBuilder::secondary(
Expand Down
24 changes: 12 additions & 12 deletions examples/src/bin/deferred/frame/point_lighting_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ use vulkano::{
},
layout::PipelineDescriptorSetLayoutCreateInfo,
GraphicsPipeline, Pipeline, PipelineBindPoint, PipelineLayout,
PipelineShaderStageCreateInfo,
},
render_pass::Subpass,
shader::PipelineShaderStageCreateInfo,
};

use super::LightingVertex;
Expand Down Expand Up @@ -99,8 +99,8 @@ impl PointLightingSystem {
.definition(&vs.info().input_interface)
.unwrap();
let stages = [
PipelineShaderStageCreateInfo::entry_point(vs),
PipelineShaderStageCreateInfo::entry_point(fs),
PipelineShaderStageCreateInfo::new(vs),
PipelineShaderStageCreateInfo::new(fs),
];
let layout = PipelineLayout::new(
device.clone(),
Expand All @@ -122,12 +122,12 @@ impl PointLightingSystem {
color_blend_state: Some(
ColorBlendState::new(subpass.num_color_attachments()).blend(
AttachmentBlend {
color_op: BlendOp::Add,
color_source: BlendFactor::One,
color_destination: BlendFactor::One,
alpha_op: BlendOp::Max,
alpha_source: BlendFactor::One,
alpha_destination: BlendFactor::One,
color_blend_op: BlendOp::Add,
src_color_blend_factor: BlendFactor::One,
dst_color_blend_factor: BlendFactor::One,
alpha_blend_op: BlendOp::Max,
src_alpha_blend_factor: BlendFactor::One,
dst_alpha_blend_factor: BlendFactor::One,
},
),
),
Expand Down Expand Up @@ -206,9 +206,9 @@ impl PointLightingSystem {
.unwrap();

let viewport = Viewport {
origin: [0.0, 0.0],
dimensions: [viewport_dimensions[0] as f32, viewport_dimensions[1] as f32],
depth_range: 0.0..1.0,
offset: [0.0, 0.0],
extent: [viewport_dimensions[0] as f32, viewport_dimensions[1] as f32],
depth_range: 0.0..=1.0,
};

let mut builder = AutoCommandBufferBuilder::secondary(
Expand Down
13 changes: 6 additions & 7 deletions examples/src/bin/deferred/triangle_draw_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ use vulkano::{
GraphicsPipelineCreateInfo,
},
layout::PipelineDescriptorSetLayoutCreateInfo,
GraphicsPipeline, PipelineLayout,
GraphicsPipeline, PipelineLayout, PipelineShaderStageCreateInfo,
},
render_pass::Subpass,
shader::PipelineShaderStageCreateInfo,
};

pub struct TriangleDrawSystem {
Expand Down Expand Up @@ -89,8 +88,8 @@ impl TriangleDrawSystem {
.definition(&vs.info().input_interface)
.unwrap();
let stages = [
PipelineShaderStageCreateInfo::entry_point(vs),
PipelineShaderStageCreateInfo::entry_point(fs),
PipelineShaderStageCreateInfo::new(vs),
PipelineShaderStageCreateInfo::new(fs),
];
let layout = PipelineLayout::new(
device.clone(),
Expand Down Expand Up @@ -143,9 +142,9 @@ impl TriangleDrawSystem {
.set_viewport(
0,
[Viewport {
origin: [0.0, 0.0],
dimensions: [viewport_dimensions[0] as f32, viewport_dimensions[1] as f32],
depth_range: 0.0..1.0,
offset: [0.0, 0.0],
extent: [viewport_dimensions[0] as f32, viewport_dimensions[1] as f32],
depth_range: 0.0..=1.0,
}]
.into_iter()
.collect(),
Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/dynamic-buffers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ use vulkano::{
pipeline::{
compute::ComputePipelineCreateInfo, layout::PipelineDescriptorSetLayoutCreateInfo,
ComputePipeline, Pipeline, PipelineBindPoint, PipelineLayout,
PipelineShaderStageCreateInfo,
},
shader::PipelineShaderStageCreateInfo,
sync::{self, GpuFuture},
DeviceSize, VulkanLibrary,
};
Expand Down Expand Up @@ -127,7 +127,7 @@ fn main() {
.unwrap()
.entry_point("main")
.unwrap();
let stage = PipelineShaderStageCreateInfo::entry_point(cs);
let stage = PipelineShaderStageCreateInfo::new(cs);
let layout = {
let mut layout_create_info =
PipelineDescriptorSetLayoutCreateInfo::from_stages([&stage]);
Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/dynamic-local-size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ use vulkano::{
pipeline::{
compute::ComputePipelineCreateInfo, layout::PipelineDescriptorSetLayoutCreateInfo,
ComputePipeline, Pipeline, PipelineBindPoint, PipelineLayout,
PipelineShaderStageCreateInfo,
},
shader::PipelineShaderStageCreateInfo,
sync::{self, GpuFuture},
VulkanLibrary,
};
Expand Down Expand Up @@ -192,7 +192,7 @@ fn main() {
]
.into_iter()
.collect(),
..PipelineShaderStageCreateInfo::entry_point(cs)
..PipelineShaderStageCreateInfo::new(cs)
};
let layout = PipelineLayout::new(
device.clone(),
Expand Down
Loading