From 9a23a9aab3721828526c921db1e779008e133e8f Mon Sep 17 00:00:00 2001 From: Yong He Date: Sat, 8 Jun 2024 05:12:49 -0700 Subject: SPIRV `Block` decoration fixes. (#4303) * SPIRV `Block` decoration fixes. - SPIRV does not allow duplicate `Block` decorations. So we shouldn't be generating them. - Also fixes duplication of OpName. - SPIRV and HLSL do not allow ConstantBuffer with trailing unsized arrays. Added a check in the front-end against such code. * Convert failing cross-compile tests to filecheck. --------- Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> --- source/slang/slang-compiler.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'source/slang/slang-compiler.cpp') diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index 147d4a889..0277bb092 100644 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -433,6 +433,44 @@ namespace Slang return UnownedStringSlice(); } + Stage getStageFromAtom(CapabilityAtom atom) + { + switch (atom) + { + case CapabilityAtom::vertex: + return Stage::Vertex; + case CapabilityAtom::hull: + return Stage::Hull; + case CapabilityAtom::domain: + return Stage::Domain; + case CapabilityAtom::geometry: + return Stage::Geometry; + case CapabilityAtom::fragment: + return Stage::Fragment; + case CapabilityAtom::compute: + return Stage::Compute; + case CapabilityAtom::mesh: + return Stage::Mesh; + case CapabilityAtom::amplification: + return Stage::Amplification; + case CapabilityAtom::anyhit: + return Stage::AnyHit; + case CapabilityAtom::closesthit: + return Stage::ClosestHit; + case CapabilityAtom::intersection: + return Stage::Intersection; + case CapabilityAtom::raygen: + return Stage::RayGeneration; + case CapabilityAtom::miss: + return Stage::Miss; + case CapabilityAtom::callable: + return Stage::Callable; + default: + SLANG_UNEXPECTED("unknown stage atom"); + UNREACHABLE_RETURN(Stage::Unknown); + } + } + SlangResult checkExternalCompilerSupport(Session* session, PassThroughMode passThrough) { // Check if the type is supported on this compile -- cgit v1.2.3