From 51f0701989ac4730cd87f0d8c656a1c6b1618255 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Wed, 3 Jan 2018 10:17:17 -0800 Subject: Fix struct decl order again (#348) * Add core.natvis file to Slang DLL build It seems that when `slang.dll` gets loaded into a user's project, the debugger is able to pick up the custom visualizers implemented in `slang.natvis` (which is directly added to the DLL project) but not `core.natvis` (which is added to a static library project that the DLL project references). Adding `core.natvis` to the DLL project directly seems to resolve this and greatly improve the debugging experience when in user code. * Bug fix: emit type of CB before CB when using IR The problem here was the logic for emitting types used by an IR declaration before the declaration. I refactored it to share logic between variables with initializers and functions, but in doing so failed to have an ordinary variable (which includes constant buffers) ensure that its own type was emitted before the variable. This is a one-line fix. --- source/slang/emit.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source/slang/emit.cpp') diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index 080478225..e60941e50 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -7122,6 +7122,7 @@ emitDeclImpl(decl, nullptr); case kIROp_global_var: { auto irGlobal = (IRGlobalVar*) value; + emitIRUsedType(ctx, irGlobal->type); emitIRUsedTypesForGlobalValueWithCode(ctx, irGlobal); } break; -- cgit v1.2.3