[msl] use uint behind metal namespace only

This commit is contained in:
Dzmitry Malyshau 2021-03-31 22:27:41 -04:00 committed by Dzmitry Malyshau
parent 80a8243953
commit 7a17da195c
6 changed files with 12 additions and 5 deletions

View File

@ -996,6 +996,13 @@ impl<W: Write> Writer<W> {
let name = &self.names[&NameKey::Type(handle)];
let global_use = GlobalUse::all(); //TODO
match ty.inner {
// work around Metal toolchain bug with `uint` typedef
crate::TypeInner::Scalar {
kind: crate::ScalarKind::Uint,
..
} => {
writeln!(self.out, "typedef metal::uint {};", name)?;
}
crate::TypeInner::Scalar { kind, .. } => {
writeln!(self.out, "typedef {} {};", scalar_kind_string(kind), name)?;
}

View File

@ -14,7 +14,7 @@ constexpr constant unsigned const_1u = 1u;
constexpr constant float const_1f = 1.0;
constexpr constant float const_0_10f = 0.1;
constexpr constant float const_n1f = -1.0;
typedef uint type;
typedef metal::uint type;
typedef metal::float2 type1;
struct Particle {
type1 pos;

View File

@ -9,7 +9,7 @@ constexpr constant unsigned const_0u = 0u;
constexpr constant unsigned const_1u = 1u;
constexpr constant unsigned const_2u = 2u;
constexpr constant unsigned const_3u = 3u;
typedef uint type;
typedef metal::uint type;
typedef type type1[1];
struct PrimeIndices {
type1 data;

View File

@ -18,7 +18,7 @@ typedef metal::float2 type1;
typedef thread type1 *type2;
typedef thread type1 *type3;
typedef metal::float4 type4;
typedef uint type5;
typedef metal::uint type5;
typedef type type6[const_1u];
struct gl_PerVertex {
type4 gl_Position;

View File

@ -30,7 +30,7 @@ struct Lights {
};
typedef metal::depth2d_array<float, metal::access::sample> type4;
typedef metal::sampler type5;
typedef uint type6;
typedef metal::uint type6;
typedef float type7;
typedef metal::float2 type8;
typedef metal::float3 type9;

View File

@ -21,7 +21,7 @@ struct Data {
type2 proj_inv;
type2 view;
};
typedef uint type3;
typedef metal::uint type3;
typedef int type4;
typedef metal::float3x3 type5;
typedef metal::texturecube<float, metal::access::sample> type6;