From e21d5ad650130631e17662ce8f22d15315ab597a Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 21 Nov 2018 13:41:34 -0500 Subject: Feature/early depth stencil (#727) * First pass support for early depth stencil. * Add a simple test to check if output has attributes. * Use cross compilation to test [earlydepthstencil] on glsl. * If target is dxil, use dxc to test against. Add hlsl to test earlydepthstencil against. * * Added spSessionHasCompileTargetSupport * Made slang-test use spSessionHasCompileTargetSupport to ignore tests that cannot run --- tools/slang-test/test-context.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'tools/slang-test/test-context.cpp') diff --git a/tools/slang-test/test-context.cpp b/tools/slang-test/test-context.cpp index 158258873..b94435a8e 100644 --- a/tools/slang-test/test-context.cpp +++ b/tools/slang-test/test-context.cpp @@ -69,8 +69,8 @@ static void appendXmlEncode(const String& in, StringBuilder& out) } } -TestContext::TestContext(TestOutputMode outputMode) : - m_outputMode(outputMode) +TestContext::TestContext() : + m_outputMode(TestOutputMode::Default) { m_totalTestCount = 0; m_passedTestCount = 0; @@ -82,6 +82,29 @@ TestContext::TestContext(TestOutputMode outputMode) : m_inTest = false; m_dumpOutputOnFailure = false; m_isVerbose = false; + + m_session = nullptr; +} + +Result TestContext::init(TestOutputMode outputMode) +{ + m_outputMode = outputMode; + + m_session = spCreateSession(nullptr); + if (!m_session) + { + return SLANG_FAIL; + } + + return SLANG_OK; +} + +TestContext::~TestContext() +{ + if (m_session) + { + spDestroySession(m_session); + } } bool TestContext::canWriteStdError() const @@ -601,4 +624,4 @@ void TestContext::endSuite() } m_suiteStack.RemoveLast(); -} \ No newline at end of file +} -- cgit v1.2.3