Skip to content
Draft
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
5 changes: 4 additions & 1 deletion wgpu-core/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,10 @@ impl Interface {
for output in entry_point.outputs.iter() {
//TODO: count builtins towards the limit?
inter_stage_components += match *output {
Varying::Local { ref iv, .. } => iv.ty.dim.num_components(),
Varying::Local { ref iv, location } => {
if location > self.limits.max_inter_stage_shader_variables {}
iv.ty.dim.num_components()
}
Varying::BuiltIn(_) => 0,
};

Expand Down
9 changes: 5 additions & 4 deletions wgpu-types/src/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ pub struct Limits {
/// Maximum value for `VertexBufferLayout::array_stride` when creating a `RenderPipeline`.
/// Defaults to 2048. Higher is "better".
pub max_vertex_buffer_array_stride: u32,
/// Maximum value for the number of input or output variables for inter-stage communication
/// (like vertex outputs or fragment inputs) `@location(…)`s (in WGSL parlance)
/// when creating a `RenderPipeline`.
/// Defaults to 16. Higher is "better".
pub max_inter_stage_shader_variables: u32,
/// Required `BufferBindingType::Uniform` alignment for `BufferBinding::offset`
/// when creating a `BindGroup`, or for `set_bind_group` `dynamicOffsets`.
/// Defaults to 256. Lower is "better".
Expand All @@ -183,10 +188,6 @@ pub struct Limits {
/// when creating a `BindGroup`, or for `set_bind_group` `dynamicOffsets`.
/// Defaults to 256. Lower is "better".
pub min_storage_buffer_offset_alignment: u32,
/// Maximum allowed number of components (scalars) of input or output locations for
/// inter-stage communication (vertex outputs to fragment inputs). Defaults to 60.
/// Higher is "better".
pub max_inter_stage_shader_components: u32,
/// The maximum allowed number of color attachments.
pub max_color_attachments: u32,
/// The maximum number of bytes necessary to hold one sample (pixel or subpixel) of render
Expand Down
Loading