Skip to content

Commit d2ddc59

Browse files
authored
Feature/test tool shared libraries (shader-slang#758)
* Remove circular reference to renderer on Vk & D3D12 DescriptorSetImpl * Refactor Stbi image loading such that memory is correctly freed when goes out of scope. Added Crt memory dump at termination. Reduced erroneous reporting by scoping TestContext. * Used capitalized acronym for STBImage to keep Tim happy. * Split out TestReporter - to just handle reporting test results Split out Options Made TestContext hold options, and the reporter Removed remaining memory leaks. * Small optimization for rawWrite, such that it directly writes over print.. * Improve comments on TestCategorySet * Fix typos in TestCategorySet * Made slangc a cpp file as part of slang-test (removing need for separate project/shared library). * * Made all test tools only available as dlls. * Made possible to invoke test tool dll from command line slang-test slangc [--bindir xxx] options to slangc * Fix Visual Studio projects that are no longer needed.
1 parent d43c566 commit d2ddc59

20 files changed

+240
-742
lines changed

premake5.lua

+3-36
Original file line numberDiff line numberDiff line change
@@ -338,27 +338,16 @@ function standardProject(name)
338338
end
339339

340340
function toolSharedLibrary(name)
341-
group "tool-shared-library"
341+
group "test-tool"
342342
-- specifying that the project lives under the `tools/` path.
343343
--
344-
baseSlangProject(name .. "-shared-library", "tools/" .. name)
344+
baseSlangProject(name .. "-tool", "tools/" .. name)
345345

346346
defines { "SLANG_SHARED_LIBRARY_TOOL" }
347347

348348
kind "SharedLib"
349349
end
350350

351-
function standardSharedLibraryProject(name)
352-
group "tool-shared-library"
353-
-- A standard project has its code under `source/`
354-
--
355-
baseSlangProject(name .. "-shared-library", "source/".. name)
356-
357-
defines { "SLANG_SHARED_LIBRARY_TOOL" }
358-
359-
kind "SharedLib"
360-
end
361-
362351
-- Finally we have the example programs that show how to use Slang.
363352
--
364353
function example(name)
@@ -460,11 +449,6 @@ tool "slang-test"
460449
-- to do its job:
461450
--
462451

463-
tool "slang-reflection-test"
464-
uuid "22C45F4F-FB6B-4535-BED1-D3F5D0C71047"
465-
includedirs { "." }
466-
links { "slang", "core" }
467-
468452
toolSharedLibrary "slang-reflection-test"
469453
uuid "C5ACCA6E-C04D-4B36-8516-3752B3C13C2F"
470454

@@ -487,19 +471,7 @@ toolSharedLibrary "slang-reflection-test"
487471
-- TODO: Fix that requirement.
488472
--
489473

490-
if os.target() == "windows" then
491-
tool "render-test"
492-
uuid "96610759-07B9-4EEB-A974-5C634A2E742B"
493-
includedirs { ".", "external", "source", "tools/gfx" }
494-
links { "core", "slang", "gfx" }
495-
496-
systemversion "10.0.14393.0"
497-
498-
-- For Windows targets, we want to copy d3dcompiler_47.dll,
499-
-- dxcompiler.dll, and dxil.dll from the Windows SDK redistributable
500-
-- directory into the output directory.
501-
postbuildcommands { '"$(SolutionDir)tools\\copy-hlsl-libs.bat" "$(WindowsSdkDir)Redist/D3D/%{cfg.platform:lower()}/" "%{cfg.targetdir}/"'}
502-
474+
if os.target() == "windows" then
503475
toolSharedLibrary "render-test"
504476
uuid "61F7EB00-7281-4BF3-9470-7C2EA92620C3"
505477

@@ -553,11 +525,6 @@ standardProject "slangc"
553525
uuid "D56CBCEB-1EB5-4CA8-AEC4-48EA35ED61C7"
554526
kind "ConsoleApp"
555527
links { "core", "slang" }
556-
557-
standardSharedLibraryProject "slangc"
558-
uuid "644921BF-D228-4EEF-8CDA-11716DB06989"
559-
kind "SharedLib"
560-
links { "core", "slang" }
561528

562529
--
563530
-- TODO: Slang's current `Makefile` build does some careful incantations

slang.sln

+5-38
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slang-generate", "tools\sla
1515
EndProject
1616
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slang-test", "tools\slang-test\slang-test.vcxproj", "{0C768A18-1D25-4000-9F37-DA5FE99E3B64}"
1717
EndProject
18-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slang-reflection-test", "tools\slang-reflection-test\slang-reflection-test.vcxproj", "{22C45F4F-FB6B-4535-BED1-D3F5D0C71047}"
19-
EndProject
20-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "render-test", "tools\render-test\render-test.vcxproj", "{96610759-07B9-4EEB-A974-5C634A2E742B}"
21-
EndProject
2218
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gfx", "tools\gfx\gfx.vcxproj", "{222F7498-B40C-4F3F-A704-DDEB91A4484A}"
2319
EndProject
24-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tool-shared-library", "tool-shared-library", "{3082A9DB-9C44-DD65-E5F4-6BF251F6B543}"
25-
EndProject
26-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slang-reflection-test-shared-library", "tools\slang-reflection-test\slang-reflection-test-shared-library.vcxproj", "{C5ACCA6E-C04D-4B36-8516-3752B3C13C2F}"
20+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test-tool", "test-tool", "{57B5AA5E-C340-1823-CC51-9B17385C7423}"
2721
EndProject
28-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "render-test-shared-library", "tools\render-test\render-test-shared-library.vcxproj", "{61F7EB00-7281-4BF3-9470-7C2EA92620C3}"
22+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slang-reflection-test-tool", "tools\slang-reflection-test\slang-reflection-test-tool.vcxproj", "{C5ACCA6E-C04D-4B36-8516-3752B3C13C2F}"
2923
EndProject
30-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slangc-shared-library", "source\slangc\slangc-shared-library.vcxproj", "{644921BF-D228-4EEF-8CDA-11716DB06989}"
24+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "render-test-tool", "tools\render-test\render-test-tool.vcxproj", "{61F7EB00-7281-4BF3-9470-7C2EA92620C3}"
3125
EndProject
3226
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slangc", "source\slangc\slangc.vcxproj", "{D56CBCEB-1EB5-4CA8-AEC4-48EA35ED61C7}"
3327
EndProject
@@ -86,22 +80,6 @@ Global
8680
{0C768A18-1D25-4000-9F37-DA5FE99E3B64}.Release|Win32.Build.0 = Release|Win32
8781
{0C768A18-1D25-4000-9F37-DA5FE99E3B64}.Release|x64.ActiveCfg = Release|x64
8882
{0C768A18-1D25-4000-9F37-DA5FE99E3B64}.Release|x64.Build.0 = Release|x64
89-
{22C45F4F-FB6B-4535-BED1-D3F5D0C71047}.Debug|Win32.ActiveCfg = Debug|Win32
90-
{22C45F4F-FB6B-4535-BED1-D3F5D0C71047}.Debug|Win32.Build.0 = Debug|Win32
91-
{22C45F4F-FB6B-4535-BED1-D3F5D0C71047}.Debug|x64.ActiveCfg = Debug|x64
92-
{22C45F4F-FB6B-4535-BED1-D3F5D0C71047}.Debug|x64.Build.0 = Debug|x64
93-
{22C45F4F-FB6B-4535-BED1-D3F5D0C71047}.Release|Win32.ActiveCfg = Release|Win32
94-
{22C45F4F-FB6B-4535-BED1-D3F5D0C71047}.Release|Win32.Build.0 = Release|Win32
95-
{22C45F4F-FB6B-4535-BED1-D3F5D0C71047}.Release|x64.ActiveCfg = Release|x64
96-
{22C45F4F-FB6B-4535-BED1-D3F5D0C71047}.Release|x64.Build.0 = Release|x64
97-
{96610759-07B9-4EEB-A974-5C634A2E742B}.Debug|Win32.ActiveCfg = Debug|Win32
98-
{96610759-07B9-4EEB-A974-5C634A2E742B}.Debug|Win32.Build.0 = Debug|Win32
99-
{96610759-07B9-4EEB-A974-5C634A2E742B}.Debug|x64.ActiveCfg = Debug|x64
100-
{96610759-07B9-4EEB-A974-5C634A2E742B}.Debug|x64.Build.0 = Debug|x64
101-
{96610759-07B9-4EEB-A974-5C634A2E742B}.Release|Win32.ActiveCfg = Release|Win32
102-
{96610759-07B9-4EEB-A974-5C634A2E742B}.Release|Win32.Build.0 = Release|Win32
103-
{96610759-07B9-4EEB-A974-5C634A2E742B}.Release|x64.ActiveCfg = Release|x64
104-
{96610759-07B9-4EEB-A974-5C634A2E742B}.Release|x64.Build.0 = Release|x64
10583
{222F7498-B40C-4F3F-A704-DDEB91A4484A}.Debug|Win32.ActiveCfg = Debug|Win32
10684
{222F7498-B40C-4F3F-A704-DDEB91A4484A}.Debug|Win32.Build.0 = Debug|Win32
10785
{222F7498-B40C-4F3F-A704-DDEB91A4484A}.Debug|x64.ActiveCfg = Debug|x64
@@ -126,14 +104,6 @@ Global
126104
{61F7EB00-7281-4BF3-9470-7C2EA92620C3}.Release|Win32.Build.0 = Release|Win32
127105
{61F7EB00-7281-4BF3-9470-7C2EA92620C3}.Release|x64.ActiveCfg = Release|x64
128106
{61F7EB00-7281-4BF3-9470-7C2EA92620C3}.Release|x64.Build.0 = Release|x64
129-
{644921BF-D228-4EEF-8CDA-11716DB06989}.Debug|Win32.ActiveCfg = Debug|Win32
130-
{644921BF-D228-4EEF-8CDA-11716DB06989}.Debug|Win32.Build.0 = Debug|Win32
131-
{644921BF-D228-4EEF-8CDA-11716DB06989}.Debug|x64.ActiveCfg = Debug|x64
132-
{644921BF-D228-4EEF-8CDA-11716DB06989}.Debug|x64.Build.0 = Debug|x64
133-
{644921BF-D228-4EEF-8CDA-11716DB06989}.Release|Win32.ActiveCfg = Release|Win32
134-
{644921BF-D228-4EEF-8CDA-11716DB06989}.Release|Win32.Build.0 = Release|Win32
135-
{644921BF-D228-4EEF-8CDA-11716DB06989}.Release|x64.ActiveCfg = Release|x64
136-
{644921BF-D228-4EEF-8CDA-11716DB06989}.Release|x64.Build.0 = Release|x64
137107
{D56CBCEB-1EB5-4CA8-AEC4-48EA35ED61C7}.Debug|Win32.ActiveCfg = Debug|Win32
138108
{D56CBCEB-1EB5-4CA8-AEC4-48EA35ED61C7}.Debug|Win32.Build.0 = Debug|Win32
139109
{D56CBCEB-1EB5-4CA8-AEC4-48EA35ED61C7}.Debug|x64.ActiveCfg = Debug|x64
@@ -167,11 +137,8 @@ Global
167137
{2F8724C6-1BC3-2730-84D5-3F277030D04A} = {EB5FC2C6-D72D-B6CC-C0C1-26F3AC2E9231}
168138
{66174227-8541-41FC-A6DF-4764FC66F78E} = {FD47AE19-69FD-260F-F2F1-20E65EA61D13}
169139
{0C768A18-1D25-4000-9F37-DA5FE99E3B64} = {FD47AE19-69FD-260F-F2F1-20E65EA61D13}
170-
{22C45F4F-FB6B-4535-BED1-D3F5D0C71047} = {FD47AE19-69FD-260F-F2F1-20E65EA61D13}
171-
{96610759-07B9-4EEB-A974-5C634A2E742B} = {FD47AE19-69FD-260F-F2F1-20E65EA61D13}
172140
{222F7498-B40C-4F3F-A704-DDEB91A4484A} = {FD47AE19-69FD-260F-F2F1-20E65EA61D13}
173-
{C5ACCA6E-C04D-4B36-8516-3752B3C13C2F} = {3082A9DB-9C44-DD65-E5F4-6BF251F6B543}
174-
{61F7EB00-7281-4BF3-9470-7C2EA92620C3} = {3082A9DB-9C44-DD65-E5F4-6BF251F6B543}
175-
{644921BF-D228-4EEF-8CDA-11716DB06989} = {3082A9DB-9C44-DD65-E5F4-6BF251F6B543}
141+
{C5ACCA6E-C04D-4B36-8516-3752B3C13C2F} = {57B5AA5E-C340-1823-CC51-9B17385C7423}
142+
{61F7EB00-7281-4BF3-9470-7C2EA92620C3} = {57B5AA5E-C340-1823-CC51-9B17385C7423}
176143
EndGlobalSection
177144
EndGlobal

source/slangc/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ int wmain(int argc, wchar_t** argv)
9797
int result = 0;
9898

9999
{
100-
// Conver the wide-character Unicode arguments to UTF-8,
100+
// Convert the wide-character Unicode arguments to UTF-8,
101101
// since that is what Slang expects on the API side.
102102

103103
List<String> args;

source/slangc/slangc-shared-library.vcxproj

-178
This file was deleted.

0 commit comments

Comments
 (0)