From c2e5d2468ad6a38cdb8a067da0678302f6cc6066 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 13 Sep 2019 15:59:15 -0400 Subject: Refactor render-test to make cross platform (#1053) * First pass of render-test refactor. * Make window construction a function that can choose an implementation. * Remove OpenGL as currently has windows dependency. * Disable Vulkan as Renderer impl has dependency on windows. * Pass Window in as parameter of 'update'. * Add win-window.cpp as was missing. * Fix warning on windows about signs during comparison. --- tools/slang-test/slang-test-main.cpp | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'tools/slang-test/slang-test-main.cpp') diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 42b9e9331..26d611181 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -751,26 +751,11 @@ static SlangResult _extractReflectionTestRequirements(const CommandLine& cmdLine return SLANG_OK; } -static SlangResult _tryUseCPURenderTest(TestContext* context, CommandLine& ioCmdLine) -{ - String exeName = Path::getFileNameWithoutExt(ioCmdLine.m_executable); - - if (exeName == "render-test") - { - bool useCPU = ioCmdLine.findArgIndex(UnownedStringSlice::fromLiteral("-cpu")) >= 0; - if (useCPU) - { - ioCmdLine.setExecutablePath(Path::combine(context->options.binDir, String("cpu-render-test") + ProcessUtil::getExecutableSuffix())); - } - } - return SLANG_OK; -} - static SlangResult _extractTestRequirements(const CommandLine& cmdLine, TestRequirements* ioInfo) { String exeName = Path::getFileNameWithoutExt(cmdLine.m_executable); - if (exeName == "render-test" || exeName == "cpu-render-test") + if (exeName == "render-test") { return _extractRenderTestRequirements(cmdLine, ioInfo); } @@ -830,8 +815,6 @@ static RenderApiFlags _getAvailableRenderApiFlags(TestContext* context) builder << "-" << RenderApiUtil::getApiName(apiType); cmdLine.addArg(builder); - _tryUseCPURenderTest(context, cmdLine); - // Run the render-test tool and see if the device could startup ExecuteResult exeRes; if (SLANG_SUCCEEDED(spawnAndWaitSharedLibrary(context, "device-startup", cmdLine, exeRes)) @@ -2071,8 +2054,6 @@ TestResult runComputeComparisonImpl(TestContext* context, TestInput& input, cons auto actualOutputFile = outputStem + ".actual.txt"; cmdLine.addArg(actualOutputFile); - _tryUseCPURenderTest(context, cmdLine); - if (context->isExecuting()) { // clear the stale actual output file first. This will allow us to detect error if render-test fails and outputs nothing. @@ -2188,8 +2169,6 @@ TestResult doRenderComparisonTestRun(TestContext* context, TestInput& input, cha cmdLine.addArg("-o"); cmdLine.addArg(outputStem + outputKind + ".png"); - _tryUseCPURenderTest(context, cmdLine); - ExecuteResult exeRes; TEST_RETURN_ON_DONE(spawnAndWait(context, outputStem, input.spawnType, cmdLine, exeRes)); -- cgit v1.2.3