diff --git a/Cargo.lock b/Cargo.lock index 5e2422cc54..89fccee596 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2353,6 +2353,7 @@ dependencies = [ "strum 0.26.3", "termcolor", "thiserror 2.0.11", + "toml", "unicode-ident", "walkdir", ] diff --git a/naga/Cargo.toml b/naga/Cargo.toml index e0f609e787..e4503ac027 100644 --- a/naga/Cargo.toml +++ b/naga/Cargo.toml @@ -118,4 +118,5 @@ ron = "0.8.0" rspirv = { version = "0.11", git = "https://github.com/gfx-rs/rspirv", rev = "b969f175d5663258b4891e44b76c1544da9661ab" } serde = { workspace = true, features = ["default", "derive"] } spirv = { version = "0.3", features = ["deserialize"] } +toml = "0.8" walkdir.workspace = true diff --git a/naga/src/back/glsl/mod.rs b/naga/src/back/glsl/mod.rs index 0798fac82d..9b0a8096ac 100644 --- a/naga/src/back/glsl/mod.rs +++ b/naga/src/back/glsl/mod.rs @@ -79,6 +79,28 @@ pub(crate) const FREXP_FUNCTION: &str = "naga_frexp"; // Must match code in glsl_built_in pub const FIRST_INSTANCE_BINDING: &str = "naga_vs_first_instance"; +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +struct BindingMapSerialization { + resource_binding: crate::ResourceBinding, + bind_target: u8, +} + +#[cfg(feature = "deserialize")] +fn deserialize_binding_map<'de, D>(deserializer: D) -> Result +where + D: serde::Deserializer<'de>, +{ + use serde::Deserialize; + + let vec = Vec::::deserialize(deserializer)?; + let mut map = BindingMap::default(); + for item in vec { + map.insert(item.resource_binding, item.bind_target); + } + Ok(map) +} + /// Mapping between resources and bindings. pub type BindingMap = std::collections::BTreeMap; @@ -266,6 +288,10 @@ pub struct Options { /// Configuration flags for the [`Writer`]. pub writer_flags: WriterFlags, /// Map of resources association to binding locations. + #[cfg_attr( + feature = "deserialize", + serde(deserialize_with = "deserialize_binding_map") + )] pub binding_map: BindingMap, /// Should workgroup variables be zero initialized (by polyfilling)? pub zero_initialize_workgroup_memory: bool, diff --git a/naga/src/back/hlsl/mod.rs b/naga/src/back/hlsl/mod.rs index e5361393b3..ceebad56a3 100644 --- a/naga/src/back/hlsl/mod.rs +++ b/naga/src/back/hlsl/mod.rs @@ -149,6 +149,28 @@ pub struct OffsetsBindTarget { pub size: u32, } +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +struct BindingMapSerialization { + resource_binding: crate::ResourceBinding, + bind_target: BindTarget, +} + +#[cfg(feature = "deserialize")] +fn deserialize_binding_map<'de, D>(deserializer: D) -> Result +where + D: serde::Deserializer<'de>, +{ + use serde::Deserialize; + + let vec = Vec::::deserialize(deserializer)?; + let mut map = BindingMap::default(); + for item in vec { + map.insert(item.resource_binding, item.bind_target); + } + Ok(map) +} + // Using `BTreeMap` instead of `HashMap` so that we can hash itself. pub type BindingMap = std::collections::BTreeMap; @@ -245,10 +267,63 @@ impl Default for SamplerHeapBindTargets { } } +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +struct SamplerIndexBufferBindingSerialization { + group: u32, + bind_target: BindTarget, +} + +#[cfg(feature = "deserialize")] +fn deserialize_sampler_index_buffer_bindings<'de, D>( + deserializer: D, +) -> Result +where + D: serde::Deserializer<'de>, +{ + use serde::Deserialize; + + let vec = Vec::::deserialize(deserializer)?; + let mut map = SamplerIndexBufferBindingMap::default(); + for item in vec { + map.insert( + SamplerIndexBufferKey { group: item.group }, + item.bind_target, + ); + } + Ok(map) +} + // We use a BTreeMap here so that we can hash it. pub type SamplerIndexBufferBindingMap = std::collections::BTreeMap; +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +struct DynamicStorageBufferOffsetTargetSerialization { + index: u32, + bind_target: OffsetsBindTarget, +} + +#[cfg(feature = "deserialize")] +fn deserialize_storage_buffer_offsets<'de, D>( + deserializer: D, +) -> Result +where + D: serde::Deserializer<'de>, +{ + use serde::Deserialize; + + let vec = Vec::::deserialize(deserializer)?; + let mut map = DynamicStorageBufferOffsetsTargets::default(); + for item in vec { + map.insert(item.index, item.bind_target); + } + Ok(map) +} + +pub type DynamicStorageBufferOffsetsTargets = std::collections::BTreeMap; + /// Shorthand result used internally by the backend type BackendResult = Result<(), Error>; @@ -269,6 +344,10 @@ pub struct Options { /// The hlsl shader model to be used pub shader_model: ShaderModel, /// Map of resources association to binding locations. + #[cfg_attr( + feature = "deserialize", + serde(deserialize_with = "deserialize_binding_map") + )] pub binding_map: BindingMap, /// Don't panic on missing bindings, instead generate any HLSL. pub fake_missing_bindings: bool, @@ -280,9 +359,17 @@ pub struct Options { /// Bind target of the sampler heap and comparison sampler heap. pub sampler_heap_target: SamplerHeapBindTargets, /// Mapping of each bind group's sampler index buffer to a bind target. + #[cfg_attr( + feature = "deserialize", + serde(deserialize_with = "deserialize_sampler_index_buffer_bindings") + )] pub sampler_buffer_binding_map: SamplerIndexBufferBindingMap, /// Bind target for dynamic storage buffer offsets - pub dynamic_storage_buffer_offsets_targets: std::collections::BTreeMap, + #[cfg_attr( + feature = "deserialize", + serde(deserialize_with = "deserialize_storage_buffer_offsets") + )] + pub dynamic_storage_buffer_offsets_targets: DynamicStorageBufferOffsetsTargets, /// Should workgroup variables be zero initialized (by polyfilling)? pub zero_initialize_workgroup_memory: bool, /// Should we restrict indexing of vectors, matrices and arrays? diff --git a/naga/src/back/msl/mod.rs b/naga/src/back/msl/mod.rs index be94b26742..b9e24454e9 100644 --- a/naga/src/back/msl/mod.rs +++ b/naga/src/back/msl/mod.rs @@ -62,6 +62,28 @@ pub struct BindTarget { pub mutable: bool, } +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +struct BindingMapSerialization { + resource_binding: crate::ResourceBinding, + bind_target: BindTarget, +} + +#[cfg(feature = "deserialize")] +fn deserialize_binding_map<'de, D>(deserializer: D) -> Result +where + D: serde::Deserializer<'de>, +{ + use serde::Deserialize; + + let vec = Vec::::deserialize(deserializer)?; + let mut map = BindingMap::default(); + for item in vec { + map.insert(item.resource_binding, item.bind_target); + } + Ok(map) +} + // Using `BTreeMap` instead of `HashMap` so that we can hash itself. pub type BindingMap = std::collections::BTreeMap; @@ -70,6 +92,10 @@ pub type BindingMap = std::collections::BTreeMap, diff --git a/naga/tests/in/6220-break-from-loop.param.ron b/naga/tests/in/6220-break-from-loop.param.ron deleted file mode 100644 index 52740817bd..0000000000 --- a/naga/tests/in/6220-break-from-loop.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV", -) diff --git a/naga/tests/in/6220-break-from-loop.toml b/naga/tests/in/6220-break-from-loop.toml new file mode 100644 index 0000000000..4883dbbd8d --- /dev/null +++ b/naga/tests/in/6220-break-from-loop.toml @@ -0,0 +1 @@ +targets = "SPIRV" diff --git a/naga/tests/in/6438-conflicting-idents.param.ron b/naga/tests/in/6438-conflicting-idents.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/6438-conflicting-idents.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/6438-conflicting-idents.toml b/naga/tests/in/6438-conflicting-idents.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/6438-conflicting-idents.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/6772-unpack-expr-accesses.param.ron b/naga/tests/in/6772-unpack-expr-accesses.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/6772-unpack-expr-accesses.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/6772-unpack-expr-accesses.toml b/naga/tests/in/6772-unpack-expr-accesses.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/6772-unpack-expr-accesses.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/abstract-types-const.param.ron b/naga/tests/in/abstract-types-const.param.ron deleted file mode 100644 index 41ae91e18f..0000000000 --- a/naga/tests/in/abstract-types-const.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | WGSL", -) diff --git a/naga/tests/in/abstract-types-const.toml b/naga/tests/in/abstract-types-const.toml new file mode 100644 index 0000000000..881b2333f9 --- /dev/null +++ b/naga/tests/in/abstract-types-const.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | WGSL" diff --git a/naga/tests/in/abstract-types-function-calls.param.ron b/naga/tests/in/abstract-types-function-calls.param.ron deleted file mode 100644 index 41ae91e18f..0000000000 --- a/naga/tests/in/abstract-types-function-calls.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | WGSL", -) diff --git a/naga/tests/in/abstract-types-function-calls.toml b/naga/tests/in/abstract-types-function-calls.toml new file mode 100644 index 0000000000..881b2333f9 --- /dev/null +++ b/naga/tests/in/abstract-types-function-calls.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | WGSL" diff --git a/naga/tests/in/abstract-types-operators.param.ron b/naga/tests/in/abstract-types-operators.param.ron deleted file mode 100644 index 41ae91e18f..0000000000 --- a/naga/tests/in/abstract-types-operators.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | WGSL", -) diff --git a/naga/tests/in/abstract-types-operators.toml b/naga/tests/in/abstract-types-operators.toml new file mode 100644 index 0000000000..881b2333f9 --- /dev/null +++ b/naga/tests/in/abstract-types-operators.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | WGSL" diff --git a/naga/tests/in/abstract-types-return.param.ron b/naga/tests/in/abstract-types-return.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/abstract-types-return.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/abstract-types-return.toml b/naga/tests/in/abstract-types-return.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/abstract-types-return.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/abstract-types-var.param.ron b/naga/tests/in/abstract-types-var.param.ron deleted file mode 100644 index 41ae91e18f..0000000000 --- a/naga/tests/in/abstract-types-var.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | WGSL", -) diff --git a/naga/tests/in/abstract-types-var.toml b/naga/tests/in/abstract-types-var.toml new file mode 100644 index 0000000000..881b2333f9 --- /dev/null +++ b/naga/tests/in/abstract-types-var.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | WGSL" diff --git a/naga/tests/in/access.param.ron b/naga/tests/in/access.param.ron deleted file mode 100644 index e24f9a88f5..0000000000 --- a/naga/tests/in/access.param.ron +++ /dev/null @@ -1,39 +0,0 @@ -( - spv: ( - version: (1, 1), - debug: true, - adjust_coordinate_space: false, - ), - msl: ( - lang_version: (1, 2), - per_entry_point_map: { - "foo_vert": ( - resources: { - (group: 0, binding: 0): (buffer: Some(0), mutable: false), - (group: 0, binding: 1): (buffer: Some(1), mutable: false), - (group: 0, binding: 2): (buffer: Some(2), mutable: false), - (group: 0, binding: 3): (buffer: Some(3), mutable: false), - }, - sizes_buffer: Some(24), - ), - "foo_frag": ( - resources: { - (group: 0, binding: 0): (buffer: Some(0), mutable: true), - (group: 0, binding: 2): (buffer: Some(2), mutable: true), - }, - sizes_buffer: Some(24), - ), - "atomics": ( - resources: { - (group: 0, binding: 0): (buffer: Some(0), mutable: true), - }, - sizes_buffer: Some(24), - ), - }, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: false, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | GLSL | HLSL | WGSL | IR | ANALYSIS", -) diff --git a/naga/tests/in/access.toml b/naga/tests/in/access.toml new file mode 100644 index 0000000000..09a09db1b3 --- /dev/null +++ b/naga/tests/in/access.toml @@ -0,0 +1,34 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL | IR | ANALYSIS" + +[msl] +fake_missing_bindings = false +lang_version = [1, 2] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[msl.per_entry_point_map.atomics] +resources = [ + { bind_target = { buffer = 0, mutable = true }, resource_binding = { group = 0, binding = 0 } }, +] +sizes_buffer = 24 + +[msl.per_entry_point_map.foo_frag] +resources = [ + { bind_target = { buffer = 0, mutable = true }, resource_binding = { group = 0, binding = 0 } }, + { bind_target = { buffer = 2, mutable = true }, resource_binding = { group = 0, binding = 2 } }, +] +sizes_buffer = 24 + +[msl.per_entry_point_map.foo_vert] +resources = [ + { bind_target = { buffer = 0, mutable = false }, resource_binding = { group = 0, binding = 0 } }, + { bind_target = { buffer = 1, mutable = false }, resource_binding = { group = 0, binding = 1 } }, + { bind_target = { buffer = 2, mutable = false }, resource_binding = { group = 0, binding = 2 } }, + { bind_target = { buffer = 3, mutable = false }, resource_binding = { group = 0, binding = 3 } }, +] +sizes_buffer = 24 + +[spv] +adjust_coordinate_space = false +debug = true +version = [1, 1] diff --git a/naga/tests/in/array-in-ctor.param.ron b/naga/tests/in/array-in-ctor.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/array-in-ctor.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/array-in-ctor.toml b/naga/tests/in/array-in-ctor.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/array-in-ctor.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/array-in-function-return-type.param.ron b/naga/tests/in/array-in-function-return-type.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/array-in-function-return-type.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/array-in-function-return-type.toml b/naga/tests/in/array-in-function-return-type.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/array-in-function-return-type.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/atomicCompareExchange-int64.param.ron b/naga/tests/in/atomicCompareExchange-int64.param.ron deleted file mode 100644 index b72ad400e8..0000000000 --- a/naga/tests/in/atomicCompareExchange-int64.param.ron +++ /dev/null @@ -1,17 +0,0 @@ -( - god_mode: true, - spv: ( - version: (1, 0), - capabilities: [ Int64, Int64Atomics ], - ), - hlsl: ( - shader_model: V6_6, - binding_map: {}, - fake_missing_bindings: true, - special_constants_binding: Some((space: 1, register: 0)), - push_constants_target: Some((space: 0, register: 0)), - zero_initialize_workgroup_memory: true, - restrict_indexing: true - ), - targets: "SPIRV | WGSL", -) diff --git a/naga/tests/in/atomicCompareExchange-int64.toml b/naga/tests/in/atomicCompareExchange-int64.toml new file mode 100644 index 0000000000..6107dfc559 --- /dev/null +++ b/naga/tests/in/atomicCompareExchange-int64.toml @@ -0,0 +1,12 @@ +god_mode = true +targets = "SPIRV | WGSL" + +[hlsl] +fake_missing_bindings = true +push_constants_target = { register = 0, space = 0 } +restrict_indexing = true +special_constants_binding = { register = 0, space = 1 } +zero_initialize_workgroup_memory = true + +[spv] +version = [1, 0] diff --git a/naga/tests/in/atomicCompareExchange.param.ron b/naga/tests/in/atomicCompareExchange.param.ron deleted file mode 100644 index 4fe29b74ac..0000000000 --- a/naga/tests/in/atomicCompareExchange.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | WGSL", -) diff --git a/naga/tests/in/atomicCompareExchange.toml b/naga/tests/in/atomicCompareExchange.toml new file mode 100644 index 0000000000..7d87498324 --- /dev/null +++ b/naga/tests/in/atomicCompareExchange.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | WGSL" diff --git a/naga/tests/in/atomicOps-float32.param.ron b/naga/tests/in/atomicOps-float32.param.ron deleted file mode 100644 index e8e3380f0d..0000000000 --- a/naga/tests/in/atomicOps-float32.param.ron +++ /dev/null @@ -1,16 +0,0 @@ -( - god_mode: true, - spv: ( - version: (1, 1), - capabilities: [ AtomicFloat32AddEXT ], - ), - msl: ( - lang_version: (3, 0), - per_entry_point_map: {}, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: true, - zero_initialize_workgroup_memory: false, - ), - targets: "SPIRV | METAL | WGSL", -) diff --git a/naga/tests/in/atomicOps-float32.toml b/naga/tests/in/atomicOps-float32.toml new file mode 100644 index 0000000000..d80cf29a46 --- /dev/null +++ b/naga/tests/in/atomicOps-float32.toml @@ -0,0 +1,10 @@ +god_mode = true +targets = "SPIRV | METAL | WGSL" + +[msl] +fake_missing_bindings = true +lang_version = [3, 0] +zero_initialize_workgroup_memory = false + +[spv] +version = [1, 1] diff --git a/naga/tests/in/atomicOps-int64-min-max.param.ron b/naga/tests/in/atomicOps-int64-min-max.param.ron deleted file mode 100644 index 41a3eb9929..0000000000 --- a/naga/tests/in/atomicOps-int64-min-max.param.ron +++ /dev/null @@ -1,25 +0,0 @@ -( - god_mode: true, - spv: ( - version: (1, 0), - capabilities: [ Int64, Int64Atomics ], - ), - hlsl: ( - shader_model: V6_6, - binding_map: {}, - fake_missing_bindings: true, - special_constants_binding: Some((space: 1, register: 0)), - push_constants_target: Some((space: 0, register: 0)), - zero_initialize_workgroup_memory: true, - restrict_indexing: true - ), - msl: ( - lang_version: (2, 4), - per_entry_point_map: {}, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: true, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | HLSL | WGSL", -) diff --git a/naga/tests/in/atomicOps-int64-min-max.toml b/naga/tests/in/atomicOps-int64-min-max.toml new file mode 100644 index 0000000000..b159688b8c --- /dev/null +++ b/naga/tests/in/atomicOps-int64-min-max.toml @@ -0,0 +1,19 @@ +god_mode = true +targets = "SPIRV | METAL | HLSL | WGSL" + +[msl] +fake_missing_bindings = true +lang_version = [2, 4] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[hlsl] +shader_model = "V6_6" +fake_missing_bindings = true +push_constants_target = { register = 0, space = 0 } +restrict_indexing = true +special_constants_binding = { register = 0, space = 1 } +zero_initialize_workgroup_memory = true + +[spv] +version = [1, 0] diff --git a/naga/tests/in/atomicOps-int64.param.ron b/naga/tests/in/atomicOps-int64.param.ron deleted file mode 100644 index a310394076..0000000000 --- a/naga/tests/in/atomicOps-int64.param.ron +++ /dev/null @@ -1,17 +0,0 @@ -( - god_mode: true, - spv: ( - version: (1, 0), - capabilities: [ Int64, Int64Atomics ], - ), - hlsl: ( - shader_model: V6_6, - binding_map: {}, - fake_missing_bindings: true, - special_constants_binding: Some((space: 1, register: 0)), - push_constants_target: Some((space: 0, register: 0)), - zero_initialize_workgroup_memory: true, - restrict_indexing: true - ), - targets: "SPIRV | HLSL | WGSL", -) diff --git a/naga/tests/in/atomicOps-int64.toml b/naga/tests/in/atomicOps-int64.toml new file mode 100644 index 0000000000..99227637f3 --- /dev/null +++ b/naga/tests/in/atomicOps-int64.toml @@ -0,0 +1,13 @@ +god_mode = true +targets = "SPIRV | HLSL | WGSL" + +[hlsl] +shader_model = "V6_6" +fake_missing_bindings = true +push_constants_target = { register = 0, space = 0 } +restrict_indexing = true +special_constants_binding = { register = 0, space = 1 } +zero_initialize_workgroup_memory = true + +[spv] +version = [1, 0] diff --git a/naga/tests/in/atomicOps.param.ron b/naga/tests/in/atomicOps.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/atomicOps.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/atomicOps.toml b/naga/tests/in/atomicOps.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/atomicOps.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/atomicTexture-int64.param.ron b/naga/tests/in/atomicTexture-int64.param.ron deleted file mode 100644 index 283227c7a0..0000000000 --- a/naga/tests/in/atomicTexture-int64.param.ron +++ /dev/null @@ -1,25 +0,0 @@ -( - god_mode: true, - spv: ( - version: (1, 0), - capabilities: [ Int64, Int64ImageEXT, Int64Atomics ], - ), - hlsl: ( - shader_model: V6_6, - binding_map: {}, - fake_missing_bindings: true, - special_constants_binding: Some((space: 1, register: 0)), - push_constants_target: Some((space: 0, register: 0)), - zero_initialize_workgroup_memory: true, - restrict_indexing: true - ), - msl: ( - lang_version: (3, 1), - per_entry_point_map: {}, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: true, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | HLSL | WGSL", -) diff --git a/naga/tests/in/atomicTexture-int64.toml b/naga/tests/in/atomicTexture-int64.toml new file mode 100644 index 0000000000..ce58f7e7ea --- /dev/null +++ b/naga/tests/in/atomicTexture-int64.toml @@ -0,0 +1,19 @@ +god_mode = true +targets = "SPIRV | METAL | HLSL | WGSL" + +[msl] +fake_missing_bindings = true +lang_version = [3, 1] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[hlsl] +shader_model = "V6_6" +fake_missing_bindings = true +push_constants_target = { register = 0, space = 0 } +restrict_indexing = true +special_constants_binding = { register = 0, space = 1 } +zero_initialize_workgroup_memory = true + +[spv] +version = [1, 0] diff --git a/naga/tests/in/atomicTexture.param.ron b/naga/tests/in/atomicTexture.param.ron deleted file mode 100644 index 295a34cc79..0000000000 --- a/naga/tests/in/atomicTexture.param.ron +++ /dev/null @@ -1,31 +0,0 @@ -( - god_mode: true, - spv: ( - version: (1, 0), - capabilities: [], - ), - hlsl: ( - shader_model: V5_1, - binding_map: {}, - fake_missing_bindings: true, - special_constants_binding: Some((space: 1, register: 0)), - push_constants_target: Some((space: 0, register: 0)), - zero_initialize_workgroup_memory: true, - restrict_indexing: true - ), - msl: ( - lang_version: (3, 1), - per_entry_point_map: {}, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: true, - zero_initialize_workgroup_memory: true, - ), - glsl: ( - version: Desktop(420), - writer_flags: (""), - binding_map: {}, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/atomicTexture.toml b/naga/tests/in/atomicTexture.toml new file mode 100644 index 0000000000..598809e675 --- /dev/null +++ b/naga/tests/in/atomicTexture.toml @@ -0,0 +1,22 @@ +god_mode = true +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" + +[msl] +fake_missing_bindings = true +lang_version = [3, 1] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[hlsl] +fake_missing_bindings = true +push_constants_target = { register = 0, space = 0 } +restrict_indexing = true +special_constants_binding = { register = 0, space = 1 } +zero_initialize_workgroup_memory = true + +[glsl] +version.Desktop = 420 +zero_initialize_workgroup_memory = true + +[spv] +version = [1, 0] diff --git a/naga/tests/in/binding-arrays.param.ron b/naga/tests/in/binding-arrays.param.ron deleted file mode 100644 index 7a7aa6896e..0000000000 --- a/naga/tests/in/binding-arrays.param.ron +++ /dev/null @@ -1,48 +0,0 @@ -( - god_mode: true, - hlsl: ( - shader_model: V5_1, - binding_map: { - (group: 0, binding: 0): (space: 0, register: 0, binding_array_size: Some(10)), - (group: 0, binding: 1): (space: 1, register: 0), - (group: 0, binding: 2): (space: 2, register: 0), - (group: 0, binding: 3): (space: 3, register: 0), - (group: 0, binding: 4): (space: 4, register: 0), - (group: 0, binding: 5): (space: 5, register: 0), - (group: 0, binding: 6): (space: 6, register: 0), - (group: 0, binding: 7): (space: 7, register: 0), - (group: 0, binding: 8): (space: 8, register: 0), - }, - fake_missing_bindings: true, - special_constants_binding: None, - zero_initialize_workgroup_memory: true, - restrict_indexing: true - ), - msl: ( - lang_version: (3, 0), - per_entry_point_map: { - "main": ( - resources: { - (group: 0, binding: 0): (buffer: Some(0), binding_array_size: Some(10), mutable: false), - }, - sizes_buffer: None, - ) - }, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: true, - zero_initialize_workgroup_memory: true, - ), - spv: ( - version: (1, 1), - binding_map: { - (group: 0, binding: 0): (binding_array_size: Some(10)), - }, - ), - bounds_check_policies: ( - index: ReadZeroSkipWrite, - buffer: ReadZeroSkipWrite, - image_load: ReadZeroSkipWrite, - ), - targets: "WGSL | HLSL | METAL | SPIRV", -) diff --git a/naga/tests/in/binding-arrays.toml b/naga/tests/in/binding-arrays.toml new file mode 100644 index 0000000000..27c1506417 --- /dev/null +++ b/naga/tests/in/binding-arrays.toml @@ -0,0 +1,66 @@ +god_mode = true +targets = "WGSL | HLSL | METAL | SPIRV" + +[bounds_check_policies] +index = "ReadZeroSkipWrite" +buffer = "ReadZeroSkipWrite" +image_load = "ReadZeroSkipWrite" + +[msl] +fake_missing_bindings = true +lang_version = [3, 0] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[msl.per_entry_point_map.main] +resources = [ + { bind_target = { binding_array_size = 10, buffer = 0, mutable = false }, resource_binding = { group = 0, binding = 0 } }, +] + +[hlsl] +fake_missing_bindings = true +restrict_indexing = true +zero_initialize_workgroup_memory = true + +[[hlsl.binding_map]] +bind_target = { binding_array_size = 10, register = 0, space = 0 } +resource_binding = { group = 0, binding = 0 } + +[[hlsl.binding_map]] +bind_target = { register = 0, space = 1 } +resource_binding = { group = 0, binding = 1 } + +[[hlsl.binding_map]] +bind_target = { register = 0, space = 2 } +resource_binding = { group = 0, binding = 2 } + +[[hlsl.binding_map]] +bind_target = { register = 0, space = 3 } +resource_binding = { group = 0, binding = 3 } + +[[hlsl.binding_map]] +bind_target = { register = 0, space = 4 } +resource_binding = { group = 0, binding = 4 } + +[[hlsl.binding_map]] +bind_target = { register = 0, space = 5 } +resource_binding = { group = 0, binding = 5 } + +[[hlsl.binding_map]] +bind_target = { register = 0, space = 6 } +resource_binding = { group = 0, binding = 6 } + +[[hlsl.binding_map]] +bind_target = { register = 0, space = 7 } +resource_binding = { group = 0, binding = 7 } + +[[hlsl.binding_map]] +bind_target = { register = 0, space = 8 } +resource_binding = { group = 0, binding = 8 } + +[spv] +version = [1, 1] + +[[spv.binding_map]] +bind_target = { binding_array_size = 10 } +resource_binding = { group = 0, binding = 0 } diff --git a/naga/tests/in/binding-buffer-arrays.param.ron b/naga/tests/in/binding-buffer-arrays.param.ron deleted file mode 100644 index cf424fb458..0000000000 --- a/naga/tests/in/binding-buffer-arrays.param.ron +++ /dev/null @@ -1,16 +0,0 @@ -( - god_mode: false, - spv: ( - version: (1, 1), - binding_map: { - (group: 0, binding: 0): (binding_array_size: Some(10)), - }, - ), - bounds_check_policies: ( - index: ReadZeroSkipWrite, - buffer: ReadZeroSkipWrite, - image: ReadZeroSkipWrite, - ), - //TODO: more backends, eventually merge into "binding-arrays" - targets: "WGSL | SPIRV", -) diff --git a/naga/tests/in/binding-buffer-arrays.toml b/naga/tests/in/binding-buffer-arrays.toml new file mode 100644 index 0000000000..be1b09cf10 --- /dev/null +++ b/naga/tests/in/binding-buffer-arrays.toml @@ -0,0 +1,13 @@ +targets = "WGSL | SPIRV" + +[bounds_check_policies] +index = "ReadZeroSkipWrite" +buffer = "ReadZeroSkipWrite" +image = "ReadZeroSkipWrite" + +[spv] +version = [1, 1] + +[[spv.binding_map]] +bind_target = { binding_array_size = 10 } +resource_binding = { group = 0, binding = 0 } diff --git a/naga/tests/in/bitcast.param.ron b/naga/tests/in/bitcast.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/bitcast.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/bitcast.toml b/naga/tests/in/bitcast.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/bitcast.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/bits.param.ron b/naga/tests/in/bits.param.ron deleted file mode 100644 index 1604756a35..0000000000 --- a/naga/tests/in/bits.param.ron +++ /dev/null @@ -1,17 +0,0 @@ -( - msl: ( - lang_version: (1, 2), - per_entry_point_map: { - "main": ( - resources: { - }, - sizes_buffer: Some(0), - ) - }, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: false, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/bits.toml b/naga/tests/in/bits.toml new file mode 100644 index 0000000000..70460843f6 --- /dev/null +++ b/naga/tests/in/bits.toml @@ -0,0 +1,11 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" + +[msl] +fake_missing_bindings = false +lang_version = [1, 2] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[msl.per_entry_point_map.main] +resources = [] +sizes_buffer = 0 diff --git a/naga/tests/in/boids.param.ron b/naga/tests/in/boids.param.ron deleted file mode 100644 index aec8e06859..0000000000 --- a/naga/tests/in/boids.param.ron +++ /dev/null @@ -1,25 +0,0 @@ -( - spv: ( - version: (1, 0), - debug: true, - adjust_coordinate_space: false, - ), - msl: ( - lang_version: (1, 0), - per_entry_point_map: { - "main": ( - resources: { - (group: 0, binding: 0): (buffer: Some(0), mutable: false), - (group: 0, binding: 1): (buffer: Some(1), mutable: true), - (group: 0, binding: 2): (buffer: Some(2), mutable: true), - }, - sizes_buffer: Some(3), - ) - }, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: false, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/boids.toml b/naga/tests/in/boids.toml new file mode 100644 index 0000000000..f1a40fba2e --- /dev/null +++ b/naga/tests/in/boids.toml @@ -0,0 +1,20 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" + +[msl] +fake_missing_bindings = false +lang_version = [1, 0] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[msl.per_entry_point_map.main] +resources = [ + { bind_target = { buffer = 0, mutable = false }, resource_binding = { group = 0, binding = 0 } }, + { bind_target = { buffer = 1, mutable = true }, resource_binding = { group = 0, binding = 1 } }, + { bind_target = { buffer = 2, mutable = true }, resource_binding = { group = 0, binding = 2 } }, +] +sizes_buffer = 3 + +[spv] +adjust_coordinate_space = false +debug = true +version = [1, 0] diff --git a/naga/tests/in/bounds-check-dynamic-buffer.param.ron b/naga/tests/in/bounds-check-dynamic-buffer.param.ron deleted file mode 100644 index ea393bbb22..0000000000 --- a/naga/tests/in/bounds-check-dynamic-buffer.param.ron +++ /dev/null @@ -1,18 +0,0 @@ -( - hlsl: ( - binding_map: { - (group: 0, binding: 0): (space: 0, register: 0), - (group: 0, binding: 1): (space: 0, register: 1), - (group: 0, binding: 2): (space: 0, register: 0, restrict_indexing: true), - (group: 0, binding: 3): (space: 0, register: 2, dynamic_storage_buffer_offsets_index: Some(0)), - (group: 0, binding: 4): (space: 0, register: 3, dynamic_storage_buffer_offsets_index: Some(1)), - (group: 1, binding: 0): (space: 0, register: 4, dynamic_storage_buffer_offsets_index: Some(0)), - }, - dynamic_storage_buffer_offsets_targets: { - 0: (space: 0, register: 1, size: 2), - 1: (space: 0, register: 2, size: 1), - }, - restrict_indexing: true - ), - targets: "HLSL", -) diff --git a/naga/tests/in/bounds-check-dynamic-buffer.toml b/naga/tests/in/bounds-check-dynamic-buffer.toml new file mode 100644 index 0000000000..0233b9ebd0 --- /dev/null +++ b/naga/tests/in/bounds-check-dynamic-buffer.toml @@ -0,0 +1,32 @@ +targets = "HLSL" + +[hlsl] +restrict_indexing = true +dynamic_storage_buffer_offsets_targets = [ + { index = 0, bind_target = { register = 1, size = 2, space = 0 } }, + { index = 1, bind_target = { register = 2, size = 1, space = 0 } }, +] + +[[hlsl.binding_map]] +bind_target = { register = 0, space = 0 } +resource_binding = { group = 0, binding = 0 } + +[[hlsl.binding_map]] +bind_target = { dynamic_storage_buffer_offsets_index = 0, register = 4, space = 0 } +resource_binding = { group = 1, binding = 0 } + +[[hlsl.binding_map]] +bind_target = { register = 1, space = 0 } +resource_binding = { group = 0, binding = 1 } + +[[hlsl.binding_map]] +bind_target = { register = 0, restrict_indexing = true, space = 0 } +resource_binding = { group = 0, binding = 2 } + +[[hlsl.binding_map]] +bind_target = { dynamic_storage_buffer_offsets_index = 0, register = 2, space = 0 } +resource_binding = { group = 0, binding = 3 } + +[[hlsl.binding_map]] +bind_target = { dynamic_storage_buffer_offsets_index = 1, register = 3, space = 0 } +resource_binding = { group = 0, binding = 4 } diff --git a/naga/tests/in/bounds-check-image-restrict.param.ron b/naga/tests/in/bounds-check-image-restrict.param.ron deleted file mode 100644 index 5cebe6343c..0000000000 --- a/naga/tests/in/bounds-check-image-restrict.param.ron +++ /dev/null @@ -1,24 +0,0 @@ -( - bounds_check_policies: ( - image_load: Restrict, - ), - spv: ( - version: (1, 1), - debug: true, - ), - glsl: ( - version: Desktop(430), - writer_flags: (""), - binding_map: { }, - zero_initialize_workgroup_memory: true, - ), - msl: ( - lang_version: (1, 2), - per_entry_point_map: {}, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: true, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | GLSL", -) diff --git a/naga/tests/in/bounds-check-image-restrict.toml b/naga/tests/in/bounds-check-image-restrict.toml new file mode 100644 index 0000000000..40f580844c --- /dev/null +++ b/naga/tests/in/bounds-check-image-restrict.toml @@ -0,0 +1,18 @@ +targets = "SPIRV | METAL | GLSL" + +[bounds_check_policies] +image_load = "Restrict" + +[msl] +fake_missing_bindings = true +lang_version = [1, 2] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[glsl] +version.Desktop = 430 +zero_initialize_workgroup_memory = true + +[spv] +debug = true +version = [1, 1] diff --git a/naga/tests/in/bounds-check-image-rzsw.param.ron b/naga/tests/in/bounds-check-image-rzsw.param.ron deleted file mode 100644 index fbf7998a7b..0000000000 --- a/naga/tests/in/bounds-check-image-rzsw.param.ron +++ /dev/null @@ -1,24 +0,0 @@ -( - bounds_check_policies: ( - image_load: ReadZeroSkipWrite, - ), - spv: ( - version: (1, 1), - debug: true, - ), - glsl: ( - version: Desktop(430), - writer_flags: (""), - binding_map: { }, - zero_initialize_workgroup_memory: true, - ), - msl: ( - lang_version: (1, 2), - per_entry_point_map: {}, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: true, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | GLSL", -) diff --git a/naga/tests/in/bounds-check-image-rzsw.toml b/naga/tests/in/bounds-check-image-rzsw.toml new file mode 100644 index 0000000000..5ba267bccf --- /dev/null +++ b/naga/tests/in/bounds-check-image-rzsw.toml @@ -0,0 +1,18 @@ +targets = "SPIRV | METAL | GLSL" + +[bounds_check_policies] +image_load = "ReadZeroSkipWrite" + +[msl] +fake_missing_bindings = true +lang_version = [1, 2] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[glsl] +version.Desktop = 430 +zero_initialize_workgroup_memory = true + +[spv] +debug = true +version = [1, 1] diff --git a/naga/tests/in/bounds-check-restrict.param.ron b/naga/tests/in/bounds-check-restrict.param.ron deleted file mode 100644 index 36e9e53768..0000000000 --- a/naga/tests/in/bounds-check-restrict.param.ron +++ /dev/null @@ -1,7 +0,0 @@ -( - bounds_check_policies: ( - index: Restrict, - buffer: Restrict, - ), - targets: "SPIRV | METAL", -) diff --git a/naga/tests/in/bounds-check-restrict.toml b/naga/tests/in/bounds-check-restrict.toml new file mode 100644 index 0000000000..b3c8a15bff --- /dev/null +++ b/naga/tests/in/bounds-check-restrict.toml @@ -0,0 +1,5 @@ +targets = "SPIRV | METAL" + +[bounds_check_policies] +index = "Restrict" +buffer = "Restrict" diff --git a/naga/tests/in/bounds-check-zero-atomic.param.ron b/naga/tests/in/bounds-check-zero-atomic.param.ron deleted file mode 100644 index c39cb6840f..0000000000 --- a/naga/tests/in/bounds-check-zero-atomic.param.ron +++ /dev/null @@ -1,7 +0,0 @@ -( - bounds_check_policies: ( - index: ReadZeroSkipWrite, - buffer: ReadZeroSkipWrite, - ), - targets: "METAL", -) diff --git a/naga/tests/in/bounds-check-zero-atomic.toml b/naga/tests/in/bounds-check-zero-atomic.toml new file mode 100644 index 0000000000..06402ce575 --- /dev/null +++ b/naga/tests/in/bounds-check-zero-atomic.toml @@ -0,0 +1,5 @@ +targets = "METAL" + +[bounds_check_policies] +index = "ReadZeroSkipWrite" +buffer = "ReadZeroSkipWrite" diff --git a/naga/tests/in/bounds-check-zero.param.ron b/naga/tests/in/bounds-check-zero.param.ron deleted file mode 100644 index 2bdb1e36b2..0000000000 --- a/naga/tests/in/bounds-check-zero.param.ron +++ /dev/null @@ -1,7 +0,0 @@ -( - bounds_check_policies: ( - index: ReadZeroSkipWrite, - buffer: ReadZeroSkipWrite, - ), - targets: "SPIRV | METAL", -) diff --git a/naga/tests/in/bounds-check-zero.toml b/naga/tests/in/bounds-check-zero.toml new file mode 100644 index 0000000000..b252bf04f7 --- /dev/null +++ b/naga/tests/in/bounds-check-zero.toml @@ -0,0 +1,5 @@ +targets = "SPIRV | METAL" + +[bounds_check_policies] +index = "ReadZeroSkipWrite" +buffer = "ReadZeroSkipWrite" diff --git a/naga/tests/in/break-if.param.ron b/naga/tests/in/break-if.param.ron deleted file mode 100644 index a10b27eabb..0000000000 --- a/naga/tests/in/break-if.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL | GLSL | SPIRV | HLSL | METAL", -) diff --git a/naga/tests/in/break-if.toml b/naga/tests/in/break-if.toml new file mode 100644 index 0000000000..32adb4cbc1 --- /dev/null +++ b/naga/tests/in/break-if.toml @@ -0,0 +1 @@ +targets = "WGSL | GLSL | SPIRV | HLSL | METAL" diff --git a/naga/tests/in/collatz.param.ron b/naga/tests/in/collatz.param.ron deleted file mode 100644 index 35ee22c49e..0000000000 --- a/naga/tests/in/collatz.param.ron +++ /dev/null @@ -1,7 +0,0 @@ -( - spv: ( - version: (1, 0), - debug: true, - ), - targets: "SPIRV | METAL | IR | ANALYSIS | HLSL | WGSL", -) diff --git a/naga/tests/in/collatz.toml b/naga/tests/in/collatz.toml new file mode 100644 index 0000000000..e06044d208 --- /dev/null +++ b/naga/tests/in/collatz.toml @@ -0,0 +1,5 @@ +targets = "SPIRV | METAL | IR | ANALYSIS | HLSL | WGSL" + +[spv] +debug = true +version = [1, 0] diff --git a/naga/tests/in/const-exprs.param.ron b/naga/tests/in/const-exprs.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/const-exprs.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/const-exprs.toml b/naga/tests/in/const-exprs.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/const-exprs.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/const_assert.param.ron b/naga/tests/in/const_assert.param.ron deleted file mode 100644 index aaa447a30b..0000000000 --- a/naga/tests/in/const_assert.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL | IR", -) diff --git a/naga/tests/in/const_assert.toml b/naga/tests/in/const_assert.toml new file mode 100644 index 0000000000..ffd2b94189 --- /dev/null +++ b/naga/tests/in/const_assert.toml @@ -0,0 +1 @@ +targets = "WGSL | IR" diff --git a/naga/tests/in/constructors.param.ron b/naga/tests/in/constructors.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/constructors.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/constructors.toml b/naga/tests/in/constructors.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/constructors.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/control-flow.param.ron b/naga/tests/in/control-flow.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/control-flow.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/control-flow.toml b/naga/tests/in/control-flow.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/control-flow.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/cross.param.ron b/naga/tests/in/cross.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/cross.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/cross.toml b/naga/tests/in/cross.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/cross.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/cubeArrayShadow.param.ron b/naga/tests/in/cubeArrayShadow.param.ron deleted file mode 100644 index 10b8c634fe..0000000000 --- a/naga/tests/in/cubeArrayShadow.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "GLSL", -) diff --git a/naga/tests/in/cubeArrayShadow.toml b/naga/tests/in/cubeArrayShadow.toml new file mode 100644 index 0000000000..205dba77a3 --- /dev/null +++ b/naga/tests/in/cubeArrayShadow.toml @@ -0,0 +1 @@ +targets = "GLSL" diff --git a/naga/tests/in/debug-symbol-large-source.param.ron b/naga/tests/in/debug-symbol-large-source.param.ron deleted file mode 100644 index bf414857fa..0000000000 --- a/naga/tests/in/debug-symbol-large-source.param.ron +++ /dev/null @@ -1,8 +0,0 @@ -( - spv: ( - version: (1, 1), - debug: true, - adjust_coordinate_space: false, - ), - targets: "SPIRV", -) diff --git a/naga/tests/in/debug-symbol-large-source.toml b/naga/tests/in/debug-symbol-large-source.toml new file mode 100644 index 0000000000..0e1b72be19 --- /dev/null +++ b/naga/tests/in/debug-symbol-large-source.toml @@ -0,0 +1,6 @@ +targets = "SPIRV" + +[spv] +adjust_coordinate_space = false +debug = true +version = [1, 1] diff --git a/naga/tests/in/debug-symbol-simple.param.ron b/naga/tests/in/debug-symbol-simple.param.ron deleted file mode 100644 index bf414857fa..0000000000 --- a/naga/tests/in/debug-symbol-simple.param.ron +++ /dev/null @@ -1,8 +0,0 @@ -( - spv: ( - version: (1, 1), - debug: true, - adjust_coordinate_space: false, - ), - targets: "SPIRV", -) diff --git a/naga/tests/in/debug-symbol-simple.toml b/naga/tests/in/debug-symbol-simple.toml new file mode 100644 index 0000000000..0e1b72be19 --- /dev/null +++ b/naga/tests/in/debug-symbol-simple.toml @@ -0,0 +1,6 @@ +targets = "SPIRV" + +[spv] +adjust_coordinate_space = false +debug = true +version = [1, 1] diff --git a/naga/tests/in/debug-symbol-terrain.param.ron b/naga/tests/in/debug-symbol-terrain.param.ron deleted file mode 100644 index bf414857fa..0000000000 --- a/naga/tests/in/debug-symbol-terrain.param.ron +++ /dev/null @@ -1,8 +0,0 @@ -( - spv: ( - version: (1, 1), - debug: true, - adjust_coordinate_space: false, - ), - targets: "SPIRV", -) diff --git a/naga/tests/in/debug-symbol-terrain.toml b/naga/tests/in/debug-symbol-terrain.toml new file mode 100644 index 0000000000..0e1b72be19 --- /dev/null +++ b/naga/tests/in/debug-symbol-terrain.toml @@ -0,0 +1,6 @@ +targets = "SPIRV" + +[spv] +adjust_coordinate_space = false +debug = true +version = [1, 1] diff --git a/naga/tests/in/diagnostic-filter.param.ron b/naga/tests/in/diagnostic-filter.param.ron deleted file mode 100644 index 8a613b6a5d..0000000000 --- a/naga/tests/in/diagnostic-filter.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "IR", -) diff --git a/naga/tests/in/diagnostic-filter.toml b/naga/tests/in/diagnostic-filter.toml new file mode 100644 index 0000000000..0c2104ee62 --- /dev/null +++ b/naga/tests/in/diagnostic-filter.toml @@ -0,0 +1 @@ +targets = "IR" diff --git a/naga/tests/in/dualsource.param.ron b/naga/tests/in/dualsource.param.ron deleted file mode 100644 index 5f4b73b04b..0000000000 --- a/naga/tests/in/dualsource.param.ron +++ /dev/null @@ -1,12 +0,0 @@ -( - god_mode: true, - msl: ( - lang_version: (1, 2), - per_entry_point_map: {}, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: false, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/dualsource.toml b/naga/tests/in/dualsource.toml new file mode 100644 index 0000000000..89bede2fc5 --- /dev/null +++ b/naga/tests/in/dualsource.toml @@ -0,0 +1,8 @@ +god_mode = true +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" + +[msl] +fake_missing_bindings = false +lang_version = [1, 2] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true diff --git a/naga/tests/in/empty.param.ron b/naga/tests/in/empty.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/empty.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/empty.toml b/naga/tests/in/empty.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/empty.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/extra.param.ron b/naga/tests/in/extra.param.ron deleted file mode 100644 index d95081fa55..0000000000 --- a/naga/tests/in/extra.param.ron +++ /dev/null @@ -1,19 +0,0 @@ -( - god_mode: true, - spv: ( - version: (1, 2), - ), - msl: ( - lang_version: (2, 2), - per_entry_point_map: { - "main": ( - push_constant_buffer: Some(1), - ), - }, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: false, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | WGSL", -) diff --git a/naga/tests/in/extra.toml b/naga/tests/in/extra.toml new file mode 100644 index 0000000000..e5e681a693 --- /dev/null +++ b/naga/tests/in/extra.toml @@ -0,0 +1,14 @@ +god_mode = true +targets = "SPIRV | METAL | WGSL" + +[msl] +fake_missing_bindings = false +lang_version = [2, 2] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[msl.per_entry_point_map.main] +push_constant_buffer = 1 + +[spv] +version = [1, 2] diff --git a/naga/tests/in/f64.param.ron b/naga/tests/in/f64.param.ron deleted file mode 100644 index f69308ea91..0000000000 --- a/naga/tests/in/f64.param.ron +++ /dev/null @@ -1,13 +0,0 @@ -( - god_mode: true, - spv: ( - version: (1, 0), - ), - glsl: ( - version: Desktop(420), - writer_flags: (""), - binding_map: { }, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/f64.toml b/naga/tests/in/f64.toml new file mode 100644 index 0000000000..842dd905f6 --- /dev/null +++ b/naga/tests/in/f64.toml @@ -0,0 +1,9 @@ +god_mode = true +targets = "SPIRV | GLSL | HLSL | WGSL" + +[glsl] +version.Desktop = 420 +zero_initialize_workgroup_memory = true + +[spv] +version = [1, 0] diff --git a/naga/tests/in/force_point_size_vertex_shader_webgl.param.ron b/naga/tests/in/force_point_size_vertex_shader_webgl.param.ron deleted file mode 100644 index 8336d9887b..0000000000 --- a/naga/tests/in/force_point_size_vertex_shader_webgl.param.ron +++ /dev/null @@ -1,12 +0,0 @@ -( - glsl: ( - version: Embedded ( - version: 300, - is_webgl: true - ), - writer_flags: ("FORCE_POINT_SIZE"), - binding_map: {}, - zero_initialize_workgroup_memory: true, - ), - targets: "GLSL", -) diff --git a/naga/tests/in/force_point_size_vertex_shader_webgl.toml b/naga/tests/in/force_point_size_vertex_shader_webgl.toml new file mode 100644 index 0000000000..a07b23c70d --- /dev/null +++ b/naga/tests/in/force_point_size_vertex_shader_webgl.toml @@ -0,0 +1,6 @@ +targets = "GLSL" + +[glsl] +version.Embedded = { is_webgl = true, version = 300 } +writer_flags = "FORCE_POINT_SIZE" +zero_initialize_workgroup_memory = true diff --git a/naga/tests/in/fragment-output.param.ron b/naga/tests/in/fragment-output.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/fragment-output.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/fragment-output.toml b/naga/tests/in/fragment-output.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/fragment-output.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/functions-webgl.param.ron b/naga/tests/in/functions-webgl.param.ron deleted file mode 100644 index 5edf44e5bc..0000000000 --- a/naga/tests/in/functions-webgl.param.ron +++ /dev/null @@ -1,12 +0,0 @@ -( - glsl: ( - version: Embedded( - version: 320, - is_webgl: false - ), - writer_flags: (""), - binding_map: {}, - zero_initialize_workgroup_memory: true, - ), - targets: "GLSL", -) diff --git a/naga/tests/in/functions-webgl.toml b/naga/tests/in/functions-webgl.toml new file mode 100644 index 0000000000..2640dec8b7 --- /dev/null +++ b/naga/tests/in/functions-webgl.toml @@ -0,0 +1,5 @@ +targets = "GLSL" + +[glsl] +version.Embedded = { is_webgl = false, version = 320 } +zero_initialize_workgroup_memory = true diff --git a/naga/tests/in/functions.param.ron b/naga/tests/in/functions.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/functions.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/functions.toml b/naga/tests/in/functions.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/functions.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/globals.param.ron b/naga/tests/in/globals.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/globals.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/globals.toml b/naga/tests/in/globals.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/globals.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/glsl/800-out-of-bounds-panic.param.ron b/naga/tests/in/glsl/800-out-of-bounds-panic.param.ron deleted file mode 100644 index c70ada9939..0000000000 --- a/naga/tests/in/glsl/800-out-of-bounds-panic.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - god_mode: true, -) \ No newline at end of file diff --git a/naga/tests/in/glsl/800-out-of-bounds-panic.toml b/naga/tests/in/glsl/800-out-of-bounds-panic.toml new file mode 100644 index 0000000000..fd242d5b5b --- /dev/null +++ b/naga/tests/in/glsl/800-out-of-bounds-panic.toml @@ -0,0 +1 @@ +god_mode = true diff --git a/naga/tests/in/glsl/896-push-constant.param.ron b/naga/tests/in/glsl/896-push-constant.param.ron deleted file mode 100644 index c70ada9939..0000000000 --- a/naga/tests/in/glsl/896-push-constant.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - god_mode: true, -) \ No newline at end of file diff --git a/naga/tests/in/glsl/896-push-constant.toml b/naga/tests/in/glsl/896-push-constant.toml new file mode 100644 index 0000000000..fd242d5b5b --- /dev/null +++ b/naga/tests/in/glsl/896-push-constant.toml @@ -0,0 +1 @@ +god_mode = true diff --git a/naga/tests/in/glsl/double-math-functions.param.ron b/naga/tests/in/glsl/double-math-functions.param.ron deleted file mode 100644 index c70ada9939..0000000000 --- a/naga/tests/in/glsl/double-math-functions.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - god_mode: true, -) \ No newline at end of file diff --git a/naga/tests/in/glsl/double-math-functions.toml b/naga/tests/in/glsl/double-math-functions.toml new file mode 100644 index 0000000000..fd242d5b5b --- /dev/null +++ b/naga/tests/in/glsl/double-math-functions.toml @@ -0,0 +1 @@ +god_mode = true diff --git a/naga/tests/in/glsl/variations.param.ron b/naga/tests/in/glsl/variations.param.ron deleted file mode 100644 index 10b8c634fe..0000000000 --- a/naga/tests/in/glsl/variations.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "GLSL", -) diff --git a/naga/tests/in/glsl/variations.toml b/naga/tests/in/glsl/variations.toml new file mode 100644 index 0000000000..205dba77a3 --- /dev/null +++ b/naga/tests/in/glsl/variations.toml @@ -0,0 +1 @@ +targets = "GLSL" diff --git a/naga/tests/in/glsl/vector-functions.param.ron b/naga/tests/in/glsl/vector-functions.param.ron deleted file mode 100644 index c70ada9939..0000000000 --- a/naga/tests/in/glsl/vector-functions.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - god_mode: true, -) \ No newline at end of file diff --git a/naga/tests/in/glsl/vector-functions.toml b/naga/tests/in/glsl/vector-functions.toml new file mode 100644 index 0000000000..fd242d5b5b --- /dev/null +++ b/naga/tests/in/glsl/vector-functions.toml @@ -0,0 +1 @@ +god_mode = true diff --git a/naga/tests/in/hlsl-keyword.param.ron b/naga/tests/in/hlsl-keyword.param.ron deleted file mode 100644 index a92d1c5b00..0000000000 --- a/naga/tests/in/hlsl-keyword.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "HLSL", -) diff --git a/naga/tests/in/hlsl-keyword.toml b/naga/tests/in/hlsl-keyword.toml new file mode 100644 index 0000000000..3ca0b52f4e --- /dev/null +++ b/naga/tests/in/hlsl-keyword.toml @@ -0,0 +1 @@ +targets = "HLSL" diff --git a/naga/tests/in/image.param.ron b/naga/tests/in/image.param.ron deleted file mode 100644 index 39e7553395..0000000000 --- a/naga/tests/in/image.param.ron +++ /dev/null @@ -1,14 +0,0 @@ -( - spv: ( - version: (1, 1), - debug: true, - ), - glsl: ( - version: Desktop(430), - writer_flags: (""), - binding_map: {}, - zero_initialize_workgroup_memory: true, - ), - glsl_exclude_list: ["depth_load", "depth_no_comparison"], - targets: "SPIRV | METAL | HLSL | WGSL | GLSL", -) diff --git a/naga/tests/in/image.toml b/naga/tests/in/image.toml new file mode 100644 index 0000000000..9c639b5af2 --- /dev/null +++ b/naga/tests/in/image.toml @@ -0,0 +1,11 @@ +glsl_exclude_list = ["depth_load", "depth_no_comparison"] +targets = "SPIRV | METAL | HLSL | WGSL | GLSL" + +[glsl] +version.Desktop = 430 +writer_flags = "" +zero_initialize_workgroup_memory = true + +[spv] +debug = true +version = [1, 1] diff --git a/naga/tests/in/index-by-value.param.ron b/naga/tests/in/index-by-value.param.ron deleted file mode 100644 index a66141388f..0000000000 --- a/naga/tests/in/index-by-value.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | IR", -) diff --git a/naga/tests/in/index-by-value.toml b/naga/tests/in/index-by-value.toml new file mode 100644 index 0000000000..bbcbbe40df --- /dev/null +++ b/naga/tests/in/index-by-value.toml @@ -0,0 +1 @@ +targets = "SPIRV | IR" diff --git a/naga/tests/in/int64.param.ron b/naga/tests/in/int64.param.ron deleted file mode 100644 index 096cbb39e5..0000000000 --- a/naga/tests/in/int64.param.ron +++ /dev/null @@ -1,25 +0,0 @@ -( - god_mode: true, - spv: ( - version: (1, 0), - capabilities: [ Int64 ], - ), - hlsl: ( - shader_model: V6_0, - binding_map: {}, - fake_missing_bindings: true, - special_constants_binding: Some((space: 1, register: 0)), - push_constants_target: Some((space: 0, register: 0)), - zero_initialize_workgroup_memory: true, - restrict_indexing: true - ), - msl: ( - lang_version: (2, 3), - per_entry_point_map: {}, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: true, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | HLSL | WGSL | METAL", -) diff --git a/naga/tests/in/int64.toml b/naga/tests/in/int64.toml new file mode 100644 index 0000000000..0eb7df7a91 --- /dev/null +++ b/naga/tests/in/int64.toml @@ -0,0 +1,19 @@ +god_mode = true +targets = "SPIRV | HLSL | WGSL | METAL" + +[msl] +fake_missing_bindings = true +lang_version = [2, 3] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[hlsl] +shader_model = "V6_0" +fake_missing_bindings = true +push_constants_target = { register = 0, space = 0 } +restrict_indexing = true +special_constants_binding = { register = 0, space = 1 } +zero_initialize_workgroup_memory = true + +[spv] +version = [1, 0] diff --git a/naga/tests/in/interface.param.ron b/naga/tests/in/interface.param.ron deleted file mode 100644 index 2d90d9345c..0000000000 --- a/naga/tests/in/interface.param.ron +++ /dev/null @@ -1,36 +0,0 @@ -( - //TODO: GLSL https://github.com/gfx-rs/naga/issues/874 - targets: "SPIRV | METAL | HLSL | WGSL", - spv: ( - version: (1, 0), - capabilities: [ Shader, SampleRateShading ], - adjust_coordinate_space: false, - force_point_size: true, - clamp_frag_depth: true, - separate_entry_points: true, - ), - hlsl: ( - shader_model: V5_1, - binding_map: {}, - fake_missing_bindings: false, - special_constants_binding: Some((space: 1, register: 0)), - zero_initialize_workgroup_memory: true, - restrict_indexing: true - ), - wgsl: ( - explicit_types: true, - ), - msl: ( - lang_version: (2, 1), - per_entry_point_map: {}, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: false, - zero_initialize_workgroup_memory: true, - ), - msl_pipeline: ( - allow_and_force_point_size: true, - vertex_pulling_transform: false, - vertex_buffer_mappings: [], - ), -) diff --git a/naga/tests/in/interface.toml b/naga/tests/in/interface.toml new file mode 100644 index 0000000000..422d1ae3fc --- /dev/null +++ b/naga/tests/in/interface.toml @@ -0,0 +1,23 @@ +msl_pipeline = { allow_and_force_point_size = true, vertex_buffer_mappings = [ +], vertex_pulling_transform = false } +targets = "SPIRV | METAL | HLSL | WGSL" +wgsl = { explicit_types = true } + +[msl] +fake_missing_bindings = false +lang_version = [2, 1] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[hlsl] +fake_missing_bindings = false +restrict_indexing = true +special_constants_binding = { register = 0, space = 1 } +zero_initialize_workgroup_memory = true + +[spv] +adjust_coordinate_space = false +clamp_frag_depth = true +force_point_size = true +separate_entry_points = true +version = [1, 0] diff --git a/naga/tests/in/interpolate.param.ron b/naga/tests/in/interpolate.param.ron deleted file mode 100644 index 8882e0fd39..0000000000 --- a/naga/tests/in/interpolate.param.ron +++ /dev/null @@ -1,16 +0,0 @@ -( - spv: ( - version: (1, 0), - capabilities: [ Shader, SampleRateShading ], - debug: true, - force_point_size: true, - adjust_coordinate_space: true, - ), - glsl: ( - version: Desktop(400), - writer_flags: (""), - binding_map: {}, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | HLSL | WGSL", -) diff --git a/naga/tests/in/interpolate.toml b/naga/tests/in/interpolate.toml new file mode 100644 index 0000000000..bb9f697388 --- /dev/null +++ b/naga/tests/in/interpolate.toml @@ -0,0 +1,11 @@ +targets = "SPIRV | METAL | HLSL | WGSL" + +[glsl] +version.Desktop = 400 +zero_initialize_workgroup_memory = true + +[spv] +adjust_coordinate_space = true +debug = true +force_point_size = true +version = [1, 0] diff --git a/naga/tests/in/interpolate_compat.param.ron b/naga/tests/in/interpolate_compat.param.ron deleted file mode 100644 index b990a57c90..0000000000 --- a/naga/tests/in/interpolate_compat.param.ron +++ /dev/null @@ -1,16 +0,0 @@ -( - spv: ( - version: (1, 0), - capabilities: [ Shader, SampleRateShading ], - debug: true, - force_point_size: true, - adjust_coordinate_space: true, - ), - glsl: ( - version: Desktop(400), - writer_flags: (""), - binding_map: {}, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/interpolate_compat.toml b/naga/tests/in/interpolate_compat.toml new file mode 100644 index 0000000000..19d2236726 --- /dev/null +++ b/naga/tests/in/interpolate_compat.toml @@ -0,0 +1,12 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" + +[glsl] +version.Desktop = 400 +writer_flags = "" +zero_initialize_workgroup_memory = true + +[spv] +adjust_coordinate_space = true +debug = true +force_point_size = true +version = [1, 0] diff --git a/naga/tests/in/invariant.param.ron b/naga/tests/in/invariant.param.ron deleted file mode 100644 index 12e5f252cf..0000000000 --- a/naga/tests/in/invariant.param.ron +++ /dev/null @@ -1,12 +0,0 @@ -( - glsl: ( - version: Embedded ( - version: 300, - is_webgl: true - ), - writer_flags: (""), - binding_map: {}, - zero_initialize_workgroup_memory: true, - ), - targets: "GLSL", -) diff --git a/naga/tests/in/invariant.toml b/naga/tests/in/invariant.toml new file mode 100644 index 0000000000..7505f9f35d --- /dev/null +++ b/naga/tests/in/invariant.toml @@ -0,0 +1,6 @@ +targets = "GLSL" + +[glsl] +version.Embedded = { is_webgl = true, version = 300 } +writer_flags = "" +zero_initialize_workgroup_memory = true diff --git a/naga/tests/in/lexical-scopes.param.ron b/naga/tests/in/lexical-scopes.param.ron deleted file mode 100644 index 5b9668558e..0000000000 --- a/naga/tests/in/lexical-scopes.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL", -) diff --git a/naga/tests/in/lexical-scopes.toml b/naga/tests/in/lexical-scopes.toml new file mode 100644 index 0000000000..07bac2c050 --- /dev/null +++ b/naga/tests/in/lexical-scopes.toml @@ -0,0 +1 @@ +targets = "WGSL" diff --git a/naga/tests/in/local-const.param.ron b/naga/tests/in/local-const.param.ron deleted file mode 100644 index c1d95c49f9..0000000000 --- a/naga/tests/in/local-const.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "IR | WGSL", -) diff --git a/naga/tests/in/local-const.toml b/naga/tests/in/local-const.toml new file mode 100644 index 0000000000..9c589e8d07 --- /dev/null +++ b/naga/tests/in/local-const.toml @@ -0,0 +1 @@ +targets = "IR | WGSL" diff --git a/naga/tests/in/math-functions.param.ron b/naga/tests/in/math-functions.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/math-functions.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/math-functions.toml b/naga/tests/in/math-functions.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/math-functions.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/module-scope.param.ron b/naga/tests/in/module-scope.param.ron deleted file mode 100644 index 5b9668558e..0000000000 --- a/naga/tests/in/module-scope.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL", -) diff --git a/naga/tests/in/module-scope.toml b/naga/tests/in/module-scope.toml new file mode 100644 index 0000000000..07bac2c050 --- /dev/null +++ b/naga/tests/in/module-scope.toml @@ -0,0 +1 @@ +targets = "WGSL" diff --git a/naga/tests/in/msl-varyings.param.ron b/naga/tests/in/msl-varyings.param.ron deleted file mode 100644 index 82556fb9e4..0000000000 --- a/naga/tests/in/msl-varyings.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "METAL", -) diff --git a/naga/tests/in/msl-varyings.toml b/naga/tests/in/msl-varyings.toml new file mode 100644 index 0000000000..43b7c06c13 --- /dev/null +++ b/naga/tests/in/msl-varyings.toml @@ -0,0 +1 @@ +targets = "METAL" diff --git a/naga/tests/in/multiview.param.ron b/naga/tests/in/multiview.param.ron deleted file mode 100644 index 8d2e3e2d6c..0000000000 --- a/naga/tests/in/multiview.param.ron +++ /dev/null @@ -1,5 +0,0 @@ -( - god_mode: true, - glsl_multiview: Some(2), - targets: "SPIRV | GLSL | WGSL", -) diff --git a/naga/tests/in/multiview.toml b/naga/tests/in/multiview.toml new file mode 100644 index 0000000000..690600e095 --- /dev/null +++ b/naga/tests/in/multiview.toml @@ -0,0 +1,3 @@ +glsl_multiview = 2 +god_mode = true +targets = "SPIRV | GLSL | WGSL" diff --git a/naga/tests/in/multiview_webgl.param.ron b/naga/tests/in/multiview_webgl.param.ron deleted file mode 100644 index 82340764ba..0000000000 --- a/naga/tests/in/multiview_webgl.param.ron +++ /dev/null @@ -1,14 +0,0 @@ -( - god_mode: true, - glsl: ( - version: Embedded ( - version: 300, - is_webgl: true - ), - writer_flags: (""), - binding_map: {}, - zero_initialize_workgroup_memory: true, - ), - glsl_multiview: Some(2), - targets: "GLSL", -) diff --git a/naga/tests/in/multiview_webgl.toml b/naga/tests/in/multiview_webgl.toml new file mode 100644 index 0000000000..012b21270b --- /dev/null +++ b/naga/tests/in/multiview_webgl.toml @@ -0,0 +1,7 @@ +glsl_multiview = 2 +god_mode = true +targets = "GLSL" + +[glsl] +version.Embedded = { is_webgl = true, version = 300 } +zero_initialize_workgroup_memory = true diff --git a/naga/tests/in/must-use.param.ron b/naga/tests/in/must-use.param.ron deleted file mode 100644 index 8a613b6a5d..0000000000 --- a/naga/tests/in/must-use.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "IR", -) diff --git a/naga/tests/in/must-use.toml b/naga/tests/in/must-use.toml new file mode 100644 index 0000000000..0c2104ee62 --- /dev/null +++ b/naga/tests/in/must-use.toml @@ -0,0 +1 @@ +targets = "IR" diff --git a/naga/tests/in/operators.param.ron b/naga/tests/in/operators.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/operators.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/operators.toml b/naga/tests/in/operators.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/operators.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/overrides-atomicCompareExchangeWeak.param.ron b/naga/tests/in/overrides-atomicCompareExchangeWeak.param.ron deleted file mode 100644 index 4174ec231e..0000000000 --- a/naga/tests/in/overrides-atomicCompareExchangeWeak.param.ron +++ /dev/null @@ -1,10 +0,0 @@ -( - spv: ( - version: (1, 0), - separate_entry_points: true, - ), - pipeline_constants: { - "o": 2.0 - }, - targets: "IR | SPIRV | METAL", -) diff --git a/naga/tests/in/overrides-atomicCompareExchangeWeak.toml b/naga/tests/in/overrides-atomicCompareExchangeWeak.toml new file mode 100644 index 0000000000..68d8261c6e --- /dev/null +++ b/naga/tests/in/overrides-atomicCompareExchangeWeak.toml @@ -0,0 +1,6 @@ +pipeline_constants = { o = 2.0 } +targets = "IR | SPIRV | METAL" + +[spv] +separate_entry_points = true +version = [1, 0] diff --git a/naga/tests/in/overrides-ray-query.param.ron b/naga/tests/in/overrides-ray-query.param.ron deleted file mode 100644 index 9a271ee8a0..0000000000 --- a/naga/tests/in/overrides-ray-query.param.ron +++ /dev/null @@ -1,19 +0,0 @@ -( - god_mode: true, - spv: ( - version: (1, 4), - separate_entry_points: true, - ), - msl: ( - lang_version: (2, 4), - spirv_cross_compatibility: false, - fake_missing_bindings: true, - zero_initialize_workgroup_memory: false, - per_entry_point_map: {}, - inline_samplers: [], - ), - pipeline_constants: { - "o": 2.0 - }, - targets: "IR | SPIRV | METAL", -) diff --git a/naga/tests/in/overrides-ray-query.toml b/naga/tests/in/overrides-ray-query.toml new file mode 100644 index 0000000000..c9c6707cc0 --- /dev/null +++ b/naga/tests/in/overrides-ray-query.toml @@ -0,0 +1,13 @@ +god_mode = true +pipeline_constants = { o = 2.0 } +targets = "IR | SPIRV | METAL" + +[msl] +fake_missing_bindings = true +lang_version = [2, 4] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = false + +[spv] +separate_entry_points = true +version = [1, 4] diff --git a/naga/tests/in/overrides.param.ron b/naga/tests/in/overrides.param.ron deleted file mode 100644 index fdb29dcd73..0000000000 --- a/naga/tests/in/overrides.param.ron +++ /dev/null @@ -1,12 +0,0 @@ -( - spv: ( - version: (1, 0), - separate_entry_points: true, - ), - pipeline_constants: { - "0": NaN, - "1300": 1.1, - "depth": 2.3, - }, - targets: "IR | ANALYSIS | SPIRV | METAL | HLSL | GLSL", -) diff --git a/naga/tests/in/overrides.toml b/naga/tests/in/overrides.toml new file mode 100644 index 0000000000..cc049e8dc5 --- /dev/null +++ b/naga/tests/in/overrides.toml @@ -0,0 +1,6 @@ +pipeline_constants = { 0 = nan, 1300 = 1.1, depth = 2.3 } +targets = "IR | ANALYSIS | SPIRV | METAL | HLSL | GLSL" + +[spv] +separate_entry_points = true +version = [1, 0] diff --git a/naga/tests/in/padding.param.ron b/naga/tests/in/padding.param.ron deleted file mode 100644 index e2150041a6..0000000000 --- a/naga/tests/in/padding.param.ron +++ /dev/null @@ -1,24 +0,0 @@ -( - spv: ( - version: (1, 1), - debug: true, - adjust_coordinate_space: false, - ), - msl: ( - lang_version: (1, 0), - per_entry_point_map: { - "vertex": ( - resources: { - (group: 0, binding: 0): (buffer: Some(0), mutable: false), - (group: 0, binding: 1): (buffer: Some(1), mutable: false), - (group: 0, binding: 2): (buffer: Some(2), mutable: false), - }, - ), - }, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: false, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/padding.toml b/naga/tests/in/padding.toml new file mode 100644 index 0000000000..fc90036436 --- /dev/null +++ b/naga/tests/in/padding.toml @@ -0,0 +1,19 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" + +[msl] +fake_missing_bindings = false +lang_version = [1, 0] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[msl.per_entry_point_map.vertex] +resources = [ + { bind_target = { buffer = 0, mutable = false }, resource_binding = { group = 0, binding = 0 } }, + { bind_target = { buffer = 1, mutable = false }, resource_binding = { group = 0, binding = 1 } }, + { bind_target = { buffer = 2, mutable = false }, resource_binding = { group = 0, binding = 2 } }, +] + +[spv] +adjust_coordinate_space = false +debug = true +version = [1, 1] diff --git a/naga/tests/in/phony_assignment.param.ron b/naga/tests/in/phony_assignment.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/phony_assignment.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/phony_assignment.toml b/naga/tests/in/phony_assignment.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/phony_assignment.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/pointers.param.ron b/naga/tests/in/pointers.param.ron deleted file mode 100644 index f0dc198adb..0000000000 --- a/naga/tests/in/pointers.param.ron +++ /dev/null @@ -1,11 +0,0 @@ -( - bounds_check_policies: ( - image_load: ReadZeroSkipWrite, - ), - spv: ( - version: (1, 2), - debug: true, - adjust_coordinate_space: false, - ), - targets: "SPIRV | WGSL", -) diff --git a/naga/tests/in/pointers.toml b/naga/tests/in/pointers.toml new file mode 100644 index 0000000000..72d911c880 --- /dev/null +++ b/naga/tests/in/pointers.toml @@ -0,0 +1,7 @@ +bounds_check_policies = [] +targets = "SPIRV | WGSL" + +[spv] +adjust_coordinate_space = false +debug = true +version = [1, 2] diff --git a/naga/tests/in/policy-mix.param.ron b/naga/tests/in/policy-mix.param.ron deleted file mode 100644 index 0921c49472..0000000000 --- a/naga/tests/in/policy-mix.param.ron +++ /dev/null @@ -1,12 +0,0 @@ -( - bounds_check_policies: ( - index: Restrict, - buffer: Unchecked, - image_load: ReadZeroSkipWrite, - ), - spv: ( - version: (1, 1), - debug: true, - ), - targets: "SPIRV | METAL", -) diff --git a/naga/tests/in/policy-mix.toml b/naga/tests/in/policy-mix.toml new file mode 100644 index 0000000000..9fc1268403 --- /dev/null +++ b/naga/tests/in/policy-mix.toml @@ -0,0 +1,10 @@ +targets = "SPIRV | METAL" + +[bounds_check_policies] +index = "Restrict" +buffer = "Unchecked" +image_load = "ReadZeroSkipWrite" + +[spv] +debug = true +version = [1, 1] diff --git a/naga/tests/in/push-constants.param.ron b/naga/tests/in/push-constants.param.ron deleted file mode 100644 index e1dba98fb3..0000000000 --- a/naga/tests/in/push-constants.param.ron +++ /dev/null @@ -1,22 +0,0 @@ -( - god_mode: true, - glsl: ( - version: Embedded( - version: 320, - is_webgl: false - ), - writer_flags: (""), - binding_map: {}, - zero_initialize_workgroup_memory: true, - ), - hlsl: ( - shader_model: V5_1, - binding_map: {}, - fake_missing_bindings: true, - special_constants_binding: Some((space: 1, register: 0)), - push_constants_target: Some((space: 0, register: 0)), - zero_initialize_workgroup_memory: true, - restrict_indexing: true - ), - targets: "GLSL | HLSL", -) diff --git a/naga/tests/in/push-constants.toml b/naga/tests/in/push-constants.toml new file mode 100644 index 0000000000..4bd99680f4 --- /dev/null +++ b/naga/tests/in/push-constants.toml @@ -0,0 +1,14 @@ +god_mode = true +targets = "GLSL | HLSL" + +[hlsl] +fake_missing_bindings = true +push_constants_target = { register = 0, space = 0 } +restrict_indexing = true +special_constants_binding = { register = 0, space = 1 } +zero_initialize_workgroup_memory = true + +[glsl] +version.Embedded = { is_webgl = false, version = 320 } +writer_flags = "" +zero_initialize_workgroup_memory = true diff --git a/naga/tests/in/quad.param.ron b/naga/tests/in/quad.param.ron deleted file mode 100644 index c701ec8574..0000000000 --- a/naga/tests/in/quad.param.ron +++ /dev/null @@ -1,17 +0,0 @@ -( - spv: ( - version: (1, 0), - debug: true, - adjust_coordinate_space: true, - ), - glsl: ( - version: Embedded( - version: 300, - is_webgl: false - ), - writer_flags: (""), - binding_map: {}, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | GLSL | DOT | HLSL | WGSL", -) diff --git a/naga/tests/in/quad.toml b/naga/tests/in/quad.toml new file mode 100644 index 0000000000..12d1829e42 --- /dev/null +++ b/naga/tests/in/quad.toml @@ -0,0 +1,11 @@ +targets = "SPIRV | METAL | GLSL | DOT | HLSL | WGSL" + +[glsl] +version.Embedded = { is_webgl = false, version = 300 } +writer_flags = "" +zero_initialize_workgroup_memory = true + +[spv] +adjust_coordinate_space = true +debug = true +version = [1, 0] diff --git a/naga/tests/in/ray-query.param.ron b/naga/tests/in/ray-query.param.ron deleted file mode 100644 index 2c40ef3b15..0000000000 --- a/naga/tests/in/ray-query.param.ron +++ /dev/null @@ -1,22 +0,0 @@ -( - god_mode: true, - spv: ( - version: (1, 4), - ), - msl: ( - lang_version: (2, 4), - spirv_cross_compatibility: false, - fake_missing_bindings: true, - zero_initialize_workgroup_memory: false, - per_entry_point_map: {}, - inline_samplers: [], - ), - hlsl: ( - shader_model: V6_5, - binding_map: {}, - fake_missing_bindings: true, - special_constants_binding: None, - zero_initialize_workgroup_memory: true, - ), - targets: "SPIRV | METAL | HLSL", -) diff --git a/naga/tests/in/ray-query.toml b/naga/tests/in/ray-query.toml new file mode 100644 index 0000000000..80939724a4 --- /dev/null +++ b/naga/tests/in/ray-query.toml @@ -0,0 +1,16 @@ +god_mode = true +targets = "SPIRV | METAL | HLSL" + +[msl] +fake_missing_bindings = true +lang_version = [2, 4] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = false + +[hlsl] +shader_model = "V6_5" +fake_missing_bindings = true +zero_initialize_workgroup_memory = true + +[spv] +version = [1, 4] diff --git a/naga/tests/in/resource-binding-map.param.ron b/naga/tests/in/resource-binding-map.param.ron deleted file mode 100644 index 632ba9759e..0000000000 --- a/naga/tests/in/resource-binding-map.param.ron +++ /dev/null @@ -1,54 +0,0 @@ -( - god_mode: true, - msl: ( - lang_version: (1, 0), - per_entry_point_map: { - "entry_point_one": ( - resources: { - (group: 0, binding: 0): (texture: Some(0)), - (group: 0, binding: 2): (sampler: Some(Inline(0))), - (group: 0, binding: 4): (buffer: Some(0)), - } - ), - "entry_point_two": ( - resources: { - (group: 0, binding: 0): (texture: Some(0)), - (group: 0, binding: 2): (sampler: Some(Resource(0))), - (group: 0, binding: 4): (buffer: Some(0)), - } - ), - "entry_point_three": ( - resources: { - (group: 0, binding: 0): (texture: Some(0)), - (group: 0, binding: 1): (texture: Some(1)), - (group: 0, binding: 2): (sampler: Some(Inline(0))), - (group: 0, binding: 3): (sampler: Some(Resource(1))), - (group: 0, binding: 4): (buffer: Some(0)), - (group: 1, binding: 0): (buffer: Some(1)), - } - ) - }, - inline_samplers: [ - ( - coord: Normalized, - address: (ClampToEdge, ClampToEdge, ClampToEdge), - mag_filter: Linear, - min_filter: Linear, - mip_filter: None, - border_color: TransparentBlack, - compare_func: Never, - lod_clamp: Some((start: 0.5, end: 10.0)), - max_anisotropy: Some(8), - ), - ], - spirv_cross_compatibility: false, - fake_missing_bindings: false, - zero_initialize_workgroup_memory: true, - ), - bounds_check_policies: ( - index: ReadZeroSkipWrite, - buffer: ReadZeroSkipWrite, - image_load: ReadZeroSkipWrite, - ), - targets: "METAL", -) diff --git a/naga/tests/in/resource-binding-map.toml b/naga/tests/in/resource-binding-map.toml new file mode 100644 index 0000000000..92ecb8c2be --- /dev/null +++ b/naga/tests/in/resource-binding-map.toml @@ -0,0 +1,45 @@ +god_mode = true +targets = "METAL" + +[bounds_check_policies] +index = "ReadZeroSkipWrite" +buffer = "ReadZeroSkipWrite" +image_load = "ReadZeroSkipWrite" + +[msl] +fake_missing_bindings = false +lang_version = [1, 0] + +[msl.per_entry_point_map.entry_point_one] +resources = [ + { bind_target = { texture = 0 }, resource_binding = { group = 0, binding = 0 } }, + { bind_target = { sampler.Inline = 0 }, resource_binding = { group = 0, binding = 2 } }, + { bind_target = { buffer = 0 }, resource_binding = { group = 0, binding = 4 } }, +] + +[msl.per_entry_point_map.entry_point_two] +resources = [ + { bind_target = { texture = 0 }, resource_binding = { group = 0, binding = 0 } }, + { bind_target = { sampler.Resource = 0 }, resource_binding = { group = 0, binding = 2 } }, + { bind_target = { buffer = 0 }, resource_binding = { group = 0, binding = 4 } }, +] + +[msl.per_entry_point_map.entry_point_three] +resources = [ + { bind_target = { texture = 0 }, resource_binding = { group = 0, binding = 0 } }, + { bind_target = { buffer = 1 }, resource_binding = { group = 1, binding = 0 } }, + { bind_target = { texture = 1 }, resource_binding = { group = 0, binding = 1 } }, + { bind_target = { sampler.Inline = 0 }, resource_binding = { group = 0, binding = 2 } }, + { bind_target = { sampler.Resource = 1 }, resource_binding = { group = 0, binding = 3 } }, + { bind_target = { buffer = 0 }, resource_binding = { group = 0, binding = 4 } }, +] + +[[msl.inline_samplers]] +coord = "Normalized" +address = ["ClampToEdge", "ClampToEdge", "ClampToEdge"] +mag_filter = "Linear" +min_filter = "Linear" +border_color = "TransparentBlack" +compare_func = "Never" +lod_clamp = { start = 0.5, end = 10.0 } +max_anisotropy = 8 diff --git a/naga/tests/in/runtime-array-in-unused-struct.param.ron b/naga/tests/in/runtime-array-in-unused-struct.param.ron deleted file mode 100644 index 52740817bd..0000000000 --- a/naga/tests/in/runtime-array-in-unused-struct.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV", -) diff --git a/naga/tests/in/runtime-array-in-unused-struct.toml b/naga/tests/in/runtime-array-in-unused-struct.toml new file mode 100644 index 0000000000..4883dbbd8d --- /dev/null +++ b/naga/tests/in/runtime-array-in-unused-struct.toml @@ -0,0 +1 @@ +targets = "SPIRV" diff --git a/naga/tests/in/sample-cube-array-depth-lod.param.ron b/naga/tests/in/sample-cube-array-depth-lod.param.ron deleted file mode 100644 index ff6243b368..0000000000 --- a/naga/tests/in/sample-cube-array-depth-lod.param.ron +++ /dev/null @@ -1,12 +0,0 @@ -( - glsl: ( - writer_flags: ("TEXTURE_SHADOW_LOD"), - version: Embedded( - version: 320, - is_webgl: false - ), - binding_map: {}, - zero_initialize_workgroup_memory: true, - ), - targets: "GLSL", -) diff --git a/naga/tests/in/sample-cube-array-depth-lod.toml b/naga/tests/in/sample-cube-array-depth-lod.toml new file mode 100644 index 0000000000..734192329e --- /dev/null +++ b/naga/tests/in/sample-cube-array-depth-lod.toml @@ -0,0 +1,6 @@ +targets = "GLSL" + +[glsl] +version.Embedded = { is_webgl = false, version = 320 } +writer_flags = "TEXTURE_SHADOW_LOD" +zero_initialize_workgroup_memory = true diff --git a/naga/tests/in/separate-entry-points.param.ron b/naga/tests/in/separate-entry-points.param.ron deleted file mode 100644 index 4d94219c71..0000000000 --- a/naga/tests/in/separate-entry-points.param.ron +++ /dev/null @@ -1,7 +0,0 @@ -( - spv: ( - version: (1, 0), - separate_entry_points: true, - ), - targets: "SPIRV | GLSL", -) diff --git a/naga/tests/in/separate-entry-points.toml b/naga/tests/in/separate-entry-points.toml new file mode 100644 index 0000000000..1748869ac7 --- /dev/null +++ b/naga/tests/in/separate-entry-points.toml @@ -0,0 +1,5 @@ +targets = "SPIRV | GLSL" + +[spv] +separate_entry_points = true +version = [1, 0] diff --git a/naga/tests/in/shadow.param.ron b/naga/tests/in/shadow.param.ron deleted file mode 100644 index 110dca48d3..0000000000 --- a/naga/tests/in/shadow.param.ron +++ /dev/null @@ -1,8 +0,0 @@ -( - spv: ( - version: (1, 2), - debug: true, - adjust_coordinate_space: true, - ), - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/shadow.toml b/naga/tests/in/shadow.toml new file mode 100644 index 0000000000..cf1ea8376d --- /dev/null +++ b/naga/tests/in/shadow.toml @@ -0,0 +1,6 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" + +[spv] +adjust_coordinate_space = true +debug = true +version = [1, 2] diff --git a/naga/tests/in/skybox.param.ron b/naga/tests/in/skybox.param.ron deleted file mode 100644 index 0b7061cc91..0000000000 --- a/naga/tests/in/skybox.param.ron +++ /dev/null @@ -1,68 +0,0 @@ -( - spv_flow_dump_prefix: "", - spv: ( - version: (1, 0), - debug: false, - adjust_coordinate_space: false, - ), - msl: ( - lang_version: (2, 1), - per_entry_point_map: { - "vs_main": ( - resources: { - (group: 0, binding: 0): (buffer: Some(0)), - }, - ), - "fs_main": ( - resources: { - (group: 0, binding: 1): (texture: Some(0)), - (group: 0, binding: 2): (sampler: Some(Inline(0))), - }, - ), - }, - inline_samplers: [ - ( - coord: Normalized, - address: (ClampToEdge, ClampToEdge, ClampToEdge), - mag_filter: Linear, - min_filter: Linear, - mip_filter: None, - border_color: TransparentBlack, - compare_func: Never, - lod_clamp: Some((start: 0.5, end: 10.0)), - max_anisotropy: Some(8), - ), - ], - spirv_cross_compatibility: false, - fake_missing_bindings: false, - zero_initialize_workgroup_memory: true, - ), - glsl: ( - version: Embedded( - version: 320, - is_webgl: false - ), - writer_flags: (""), - binding_map: { - (group: 0, binding: 0): 0, - (group: 0, binding: 1): 0, - }, - zero_initialize_workgroup_memory: true, - ), - hlsl: ( - shader_model: V5_1, - binding_map: { - (group: 0, binding: 0): (space: 0, register: 0), - (group: 0, binding: 1): (space: 0, register: 0), - (group: 0, binding: 2): (space: 1, register: 0), - }, - fake_missing_bindings: false, - sampler_buffer_binding_map: { - (group: 0): (space: 2, register: 0), - }, - special_constants_binding: Some((space: 0, register: 1)), - zero_initialize_workgroup_memory: true, - restrict_indexing: true - ), - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/skybox.toml b/naga/tests/in/skybox.toml new file mode 100644 index 0000000000..9e0b2741e1 --- /dev/null +++ b/naga/tests/in/skybox.toml @@ -0,0 +1,53 @@ +spv_flow_dump_prefix = "" +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" + +[msl] +fake_missing_bindings = false +lang_version = [2, 1] +zero_initialize_workgroup_memory = true + +[[msl.inline_samplers]] +coord = "Normalized" +address = ["ClampToEdge", "ClampToEdge", "ClampToEdge"] +mag_filter = "Linear" +min_filter = "Linear" +border_color = "TransparentBlack" +compare_func = "Never" +lod_clamp = { start = 0.5, end = 10.0 } +max_anisotropy = 8 + +[msl.per_entry_point_map.fs_main] +resources = [ + { resource_binding = { group = 0, binding = 1 }, bind_target = { texture = 0 } }, + { resource_binding = { group = 0, binding = 2 }, bind_target = { sampler.Inline = 0 } }, +] +[msl.per_entry_point_map.vs_main] +resources = [ + { resource_binding = { group = 0, binding = 0 }, bind_target = { buffer = 0 } }, +] + +[hlsl] +fake_missing_bindings = false +restrict_indexing = true +sampler_buffer_binding_map = [ + { group = 0, bind_target = { register = 0, space = 2 } }, +] +special_constants_binding = { register = 1, space = 0 } +zero_initialize_workgroup_memory = true +binding_map = [ + { resource_binding = { group = 0, binding = 0 }, bind_target = { register = 0, space = 0 } }, + { resource_binding = { group = 0, binding = 1 }, bind_target = { register = 0, space = 0 } }, + { resource_binding = { group = 0, binding = 2 }, bind_target = { register = 0, space = 1 } }, +] + +[glsl] +binding_map = [ + { resource_binding = { group = 0, binding = 0 }, bind_target = 0 }, + { resource_binding = { group = 0, binding = 1 }, bind_target = 0 }, +] +version.Embedded = { is_webgl = false, version = 320 } +writer_flags = "" +zero_initialize_workgroup_memory = true + +[spv] +version = [1, 0] diff --git a/naga/tests/in/sprite.param.ron b/naga/tests/in/sprite.param.ron deleted file mode 100644 index 7a8020ee7f..0000000000 --- a/naga/tests/in/sprite.param.ron +++ /dev/null @@ -1,6 +0,0 @@ -( - spv: ( - version: (1, 4), - ), - targets: "SPIRV", -) diff --git a/naga/tests/in/sprite.toml b/naga/tests/in/sprite.toml new file mode 100644 index 0000000000..97fd87b7ee --- /dev/null +++ b/naga/tests/in/sprite.toml @@ -0,0 +1,4 @@ +targets = "SPIRV" + +[spv] +version = [1, 4] diff --git a/naga/tests/in/spv/atomic_compare_exchange.param.ron b/naga/tests/in/spv/atomic_compare_exchange.param.ron deleted file mode 100644 index 5b9668558e..0000000000 --- a/naga/tests/in/spv/atomic_compare_exchange.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL", -) diff --git a/naga/tests/in/spv/atomic_compare_exchange.toml b/naga/tests/in/spv/atomic_compare_exchange.toml new file mode 100644 index 0000000000..07bac2c050 --- /dev/null +++ b/naga/tests/in/spv/atomic_compare_exchange.toml @@ -0,0 +1 @@ +targets = "WGSL" diff --git a/naga/tests/in/spv/atomic_exchange.param.ron b/naga/tests/in/spv/atomic_exchange.param.ron deleted file mode 100644 index 5b9668558e..0000000000 --- a/naga/tests/in/spv/atomic_exchange.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL", -) diff --git a/naga/tests/in/spv/atomic_exchange.toml b/naga/tests/in/spv/atomic_exchange.toml new file mode 100644 index 0000000000..07bac2c050 --- /dev/null +++ b/naga/tests/in/spv/atomic_exchange.toml @@ -0,0 +1 @@ +targets = "WGSL" diff --git a/naga/tests/in/spv/atomic_global_struct_field_vertex.param.ron b/naga/tests/in/spv/atomic_global_struct_field_vertex.param.ron deleted file mode 100644 index 5b9668558e..0000000000 --- a/naga/tests/in/spv/atomic_global_struct_field_vertex.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL", -) diff --git a/naga/tests/in/spv/atomic_global_struct_field_vertex.toml b/naga/tests/in/spv/atomic_global_struct_field_vertex.toml new file mode 100644 index 0000000000..07bac2c050 --- /dev/null +++ b/naga/tests/in/spv/atomic_global_struct_field_vertex.toml @@ -0,0 +1 @@ +targets = "WGSL" diff --git a/naga/tests/in/spv/atomic_i_add_sub.param.ron b/naga/tests/in/spv/atomic_i_add_sub.param.ron deleted file mode 100644 index 5b9668558e..0000000000 --- a/naga/tests/in/spv/atomic_i_add_sub.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL", -) diff --git a/naga/tests/in/spv/atomic_i_add_sub.toml b/naga/tests/in/spv/atomic_i_add_sub.toml new file mode 100644 index 0000000000..07bac2c050 --- /dev/null +++ b/naga/tests/in/spv/atomic_i_add_sub.toml @@ -0,0 +1 @@ +targets = "WGSL" diff --git a/naga/tests/in/spv/atomic_i_decrement.param.ron b/naga/tests/in/spv/atomic_i_decrement.param.ron deleted file mode 100644 index 5b9668558e..0000000000 --- a/naga/tests/in/spv/atomic_i_decrement.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL", -) diff --git a/naga/tests/in/spv/atomic_i_decrement.toml b/naga/tests/in/spv/atomic_i_decrement.toml new file mode 100644 index 0000000000..07bac2c050 --- /dev/null +++ b/naga/tests/in/spv/atomic_i_decrement.toml @@ -0,0 +1 @@ +targets = "WGSL" diff --git a/naga/tests/in/spv/atomic_i_increment.param.ron b/naga/tests/in/spv/atomic_i_increment.param.ron deleted file mode 100644 index 5b9668558e..0000000000 --- a/naga/tests/in/spv/atomic_i_increment.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL", -) diff --git a/naga/tests/in/spv/atomic_i_increment.toml b/naga/tests/in/spv/atomic_i_increment.toml new file mode 100644 index 0000000000..07bac2c050 --- /dev/null +++ b/naga/tests/in/spv/atomic_i_increment.toml @@ -0,0 +1 @@ +targets = "WGSL" diff --git a/naga/tests/in/spv/atomic_load_and_store.param.ron b/naga/tests/in/spv/atomic_load_and_store.param.ron deleted file mode 100644 index 5b9668558e..0000000000 --- a/naga/tests/in/spv/atomic_load_and_store.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL", -) diff --git a/naga/tests/in/spv/atomic_load_and_store.toml b/naga/tests/in/spv/atomic_load_and_store.toml new file mode 100644 index 0000000000..07bac2c050 --- /dev/null +++ b/naga/tests/in/spv/atomic_load_and_store.toml @@ -0,0 +1 @@ +targets = "WGSL" diff --git a/naga/tests/in/spv/binding-arrays.dynamic.param.ron b/naga/tests/in/spv/binding-arrays.dynamic.param.ron deleted file mode 100644 index 5b9668558e..0000000000 --- a/naga/tests/in/spv/binding-arrays.dynamic.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL", -) diff --git a/naga/tests/in/spv/binding-arrays.static.param.ron b/naga/tests/in/spv/binding-arrays.static.param.ron deleted file mode 100644 index 5b9668558e..0000000000 --- a/naga/tests/in/spv/binding-arrays.static.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL", -) diff --git a/naga/tests/in/spv/binding-arrays.toml b/naga/tests/in/spv/binding-arrays.toml new file mode 100644 index 0000000000..07bac2c050 --- /dev/null +++ b/naga/tests/in/spv/binding-arrays.toml @@ -0,0 +1 @@ +targets = "WGSL" diff --git a/naga/tests/in/spv/builtin-accessed-outside-entrypoint.param.ron b/naga/tests/in/spv/builtin-accessed-outside-entrypoint.param.ron deleted file mode 100644 index 5b9668558e..0000000000 --- a/naga/tests/in/spv/builtin-accessed-outside-entrypoint.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL", -) diff --git a/naga/tests/in/spv/builtin-accessed-outside-entrypoint.toml b/naga/tests/in/spv/builtin-accessed-outside-entrypoint.toml new file mode 100644 index 0000000000..07bac2c050 --- /dev/null +++ b/naga/tests/in/spv/builtin-accessed-outside-entrypoint.toml @@ -0,0 +1 @@ +targets = "WGSL" diff --git a/naga/tests/in/spv/degrees.param.ron b/naga/tests/in/spv/degrees.param.ron deleted file mode 100644 index 5f68811c44..0000000000 --- a/naga/tests/in/spv/degrees.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "", -) diff --git a/naga/tests/in/spv/degrees.toml b/naga/tests/in/spv/degrees.toml new file mode 100644 index 0000000000..841c79d319 --- /dev/null +++ b/naga/tests/in/spv/degrees.toml @@ -0,0 +1 @@ +targets = "" diff --git a/naga/tests/in/spv/do-while.param.ron b/naga/tests/in/spv/do-while.param.ron deleted file mode 100644 index 5277fe9f6f..0000000000 --- a/naga/tests/in/spv/do-while.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/spv/do-while.toml b/naga/tests/in/spv/do-while.toml new file mode 100644 index 0000000000..e74ee3b97b --- /dev/null +++ b/naga/tests/in/spv/do-while.toml @@ -0,0 +1 @@ +targets = "METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/spv/empty-global-name.param.ron b/naga/tests/in/spv/empty-global-name.param.ron deleted file mode 100644 index 65729aa2f8..0000000000 --- a/naga/tests/in/spv/empty-global-name.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "HLSL | WGSL | METAL", -) diff --git a/naga/tests/in/spv/empty-global-name.toml b/naga/tests/in/spv/empty-global-name.toml new file mode 100644 index 0000000000..36c7da2208 --- /dev/null +++ b/naga/tests/in/spv/empty-global-name.toml @@ -0,0 +1 @@ +targets = "HLSL | WGSL | METAL" diff --git a/naga/tests/in/spv/fetch_depth.param.ron b/naga/tests/in/spv/fetch_depth.param.ron deleted file mode 100644 index 22c5d9061b..0000000000 --- a/naga/tests/in/spv/fetch_depth.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "IR | SPIRV | METAL | HLSL | WGSL", -) diff --git a/naga/tests/in/spv/fetch_depth.toml b/naga/tests/in/spv/fetch_depth.toml new file mode 100644 index 0000000000..60d8ec2b3b --- /dev/null +++ b/naga/tests/in/spv/fetch_depth.toml @@ -0,0 +1 @@ +targets = "IR | SPIRV | METAL | HLSL | WGSL" diff --git a/naga/tests/in/spv/inv-hyperbolic-trig-functions.param.ron b/naga/tests/in/spv/inv-hyperbolic-trig-functions.param.ron deleted file mode 100644 index 6de6dd9078..0000000000 --- a/naga/tests/in/spv/inv-hyperbolic-trig-functions.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "HLSL | WGSL", -) diff --git a/naga/tests/in/spv/inv-hyperbolic-trig-functions.toml b/naga/tests/in/spv/inv-hyperbolic-trig-functions.toml new file mode 100644 index 0000000000..51fae57557 --- /dev/null +++ b/naga/tests/in/spv/inv-hyperbolic-trig-functions.toml @@ -0,0 +1 @@ +targets = "HLSL | WGSL" diff --git a/naga/tests/in/spv/quad-vert.param.ron b/naga/tests/in/spv/quad-vert.param.ron deleted file mode 100644 index 5277fe9f6f..0000000000 --- a/naga/tests/in/spv/quad-vert.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/spv/quad-vert.toml b/naga/tests/in/spv/quad-vert.toml new file mode 100644 index 0000000000..e74ee3b97b --- /dev/null +++ b/naga/tests/in/spv/quad-vert.toml @@ -0,0 +1 @@ +targets = "METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/spv/shadow.param.ron b/naga/tests/in/spv/shadow.param.ron deleted file mode 100644 index 481e239aa3..0000000000 --- a/naga/tests/in/spv/shadow.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "IR | ANALYSIS", -) diff --git a/naga/tests/in/spv/shadow.toml b/naga/tests/in/spv/shadow.toml new file mode 100644 index 0000000000..ba29513474 --- /dev/null +++ b/naga/tests/in/spv/shadow.toml @@ -0,0 +1 @@ +targets = "IR | ANALYSIS" diff --git a/naga/tests/in/spv/spec-constants-issue-5598.param.ron b/naga/tests/in/spv/spec-constants-issue-5598.param.ron deleted file mode 100644 index 10b8c634fe..0000000000 --- a/naga/tests/in/spv/spec-constants-issue-5598.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "GLSL", -) diff --git a/naga/tests/in/spv/spec-constants-issue-5598.toml b/naga/tests/in/spv/spec-constants-issue-5598.toml new file mode 100644 index 0000000000..205dba77a3 --- /dev/null +++ b/naga/tests/in/spv/spec-constants-issue-5598.toml @@ -0,0 +1 @@ +targets = "GLSL" diff --git a/naga/tests/in/spv/spec-constants.param.ron b/naga/tests/in/spv/spec-constants.param.ron deleted file mode 100644 index 8a613b6a5d..0000000000 --- a/naga/tests/in/spv/spec-constants.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "IR", -) diff --git a/naga/tests/in/spv/spec-constants.toml b/naga/tests/in/spv/spec-constants.toml new file mode 100644 index 0000000000..0c2104ee62 --- /dev/null +++ b/naga/tests/in/spv/spec-constants.toml @@ -0,0 +1 @@ +targets = "IR" diff --git a/naga/tests/in/spv/subgroup-operations-s.param.ron b/naga/tests/in/spv/subgroup-operations-s.param.ron deleted file mode 100644 index 4dba664ab9..0000000000 --- a/naga/tests/in/spv/subgroup-operations-s.param.ron +++ /dev/null @@ -1,29 +0,0 @@ -( - targets: "METAL | GLSL | HLSL | WGSL", - god_mode: true, - spv: ( - version: (1, 3), - ), - msl: ( - lang_version: (2, 4), - per_entry_point_map: {}, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: false, - zero_initialize_workgroup_memory: true, - ), - glsl: ( - version: Desktop(430), - writer_flags: (""), - binding_map: { }, - zero_initialize_workgroup_memory: true, - ), - hlsl: ( - shader_model: V6_0, - binding_map: {}, - fake_missing_bindings: true, - special_constants_binding: None, - zero_initialize_workgroup_memory: true, - restrict_indexing: true - ), -) diff --git a/naga/tests/in/spv/subgroup-operations-s.toml b/naga/tests/in/spv/subgroup-operations-s.toml new file mode 100644 index 0000000000..824a07e667 --- /dev/null +++ b/naga/tests/in/spv/subgroup-operations-s.toml @@ -0,0 +1,21 @@ +god_mode = true +targets = "METAL | GLSL | HLSL | WGSL" + +[msl] +fake_missing_bindings = false +lang_version = [2, 4] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[hlsl] +shader_model = "V6_0" +fake_missing_bindings = true +restrict_indexing = true +zero_initialize_workgroup_memory = true + +[glsl] +version.Desktop = 430 +zero_initialize_workgroup_memory = true + +[spv] +version = [1, 3] diff --git a/naga/tests/in/spv/unnamed-gl-per-vertex.param.ron b/naga/tests/in/spv/unnamed-gl-per-vertex.param.ron deleted file mode 100644 index 5277fe9f6f..0000000000 --- a/naga/tests/in/spv/unnamed-gl-per-vertex.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/spv/unnamed-gl-per-vertex.toml b/naga/tests/in/spv/unnamed-gl-per-vertex.toml new file mode 100644 index 0000000000..e74ee3b97b --- /dev/null +++ b/naga/tests/in/spv/unnamed-gl-per-vertex.toml @@ -0,0 +1 @@ +targets = "METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/standard.param.ron b/naga/tests/in/standard.param.ron deleted file mode 100644 index 810d119b86..0000000000 --- a/naga/tests/in/standard.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/standard.toml b/naga/tests/in/standard.toml new file mode 100644 index 0000000000..c9811b10d1 --- /dev/null +++ b/naga/tests/in/standard.toml @@ -0,0 +1 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" diff --git a/naga/tests/in/storage-textures.param.ron b/naga/tests/in/storage-textures.param.ron deleted file mode 100644 index 995cf878ca..0000000000 --- a/naga/tests/in/storage-textures.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "IR | ANALYSIS | SPIRV | METAL | HLSL", -) diff --git a/naga/tests/in/storage-textures.toml b/naga/tests/in/storage-textures.toml new file mode 100644 index 0000000000..dca135efec --- /dev/null +++ b/naga/tests/in/storage-textures.toml @@ -0,0 +1 @@ +targets = "IR | ANALYSIS | SPIRV | METAL | HLSL" diff --git a/naga/tests/in/struct-layout.param.ron b/naga/tests/in/struct-layout.param.ron deleted file mode 100644 index a10b27eabb..0000000000 --- a/naga/tests/in/struct-layout.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL | GLSL | SPIRV | HLSL | METAL", -) diff --git a/naga/tests/in/struct-layout.toml b/naga/tests/in/struct-layout.toml new file mode 100644 index 0000000000..32adb4cbc1 --- /dev/null +++ b/naga/tests/in/struct-layout.toml @@ -0,0 +1 @@ +targets = "WGSL | GLSL | SPIRV | HLSL | METAL" diff --git a/naga/tests/in/subgroup-operations.param.ron b/naga/tests/in/subgroup-operations.param.ron deleted file mode 100644 index 4a680e9aa8..0000000000 --- a/naga/tests/in/subgroup-operations.param.ron +++ /dev/null @@ -1,29 +0,0 @@ -( - god_mode: true, - spv: ( - version: (1, 3), - ), - msl: ( - lang_version: (2, 4), - per_entry_point_map: {}, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: false, - zero_initialize_workgroup_memory: true, - ), - glsl: ( - version: Desktop(430), - writer_flags: (""), - binding_map: { }, - zero_initialize_workgroup_memory: true, - ), - hlsl: ( - shader_model: V6_0, - binding_map: {}, - fake_missing_bindings: true, - special_constants_binding: None, - zero_initialize_workgroup_memory: true, - restrict_indexing: true - ), - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/subgroup-operations.toml b/naga/tests/in/subgroup-operations.toml new file mode 100644 index 0000000000..583ff4607a --- /dev/null +++ b/naga/tests/in/subgroup-operations.toml @@ -0,0 +1,21 @@ +god_mode = true +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" + +[msl] +fake_missing_bindings = false +lang_version = [2, 4] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[hlsl] +shader_model = "V6_0" +fake_missing_bindings = true +restrict_indexing = true +zero_initialize_workgroup_memory = true + +[glsl] +version.Desktop = 430 +zero_initialize_workgroup_memory = true + +[spv] +version = [1, 3] diff --git a/naga/tests/in/template-list-ge.param.ron b/naga/tests/in/template-list-ge.param.ron deleted file mode 100644 index a31912e4a7..0000000000 --- a/naga/tests/in/template-list-ge.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "", -) \ No newline at end of file diff --git a/naga/tests/in/template-list-ge.toml b/naga/tests/in/template-list-ge.toml new file mode 100644 index 0000000000..841c79d319 --- /dev/null +++ b/naga/tests/in/template-list-ge.toml @@ -0,0 +1 @@ +targets = "" diff --git a/naga/tests/in/texture-arg.param.ron b/naga/tests/in/texture-arg.param.ron deleted file mode 100644 index 46e3b15c34..0000000000 --- a/naga/tests/in/texture-arg.param.ron +++ /dev/null @@ -1,8 +0,0 @@ -( - spv: ( - version: (1, 0), - debug: true, - adjust_coordinate_space: true, - ), - targets: "SPIRV | METAL | GLSL | HLSL | WGSL", -) diff --git a/naga/tests/in/texture-arg.toml b/naga/tests/in/texture-arg.toml new file mode 100644 index 0000000000..1e1b1f57d2 --- /dev/null +++ b/naga/tests/in/texture-arg.toml @@ -0,0 +1,6 @@ +targets = "SPIRV | METAL | GLSL | HLSL | WGSL" + +[spv] +adjust_coordinate_space = true +debug = true +version = [1, 0] diff --git a/naga/tests/in/type-alias.param.ron b/naga/tests/in/type-alias.param.ron deleted file mode 100644 index 5b9668558e..0000000000 --- a/naga/tests/in/type-alias.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL", -) diff --git a/naga/tests/in/type-alias.toml b/naga/tests/in/type-alias.toml new file mode 100644 index 0000000000..07bac2c050 --- /dev/null +++ b/naga/tests/in/type-alias.toml @@ -0,0 +1 @@ +targets = "WGSL" diff --git a/naga/tests/in/unconsumed_vertex_outputs_frag.param.ron b/naga/tests/in/unconsumed_vertex_outputs_frag.param.ron deleted file mode 100644 index a92d1c5b00..0000000000 --- a/naga/tests/in/unconsumed_vertex_outputs_frag.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "HLSL", -) diff --git a/naga/tests/in/unconsumed_vertex_outputs_frag.toml b/naga/tests/in/unconsumed_vertex_outputs_frag.toml new file mode 100644 index 0000000000..3ca0b52f4e --- /dev/null +++ b/naga/tests/in/unconsumed_vertex_outputs_frag.toml @@ -0,0 +1 @@ +targets = "HLSL" diff --git a/naga/tests/in/unconsumed_vertex_outputs_vert.param.ron b/naga/tests/in/unconsumed_vertex_outputs_vert.param.ron deleted file mode 100644 index 398f6bc645..0000000000 --- a/naga/tests/in/unconsumed_vertex_outputs_vert.param.ron +++ /dev/null @@ -1,7 +0,0 @@ -( - targets: "HLSL", - fragment_module: Some(FragmentModule( - path: "unconsumed_vertex_outputs_frag.wgsl", - entry_point: "fs_main" - )), -) diff --git a/naga/tests/in/unconsumed_vertex_outputs_vert.toml b/naga/tests/in/unconsumed_vertex_outputs_vert.toml new file mode 100644 index 0000000000..7fef3aa572 --- /dev/null +++ b/naga/tests/in/unconsumed_vertex_outputs_vert.toml @@ -0,0 +1,2 @@ +fragment_module = { entry_point = "fs_main", path = "unconsumed_vertex_outputs_frag.wgsl" } +targets = "HLSL" diff --git a/naga/tests/in/use-gl-ext-over-grad-workaround-if-instructed.param.ron b/naga/tests/in/use-gl-ext-over-grad-workaround-if-instructed.param.ron deleted file mode 100644 index ff6243b368..0000000000 --- a/naga/tests/in/use-gl-ext-over-grad-workaround-if-instructed.param.ron +++ /dev/null @@ -1,12 +0,0 @@ -( - glsl: ( - writer_flags: ("TEXTURE_SHADOW_LOD"), - version: Embedded( - version: 320, - is_webgl: false - ), - binding_map: {}, - zero_initialize_workgroup_memory: true, - ), - targets: "GLSL", -) diff --git a/naga/tests/in/use-gl-ext-over-grad-workaround-if-instructed.toml b/naga/tests/in/use-gl-ext-over-grad-workaround-if-instructed.toml new file mode 100644 index 0000000000..734192329e --- /dev/null +++ b/naga/tests/in/use-gl-ext-over-grad-workaround-if-instructed.toml @@ -0,0 +1,6 @@ +targets = "GLSL" + +[glsl] +version.Embedded = { is_webgl = false, version = 320 } +writer_flags = "TEXTURE_SHADOW_LOD" +zero_initialize_workgroup_memory = true diff --git a/naga/tests/in/vertex-pulling-transform.param.ron b/naga/tests/in/vertex-pulling-transform.param.ron deleted file mode 100644 index c337314ca1..0000000000 --- a/naga/tests/in/vertex-pulling-transform.param.ron +++ /dev/null @@ -1,32 +0,0 @@ -( - msl_pipeline: ( - allow_and_force_point_size: false, - vertex_pulling_transform: true, - vertex_buffer_mappings: [( - id: 1, - stride: 20, - indexed_by_vertex: true, - attributes: [( - shader_location: 0, // position - offset: 0, - format: Float32, // too small, inflated to a vec4 - ), - ( - shader_location: 1, // normal - offset: 4, - format: Float32x4, // too big, truncated to a vec3 - )], - ), - ( - id: 2, - stride: 16, - indexed_by_vertex: false, - attributes: [( - shader_location: 2, // texcoord - offset: 0, - format: Float32x2, - )], - )], - ), - targets: "METAL", -) diff --git a/naga/tests/in/vertex-pulling-transform.toml b/naga/tests/in/vertex-pulling-transform.toml new file mode 100644 index 0000000000..d6cc7bfd2f --- /dev/null +++ b/naga/tests/in/vertex-pulling-transform.toml @@ -0,0 +1,20 @@ +targets = "METAL" + +[msl_pipeline] +allow_and_force_point_size = false +vertex_pulling_transform = true + +[[msl_pipeline.vertex_buffer_mappings]] +attributes = [ + { offset = 0, shader_location = 0, format = "Float32" }, + { offset = 4, shader_location = 1, format = "Float32x4" }, +] +id = 1 +indexed_by_vertex = true +stride = 20 + +[[msl_pipeline.vertex_buffer_mappings]] +attributes = [{ offset = 0, shader_location = 2, format = "Float32x2" }] +id = 2 +indexed_by_vertex = false +stride = 16 diff --git a/naga/tests/in/workgroup-uniform-load.param.ron b/naga/tests/in/workgroup-uniform-load.param.ron deleted file mode 100644 index a10b27eabb..0000000000 --- a/naga/tests/in/workgroup-uniform-load.param.ron +++ /dev/null @@ -1,3 +0,0 @@ -( - targets: "WGSL | GLSL | SPIRV | HLSL | METAL", -) diff --git a/naga/tests/in/workgroup-uniform-load.toml b/naga/tests/in/workgroup-uniform-load.toml new file mode 100644 index 0000000000..32adb4cbc1 --- /dev/null +++ b/naga/tests/in/workgroup-uniform-load.toml @@ -0,0 +1 @@ +targets = "WGSL | GLSL | SPIRV | HLSL | METAL" diff --git a/naga/tests/in/workgroup-var-init.param.ron b/naga/tests/in/workgroup-var-init.param.ron deleted file mode 100644 index 15c99d2a28..0000000000 --- a/naga/tests/in/workgroup-var-init.param.ron +++ /dev/null @@ -1,23 +0,0 @@ -( - spv: ( - version: (1, 1), - debug: true, - adjust_coordinate_space: false, - ), - msl: ( - lang_version: (1, 0), - per_entry_point_map: { - "main": ( - resources: { - (group: 0, binding: 0): (buffer: Some(0), mutable: true), - }, - sizes_buffer: None, - ), - }, - inline_samplers: [], - spirv_cross_compatibility: false, - fake_missing_bindings: false, - zero_initialize_workgroup_memory: true, - ), - targets: "WGSL | GLSL | SPIRV | HLSL | METAL", -) diff --git a/naga/tests/in/workgroup-var-init.toml b/naga/tests/in/workgroup-var-init.toml new file mode 100644 index 0000000000..331c22013d --- /dev/null +++ b/naga/tests/in/workgroup-var-init.toml @@ -0,0 +1,17 @@ +targets = "WGSL | GLSL | SPIRV | HLSL | METAL" + +[msl] +fake_missing_bindings = false +lang_version = [1, 0] +spirv_cross_compatibility = false +zero_initialize_workgroup_memory = true + +[msl.per_entry_point_map.main] +resources = [ + { bind_target = { buffer = 0, mutable = true }, resource_binding = { group = 0, binding = 0 } }, +] + +[spv] +adjust_coordinate_space = false +debug = true +version = [1, 1] diff --git a/naga/tests/snapshots.rs b/naga/tests/snapshots.rs index 2fea963d51..af97357c1a 100644 --- a/naga/tests/snapshots.rs +++ b/naga/tests/snapshots.rs @@ -48,6 +48,28 @@ impl Default for SpvOutVersion { } } +#[cfg(all(feature = "deserialize", spv_out))] +#[derive(serde::Deserialize)] +struct BindingMapSerialization { + resource_binding: naga::ResourceBinding, + bind_target: naga::back::spv::BindingInfo, +} + +#[cfg(all(feature = "deserialize", spv_out))] +fn deserialize_binding_map<'de, D>(deserializer: D) -> Result +where + D: serde::Deserializer<'de>, +{ + use serde::Deserialize; + + let vec = Vec::::deserialize(deserializer)?; + let mut map = naga::back::spv::BindingMap::default(); + for item in vec { + map.insert(item.resource_binding, item.bind_target); + } + Ok(map) +} + #[derive(Default, serde::Deserialize)] #[serde(default)] struct SpirvOutParameters { @@ -59,6 +81,7 @@ struct SpirvOutParameters { clamp_frag_depth: bool, separate_entry_points: bool, #[cfg(all(feature = "deserialize", spv_out))] + #[serde(deserialize_with = "deserialize_binding_map")] binding_map: naga::back::spv::BindingMap, } @@ -274,9 +297,9 @@ impl Input { /// Return this input's parameter file, parsed. fn read_parameters(&self) -> Parameters { let mut param_path = self.input_path(); - param_path.set_extension("param.ron"); + param_path.set_extension("toml"); match fs::read_to_string(¶m_path) { - Ok(string) => match ron::de::from_str(&string) { + Ok(string) => match toml::de::from_str(&string) { Ok(params) => params, Err(e) => panic!( "Couldn't parse param file: {} due to: {e}",