From 1bbc421a663bd494cc1a4dd097852553049cc1d5 Mon Sep 17 00:00:00 2001 From: cheneym2 Date: Wed, 9 Oct 2024 14:42:13 -0400 Subject: Fix precompiled glsl modules (#5230) When precompiling modules defined with glsl, it's necessary to link in the glsl definition module. Reuse the public fillRequirements declaration --- source/slang/slang-check-impl.h | 4 ++++ source/slang/slang-compiler-tu.cpp | 3 +++ 2 files changed, 7 insertions(+) (limited to 'source') diff --git a/source/slang/slang-check-impl.h b/source/slang/slang-check-impl.h index 63c16e6d2..2f3eae0c5 100644 --- a/source/slang/slang-check-impl.h +++ b/source/slang/slang-check-impl.h @@ -38,6 +38,10 @@ namespace Slang bool isUniformParameterType(Type* type); + /// Create a new component type based on `inComponentType`, but with all its requiremetns filled. + RefPtr fillRequirements( + ComponentType* inComponentType); + Type* checkProperType( Linkage* linkage, TypeExp typeExp, diff --git a/source/slang/slang-compiler-tu.cpp b/source/slang/slang-compiler-tu.cpp index 8ae06a419..49595117d 100644 --- a/source/slang/slang-compiler-tu.cpp +++ b/source/slang/slang-compiler-tu.cpp @@ -6,6 +6,7 @@ #include "slang-ir-insts.h" #include "slang-ir-util.h" #include "slang-capability.h" +#include "slang-check-impl.h" namespace Slang { @@ -117,6 +118,8 @@ namespace Slang linkage, allComponentTypes); + composite = fillRequirements(composite); + TargetProgram tp(composite, targetReq); tp.getOrCreateLayout(&sink); Slang::Index const entryPointCount = m_entryPoints.getCount(); -- cgit v1.2.3