Skip to content

Commit b71a0e2

Browse files
committed
fixup! [naga] Support textureSampleBaseClampToEdge() for texture2d
1 parent 7c668fa commit b71a0e2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

naga/src/back/msl/writer.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,11 @@ impl<W: Write> Writer<W> {
19501950
image,
19511951
sampler,
19521952
clamp_to_edge: true,
1953-
..
1953+
gather: None,
1954+
array_index: None,
1955+
offset: None,
1956+
level: crate::SampleLevel::Zero,
1957+
depth_ref: None,
19541958
} => {
19551959
write!(self.out, "{IMAGE_SAMPLE_BASE_CLAMP_TO_EDGE_FUNCTION}(")?;
19561960
self.put_expression(image, context, true)?;
@@ -1969,8 +1973,14 @@ impl<W: Write> Writer<W> {
19691973
offset,
19701974
level,
19711975
depth_ref,
1972-
clamp_to_edge: _,
1976+
clamp_to_edge,
19731977
} => {
1978+
if clamp_to_edge {
1979+
return Err(Error::GenericValidation(
1980+
"ImageSample::clamp_to_edge should have been validated out".to_string(),
1981+
));
1982+
}
1983+
19741984
let main_op = match gather {
19751985
Some(_) => "gather",
19761986
None => "sample",

0 commit comments

Comments
 (0)