Validate the exact MSL version (#1101)

This commit is contained in:
Dzmitry Malyshau
2021-07-16 23:56:15 -04:00
committed by GitHub
parent 337e40a2be
commit 8f71a368ef
21 changed files with 33 additions and 2 deletions

View File

@@ -35,7 +35,8 @@ validate-spv: $(SNAPSHOTS_BASE_OUT)/spv/*.spvasm
validate-msl: $(SNAPSHOTS_BASE_OUT)/msl/*.msl
@set -e && for file in $^ ; do \
echo "Validating" $${file#"$(SNAPSHOTS_BASE_OUT)/"}; \
cat $${file} | xcrun -sdk macosx metal -mmacosx-version-min=10.15 -x metal - -o /dev/null; \
header=$$(head -n1 $${file}); \
cat $${file} | xcrun -sdk macosx metal -mmacosx-version-min=10.11 -std=macos-$${header:13:8} -x metal - -o /dev/null; \
done
validate-glsl: $(SNAPSHOTS_BASE_OUT)/glsl/*.glsl

View File

@@ -189,7 +189,7 @@ pub struct Options {
impl Default for Options {
fn default() -> Self {
Options {
lang_version: (1, 0),
lang_version: (1, 1),
per_stage_map: PerStageMap::default(),
inline_samplers: Vec::new(),
spirv_cross_compatibility: false,

View File

@@ -1573,6 +1573,11 @@ impl<W: Write> Writer<W> {
.reset(module, super::keywords::RESERVED, &[], &mut self.names);
self.runtime_sized_buffers.clear();
writeln!(
self.out,
"// language: metal{}.{}",
options.lang_version.0, options.lang_version.1
)?;
writeln!(self.out, "#include <metal_stdlib>")?;
writeln!(self.out, "#include <simd/simd.h>")?;
writeln!(self.out)?;

View File

@@ -1,4 +1,12 @@
(
god_mode: true,
spv_version: (1, 0),
msl_custom: true,
msl: (
lang_version: (2, 2),
per_stage_map: (),
inline_samplers: [],
spirv_cross_compatibility: false,
fake_missing_bindings: false,
),
)

View File

@@ -1,3 +1,4 @@
// language: metal2.0
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal2.0
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal1.1
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal1.1
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal1.1
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal2.2
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal1.1
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal1.1
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal1.1
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal1.1
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal1.1
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal1.1
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal1.1
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal1.1
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal2.1
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal1.1
#include <metal_stdlib>
#include <simd/simd.h>

View File

@@ -1,3 +1,4 @@
// language: metal1.1
#include <metal_stdlib>
#include <simd/simd.h>