mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Fix textureGather compatibility on macOS 10.13 (#2104)
* Fix textureGather compatibility on macOS 10.13 * Fix tests * Update src/back/msl/writer.rs Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com> Co-authored-by: Jet Spark <lixiaopeng.jetspark@bytedance.com> Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
This commit is contained in:
@@ -1440,7 +1440,7 @@ impl<W: Write> Writer<W> {
|
||||
// Offset always comes before the gather, except
|
||||
// in cube maps where it's not applicable
|
||||
if offset.is_none() && !is_cube_map {
|
||||
write!(self.out, ", int2(0)")?;
|
||||
write!(self.out, ", {}::int2(0)", NAMESPACE)?;
|
||||
}
|
||||
let letter = ['x', 'y', 'z', 'w'][component as usize];
|
||||
write!(self.out, ", {}::component::{}", NAMESPACE, letter)?;
|
||||
|
||||
@@ -144,7 +144,7 @@ fragment gatherOutput gather(
|
||||
, metal::depth2d<float, metal::access::sample> image_2d_depth [[user(fake0)]]
|
||||
) {
|
||||
metal::float2 tc_2 = metal::float2(0.5);
|
||||
metal::float4 s2d_1 = image_2d.gather(sampler_reg, tc_2, int2(0), metal::component::y);
|
||||
metal::float4 s2d_1 = image_2d.gather(sampler_reg, tc_2, metal::int2(0), metal::component::y);
|
||||
metal::float4 s2d_offset_1 = image_2d.gather(sampler_reg, tc_2, const_type_9_, metal::component::w);
|
||||
metal::float4 s2d_depth_1 = image_2d_depth.gather_compare(sampler_cmp, tc_2, 0.5);
|
||||
metal::float4 s2d_depth_offset = image_2d_depth.gather_compare(sampler_cmp, tc_2, 0.5, const_type_9_);
|
||||
|
||||
Reference in New Issue
Block a user