You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NZSL_SHADERLANG_COMPILER_ERROR(ModuleFeatureNotEnabled, "using {} requires module feature {} to be enabled", std::string, Ast::ModuleFeature)
143
144
NZSL_SHADERLANG_COMPILER_ERROR(ModuleNotFound, "module {} not found", std::string)
144
145
NZSL_SHADERLANG_COMPILER_ERROR(MultiplePushConstant, "there can be only one push constant external in a shader stage", std::string)
145
146
NZSL_SHADERLANG_COMPILER_ERROR(NoModuleResolver, "import statement found but no module resolver has been set (and partial compilation is not enabled)")
NZSL_SHADERLANG_COMPILER_ERROR(UnknownMethod, "type {} has no method {}", std::string, std::string)
171
172
NZSL_SHADERLANG_COMPILER_ERROR(UnmatchingTypes, "left expression type ({}) doesn't match right expression type ({})", std::string, std::string)
172
173
NZSL_SHADERLANG_COMPILER_ERROR(UnsupportedAttributeOnStage, "{} entry-point doesn't support {} attribute", std::string, std::string)
174
+
NZSL_SHADERLANG_COMPILER_ERROR(UnsupportedFeature, "\"{}\" feature requires NZSL {} (current module version is {})", std::string, VersionTag, VersionTag)
173
175
NZSL_SHADERLANG_COMPILER_ERROR(VarDeclarationMissingTypeAndValue, "variable must either have a type or an initial value")
174
176
NZSL_SHADERLANG_COMPILER_ERROR(VarDeclarationOutsideOfFunction, "global variables outside of external blocks are forbidden")
175
177
NZSL_SHADERLANG_COMPILER_ERROR(VarDeclarationTypeUnmatching, "initial expression type ({}) doesn't match specified type ({})", std::string, std::string)
)"), "(7,9 -> 11): CModuleFeatureNotEnabled error: using f64 requires module feature float64 to be enabled");
735
735
736
736
// Primitive externals
737
737
CHECK_THROWS_WITH(Compile(R"(
@@ -745,6 +745,30 @@ external
745
745
)"), "(7,15 -> 29): CExtTypeNotAllowed error: external variable data has unauthorized type (mat4[f32]): only storage buffers, samplers, push constants and uniform buffers (and primitives, vectors and matrices if primitive external feature is enabled) are allowed in external blocks");
746
746
}
747
747
748
+
// NZSL 1.1 features
749
+
750
+
// Implicit types
751
+
CHECK_THROWS_WITH(Compile(R"(
752
+
[nzsl_version("1.0")]
753
+
module;
754
+
755
+
fn main()
756
+
{
757
+
let v = vec3(1, 2, 3);
758
+
}
759
+
)"), "(7,10 -> 22): CUnsupportedFeature error: \"implicit types\" feature requires NZSL 1.1 (current module version is 1.0)");
760
+
761
+
// Type constants
762
+
CHECK_THROWS_WITH(Compile(R"(
763
+
[nzsl_version("1.0")]
764
+
module;
765
+
766
+
fn main()
767
+
{
768
+
let x = u32.Max;
769
+
}
770
+
)"), "(7,10 -> 16): CUnsupportedFeature error: \"type constant\" feature requires NZSL 1.1 (current module version is 1.0)");
0 commit comments