mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 23:04:07 +00:00
[glsl-out] textureSize level must be a signed integer. (#2397)
This commit is contained in:
parent
a550b0b499
commit
7624d6c78e
@ -2589,8 +2589,25 @@ impl<'a, W: Write> Writer<'a, W> {
|
||||
write!(self.out, "textureSize(")?;
|
||||
self.write_expr(image, ctx)?;
|
||||
if let Some(expr) = level {
|
||||
let cast_to_int = matches!(
|
||||
*ctx.info[expr].ty.inner_with(&self.module.types),
|
||||
crate::TypeInner::Scalar {
|
||||
kind: crate::ScalarKind::Uint,
|
||||
..
|
||||
}
|
||||
);
|
||||
|
||||
write!(self.out, ", ")?;
|
||||
|
||||
if cast_to_int {
|
||||
write!(self.out, "int(")?;
|
||||
}
|
||||
|
||||
self.write_expr(expr, ctx)?;
|
||||
|
||||
if cast_to_int {
|
||||
write!(self.out, ")")?;
|
||||
}
|
||||
} else if !multi {
|
||||
// All textureSize calls requires an lod argument
|
||||
// except for multisampled samplers
|
||||
|
Loading…
Reference in New Issue
Block a user