summaryrefslogtreecommitdiffstats
path: root/tools/render-test
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-02-14 11:24:40 -0500
committerGitHub <noreply@github.com>2019-02-14 11:24:40 -0500
commit4cd317bcae0a13dc2bbb78448c8d60cd1dcc76bd (patch)
treef98d0112024421b2bc7d613242109bde6f95f0cb /tools/render-test
parentb059de80b7619e4406dbddf26fd7f2fb7ce6a965 (diff)
Fix for Dx12 to stop crash when dxil cannot be handled by driver (#851)
* If there is a problem with initialize RenderTestApp::initialize constructing the pipeline, this was not being reported as an error causing a later crash. * Use same style to return error.
Diffstat (limited to 'tools/render-test')
-rw-r--r--tools/render-test/render-test-main.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp
index 7dde38ae6..d3a7acf37 100644
--- a/tools/render-test/render-test-main.cpp
+++ b/tools/render-test/render-test-main.cpp
@@ -332,7 +332,8 @@ SlangResult RenderTestApp::initialize(Renderer* renderer, ShaderCompiler* shader
}
}
- return SLANG_OK;
+ // If success must have a pipeline state
+ return m_pipelineState ? SLANG_OK : SLANG_FAIL;
}
Result RenderTestApp::initializeShaders(ShaderCompiler* shaderCompiler)
@@ -388,12 +389,8 @@ Result RenderTestApp::initializeShaders(ShaderCompiler* shaderCompiler)
}
compileRequest.entryPointTypeArguments = m_shaderInputLayout.globalTypeArguments;
m_shaderProgram = shaderCompiler->compileProgram(compileRequest);
- if (!m_shaderProgram)
- {
- return SLANG_FAIL;
- }
- return SLANG_OK;
+ return m_shaderProgram ? SLANG_OK : SLANG_FAIL;
}
void RenderTestApp::renderFrame()