mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-13 01:05:44 +00:00
Mark integer divide by zero as "generated NaN of Inf" in shader debug
This commit is contained in:
@@ -1913,6 +1913,11 @@ void ThreadState::StepNext(ShaderDebugState *state, DebugAPIWrapper *apiWrapper,
|
||||
quot.value.uv[i] = srcOpers[1].value.uv[i] / srcOpers[2].value.uv[i];
|
||||
rem.value.uv[i] = srcOpers[1].value.uv[i] - (quot.value.uv[i] * srcOpers[2].value.uv[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(state)
|
||||
state->flags |= ShaderEvents::GeneratedNanOrInf;
|
||||
}
|
||||
}
|
||||
|
||||
if(op.operands[0].type != TYPE_NULL)
|
||||
|
||||
@@ -784,20 +784,32 @@ void ThreadState::StepNext(ShaderDebugState *state,
|
||||
{
|
||||
for(uint8_t c = 0; c < var.columns; c++)
|
||||
{
|
||||
if(b.value.uv[c] == 0)
|
||||
var.value.uv[c] = ~0U;
|
||||
else
|
||||
if(b.value.iv[c] != 0)
|
||||
{
|
||||
var.value.iv[c] /= b.value.iv[c];
|
||||
}
|
||||
else
|
||||
{
|
||||
var.value.uv[c] = ~0U;
|
||||
if(state)
|
||||
state->flags |= ShaderEvents::GeneratedNanOrInf;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(opdata.op == Op::UDiv)
|
||||
{
|
||||
for(uint8_t c = 0; c < var.columns; c++)
|
||||
{
|
||||
if(b.value.uv[c] == 0)
|
||||
var.value.uv[c] = ~0U;
|
||||
else
|
||||
if(b.value.uv[c] != 0)
|
||||
{
|
||||
var.value.uv[c] /= b.value.uv[c];
|
||||
}
|
||||
else
|
||||
{
|
||||
var.value.uv[c] = ~0U;
|
||||
if(state)
|
||||
state->flags |= ShaderEvents::GeneratedNanOrInf;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(opdata.op == Op::IAdd)
|
||||
|
||||
Reference in New Issue
Block a user