mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-09 05:41:31 +00:00
Avoid potential crashes trying to compile 0-byte shaders
This commit is contained in:
1 file changed
+6
@@ -1854,6 +1854,9 @@ rdcpair<ResourceId, rdcstr> ReplayController::BuildTargetShader(
|
||||
{
|
||||
CHECK_REPLAY_THREAD();
|
||||
|
||||
if(source.empty())
|
||||
return rdcpair<ResourceId, rdcstr>(ResourceId(), "0-byte shader is not valid");
|
||||
|
||||
rdcarray<ShaderEncoding> encodings = m_pDevice->GetTargetShaderEncodings();
|
||||
|
||||
if(encodings.indexOf(sourceEncoding) == -1)
|
||||
@@ -1892,6 +1895,9 @@ rdcpair<ResourceId, rdcstr> ReplayController::BuildCustomShader(
|
||||
ResourceId id;
|
||||
rdcstr errs;
|
||||
|
||||
if(source.empty())
|
||||
return rdcpair<ResourceId, rdcstr>(ResourceId(), "0-byte shader is not valid");
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case ShaderStage::Vertex:
|
||||
|
||||
Reference in new issue
Block a user