From 047daae9300c8a94d28383cf992ce00e3ad2da1e Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 9 Sep 2019 13:54:31 -0400 Subject: CPU compute testing on non windows targets (#1045) * WIP: Refactor of CPUCompute and stand alone cpu-render-test * Fix compilation on CygWin. * Make CPU compute tests run on non windows targets. * Check that C/C++ compiler is available for CPU compute. * Fix some tabbing issues. * Add -fPIC on gfx * Use dxcompiler_47.dll from slang-binaries on windows. * make https for git module slang-binaries * Fix comment in premake5.lua around d3dcompiler_47.dll * Add resources to the CPUComputeUtil::Context to keep in scope. * Fixes problem compiling on cygwin where dx12 is included in build of gfx lib. --- tools/render-test/slang-support.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tools/render-test/slang-support.h') diff --git a/tools/render-test/slang-support.h b/tools/render-test/slang-support.h index 662098546..543ab3258 100644 --- a/tools/render-test/slang-support.h +++ b/tools/render-test/slang-support.h @@ -6,6 +6,7 @@ #include #include "shader-input-layout.h" +#include "options.h" namespace renderer_test { @@ -33,6 +34,12 @@ struct ShaderCompilerUtil } void reset() { + { + desc.pipelineType = PipelineType::Unknown; + desc.kernels = nullptr; + desc.kernelCount = 0; + } + kernelDescs.clear(); if (request && session) { @@ -52,8 +59,20 @@ struct ShaderCompilerUtil ShaderProgram::Desc desc; SlangCompileRequest* request = nullptr; SlangSession* session = nullptr; + }; + struct OutputAndLayout + { + Output output; + ShaderInputLayout layout; + Slang::String sourcePath; + }; + + static SlangResult compileWithLayout(SlangSession* session, const Slang::String& sourcePath, Options::ShaderProgramType shaderType, const ShaderCompilerUtil::Input& input, OutputAndLayout& output); + + static SlangResult readSource(const Slang::String& inSourcePath, List& outSourceText); + static SlangResult compileProgram(SlangSession* session, const Input& input, const ShaderCompileRequest& request, Output& out); }; -- cgit v1.2.3