Implement OpKill support

This commit is contained in:
baldurk
2020-04-15 16:55:50 +01:00
parent c91414782a
commit d889ba7513
3 changed files with 19 additions and 1 deletions
+14 -1
View File
@@ -65,6 +65,7 @@ ThreadState::ThreadState(uint32_t workgroupIdx, Debugger &debug, const GlobalSta
workgroupIndex = workgroupIdx;
nextInstruction = 0;
helperInvocation = false;
killed = false;
}
ThreadState::~ThreadState()
@@ -76,7 +77,7 @@ ThreadState::~ThreadState()
bool ThreadState::Finished() const
{
return helperInvocation || callstack.empty();
return helperInvocation || killed || callstack.empty();
}
void ThreadState::FillCallstack(ShaderDebugState &state)
@@ -1880,6 +1881,18 @@ void ThreadState::StepNext(ShaderDebugState *state, const rdcarray<ThreadState>
break;
}
case Op::Kill:
{
killed = true;
// destroy all stack frames
for(StackFrame *exitingFrame : callstack)
delete exitingFrame;
callstack.clear();
break;
}
case Op::Return:
case Op::ReturnValue:
{
@@ -198,6 +198,7 @@ struct ThreadState
// index in the pixel quad
uint32_t workgroupIndex;
bool helperInvocation;
bool killed;
const ShaderVariable &GetSrc(Id id) const;
@@ -649,6 +649,10 @@ void main()
vec4(posone*1.0f, posone*2.0f, posone*3.0f, posone*4.0f), c);
break;
}
case 80:
{
discard;
}
default: break;
}
}