From 5a0224a0773f6d7f5eae8515424af5fa8faa9c14 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 26 Sep 2024 09:44:08 -0700 Subject: Move texture format inference to frontend and add reflection api for it. (#5155) --- source/slang/slang-emit.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/slang/slang-emit.cpp') diff --git a/source/slang/slang-emit.cpp b/source/slang/slang-emit.cpp index a29142ba1..97ee2a595 100644 --- a/source/slang/slang-emit.cpp +++ b/source/slang/slang-emit.cpp @@ -63,6 +63,7 @@ #include "slang-ir-redundancy-removal.h" #include "slang-ir-restructure.h" #include "slang-ir-restructure-scoping.h" +#include "slang-ir-resolve-texture-format.h" #include "slang-ir-sccp.h" #include "slang-ir-specialize.h" #include "slang-ir-specialize-arrays.h" @@ -1251,6 +1252,15 @@ Result linkAndOptimizeIR( break; } + switch (target) + { + case CodeGenTarget::GLSL: + case CodeGenTarget::SPIRV: + case CodeGenTarget::WGSL: + resolveTextureFormat(irModule); + break; + } + // For GLSL only, we will need to perform "legalization" of // the entry point and any entry-point parameters. // -- cgit v1.2.3