mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[glsl-in] error on a matCx2 used with the std140 layout (#1806)
This commit is contained in:
@@ -94,6 +94,12 @@ pub enum ErrorKind {
|
||||
/// prioritize work.
|
||||
#[error("Unknown layout qualifier: {0}")]
|
||||
UnknownLayoutQualifier(String),
|
||||
/// Unsupported matrix of the form matCx2
|
||||
///
|
||||
/// Our IR expects matrices of the form matCx2 to have a stride of 8 however
|
||||
/// matrices in the std140 layout have a stride of at least 16
|
||||
#[error("unsupported matrix of the form matCx2 in std140 block layout")]
|
||||
UnsupportedMatrixTypeInStd140,
|
||||
/// A variable with the same name already exists in the current scope.
|
||||
#[cfg(feature = "glsl-validate")]
|
||||
#[error("Variable already declared: {0}")]
|
||||
|
||||
@@ -121,6 +121,14 @@ pub fn calculate_offset(
|
||||
align = align_up(align, 16);
|
||||
}
|
||||
|
||||
// See comment on the error kind
|
||||
if StructLayout::Std140 == layout && rows == crate::VectorSize::Bi {
|
||||
errors.push(Error {
|
||||
kind: ErrorKind::UnsupportedMatrixTypeInStd140,
|
||||
meta,
|
||||
});
|
||||
}
|
||||
|
||||
(align, align * columns as u32)
|
||||
}
|
||||
TypeInner::Struct { ref members, .. } => {
|
||||
|
||||
Reference in New Issue
Block a user