From bd6dbaf7c3ea720b4ed39904fe08878f9dcbd947 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 21 Aug 2023 17:07:34 -0700 Subject: Compile append and consume structured buffers to glsl. (#3142) * Compile append and consume structured buffers to glsl. * Fix. * Update CI config. --------- Co-authored-by: Yong He --- source/slang/slang-emit.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/slang/slang-emit.cpp') diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 6521b05ba..03d62b540 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -31,6 +31,7 @@ #include "slang-ir-legalize-varying-params.h" #include "slang-ir-link.h" #include "slang-ir-com-interface.h" +#include "slang-ir-lower-append-consume-structured-buffer.h" #include "slang-ir-lower-binding-query.h" #include "slang-ir-lower-generics.h" #include "slang-ir-lower-tuple-types.h" @@ -494,6 +495,14 @@ Result linkAndOptimizeIR( validateIRModuleIfEnabled(codeGenContext, irModule); + // On non-HLSL targets, there isn't an implementation of `AppendStructuredBuffer` + // and `ConsumeStructuredBuffer` types, so we lower them into normal struct types + // of `RWStructuredBuffer` typed fields now. + if (target != CodeGenTarget::HLSL) + { + lowerAppendConsumeStructuredBuffers(targetRequest, irModule, sink); + } + // We don't need the legalize pass for C/C++ based types if(options.shouldLegalizeExistentialAndResourceTypes ) { -- cgit v1.2.3