From 5dd27a26da9b6b6191f3b1eba0f38f85714c1ae3 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 17 Apr 2024 22:14:34 -0700 Subject: Support combined texture sampler when targeting HLSL. (#3963) * Support combined texture sampler when targeting HLSL. * Fix glsl intrinsics. * Update source/slang/slang-ir-lower-combined-texture-sampler.cpp Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> * Update source/slang/slang-ir-lower-combined-texture-sampler.cpp Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> * Update source/slang/slang-ir-lower-combined-texture-sampler.cpp Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> * Fix., * Enhance test. * Remove unused field. * Fix indentation --------- Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> --- source/slang/slang-emit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/slang/slang-emit.cpp') diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index 633d17345..c00c7bfc3 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -45,6 +45,7 @@ #include "slang-ir-lower-result-type.h" #include "slang-ir-lower-optional-type.h" #include "slang-ir-lower-bit-cast.h" +#include "slang-ir-lower-combined-texture-sampler.h" #include "slang-ir-lower-l-value-cast.h" #include "slang-ir-lower-size-of.h" #include "slang-ir-lower-reinterpret.h" @@ -545,6 +546,11 @@ Result linkAndOptimizeIR( lowerAppendConsumeStructuredBuffers(targetProgram, irModule, sink); } + if (target == CodeGenTarget::HLSL || ArtifactDescUtil::isCpuLikeTarget(artifactDesc)) + { + lowerCombinedTextureSamplers(irModule, sink); + } + addUserTypeHintDecorations(irModule); // We don't need the legalize pass for C/C++ based types -- cgit v1.2.3