summaryrefslogtreecommitdiffstats
path: root/tools/render-test
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-04-08 21:10:30 -0700
committerGitHub <noreply@github.com>2021-04-08 21:10:30 -0700
commit8a71039475212fb1e1a6dd2fd2911d02769637ef (patch)
tree0faa6e773d6b40c3dcbf0eed08217c629f8ebccf /tools/render-test
parentd27557d9b770810402a0bf99bcd891c145a1a69d (diff)
Improve robustness of gfx lifetime management. (#1788)
* Improve robustness of gfx lifetime management. * fix clang error * fix clang error * Fix clang warning
Diffstat (limited to 'tools/render-test')
-rw-r--r--tools/render-test/render-test-main.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp
index 6e45e5b24..43273acf6 100644
--- a/tools/render-test/render-test-main.cpp
+++ b/tools/render-test/render-test-main.cpp
@@ -117,7 +117,7 @@ protected:
// variables for state to be used for rendering...
uintptr_t m_constantBufferSize;
- ComPtr<IDevice> m_device;
+ IDevice* m_device;
ComPtr<ICommandQueue> m_queue;
ComPtr<ITransientResourceHeap> m_transientHeap;
ComPtr<IRenderPassLayout> m_renderPass;
@@ -641,16 +641,6 @@ void RenderTestApp::runCompute(IComputeCommandEncoder* encoder)
void RenderTestApp::finalize()
{
- m_inputLayout = nullptr;
- m_vertexBuffer = nullptr;
- m_shaderProgram = nullptr;
- m_pipelineState = nullptr;
- m_renderPass = nullptr;
- m_framebuffer = nullptr;
- m_framebufferLayout = nullptr;
- m_colorBuffer = nullptr;
- m_queue = nullptr;
- m_device = nullptr;
}
Result RenderTestApp::writeBindingOutput(const char* fileName)
@@ -840,7 +830,11 @@ static SlangResult _setSessionPrelude(const Options& options, const char* exePat
SLANG_RETURN_ON_FAIL(TestToolUtil::getRootPath(exePath, rootPath));
String includePath;
- SLANG_RETURN_ON_FAIL(TestToolUtil::getIncludePath(rootPath, "external/nvapi/nvHLSLExtns.h", includePath));
+ if (TestToolUtil::getIncludePath(rootPath, "external/nvapi/nvHLSLExtns.h", includePath) !=
+ SLANG_OK)
+ {
+ return SLANG_FAIL;
+ }
StringBuilder buf;
// We have to choose a slot that NVAPI will use.
@@ -1129,8 +1123,8 @@ static SlangResult _innerMain(Slang::StdWriters* stdWriters, SlangSession* sessi
app.update();
renderDocEndFrame();
app.finalize();
- return SLANG_OK;
}
+ return SLANG_OK;
}
SLANG_TEST_TOOL_API SlangResult innerMain(Slang::StdWriters* stdWriters, SlangSession* sharedSession, int inArgc, const char*const* inArgv)