Skip to content

Commit

Permalink
[msl-out] remove min version check on storage address space
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy committed Sep 18, 2023
1 parent df8107b commit 3456b37
Show file tree
Hide file tree
Showing 45 changed files with 51 additions and 58 deletions.
4 changes: 1 addition & 3 deletions src/back/msl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ pub enum Error {
UnsupportedBuiltIn(crate::BuiltIn),
#[error("capability {0:?} is not supported")]
CapabilityNotSupported(crate::valid::Capabilities),
#[error("address space {0:?} is not supported for target MSL version")]
UnsupportedAddressSpace(crate::AddressSpace),
#[error("attribute '{0}' is not supported for target MSL version")]
UnsupportedAttribute(String),
}
Expand Down Expand Up @@ -197,7 +195,7 @@ pub struct Options {
impl Default for Options {
fn default() -> Self {
Options {
lang_version: (2, 0),
lang_version: (1, 0),
per_entry_point_map: EntryPointResourceMap::default(),
inline_samplers: Vec::new(),
spirv_cross_compatibility: false,
Expand Down
3 changes: 0 additions & 3 deletions src/back/msl/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3916,9 +3916,6 @@ impl<W: Write> Writer<W> {
let resolved = match var.space {
crate::AddressSpace::PushConstant => options.resolve_push_constants(ep).ok(),
crate::AddressSpace::WorkGroup => None,
crate::AddressSpace::Storage { .. } if options.lang_version < (2, 0) => {
return Err(Error::UnsupportedAddressSpace(var.space))
}
_ => options
.resolve_resource_binding(ep, var.binding.as_ref().unwrap())
.ok(),
Expand Down
2 changes: 1 addition & 1 deletion tests/in/access.param.ron
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
adjust_coordinate_space: false,
),
msl: (
lang_version: (2, 0),
lang_version: (1, 2),
per_entry_point_map: {
"foo_vert": (
resources: {
Expand Down
2 changes: 1 addition & 1 deletion tests/in/bitcast.params.ron
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(
msl: (
lang_version: (1, 2),
lang_version: (1, 0),
per_entry_point_map: {
"main": (
resources: {
Expand Down
2 changes: 1 addition & 1 deletion tests/in/boids.param.ron
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
adjust_coordinate_space: false,
),
msl: (
lang_version: (2, 0),
lang_version: (1, 0),
per_entry_point_map: {
"main": (
resources: {
Expand Down
18 changes: 8 additions & 10 deletions tests/in/dualsource.param.ron
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
(
god_mode: true,
vertex:[
],
fragment:[
(
entry_point:"main",
target_profile:"ps_5_1",
),
],
compute:[
],
msl: (
lang_version: (1, 2),
per_entry_point_map: {},
inline_samplers: [],
spirv_cross_compatibility: false,
fake_missing_bindings: false,
zero_initialize_workgroup_memory: true,
),
)
2 changes: 1 addition & 1 deletion tests/in/padding.param.ron
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
adjust_coordinate_space: false,
),
msl: (
lang_version: (2, 0),
lang_version: (1, 0),
per_entry_point_map: {
"vertex": (
resources: {
Expand Down
2 changes: 1 addition & 1 deletion tests/in/resource-binding-map.param.ron
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(
god_mode: true,
msl: (
lang_version: (2, 0),
lang_version: (1, 0),
per_entry_point_map: {
"entry_point_one": (
resources: {
Expand Down
2 changes: 1 addition & 1 deletion tests/in/workgroup-var-init.param.ron
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
adjust_coordinate_space: false,
),
msl: (
lang_version: (2, 0),
lang_version: (1, 0),
per_entry_point_map: {
"main": (
resources: {
Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/access.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.2
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/array-in-ctor.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/array-in-function-return-type.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/atomicOps.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/bitcast.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/boids.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/bounds-check-image-restrict.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/bounds-check-image-rzsw.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/bounds-check-restrict.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/bounds-check-zero-atomic.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/bounds-check-zero.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/break-if.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/collatz.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/constructors.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/control-flow.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/do-while.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/dualsource.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.2
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/empty-global-name.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/empty.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/fragment-output.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/functions.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/globals.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/image.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/interpolate.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/math-functions.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/operators.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/padding.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/policy-mix.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/quad-vert.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/quad.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/resource-binding-map.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/shadow.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/standard.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/texture-arg.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/workgroup-uniform-load.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down
2 changes: 1 addition & 1 deletion tests/out/msl/workgroup-var-init.msl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// language: metal2.0
// language: metal1.0
#include <metal_stdlib>
#include <simd/simd.h>

Expand Down

0 comments on commit 3456b37

Please sign in to comment.