Skip to content

Commit

Permalink
ValidationError-ify GraphicsPipeline (#2234)
Browse files Browse the repository at this point in the history
* Add `RequiresAllOf`, automatically enable required extensions and features

* Add more missing backticks and backslashes to error messages

* Use updated VUIDs that require `acceleration_structure`

* ValidationError-ify `GraphicsPipeline`

* Update vulkano/src/lib.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* Update vulkano/src/lib.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
  • Loading branch information
Rua and marc0246 authored Jun 25, 2023
1 parent 862e73b commit 6967734
Show file tree
Hide file tree
Showing 58 changed files with 5,523 additions and 5,151 deletions.
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

0 comments on commit 6967734

Please sign in to comment.