Refactor ShaderDebugTrace to not return a single list of complete states

* The ShaderDebugTrace now only sets up the initial state of an opaque
  ShaderDebugger handle.
* This handle can then be passed to a new function - ContinueDebug - to
  iteratively return N more states. The number of states is implementation
  defined and may be a fixed number or it may run for a fixed time.
* The states themselves no longer contain a complete snapshot of all variables,
  but instead only the changed variables for that iteration. The changes are
  stored as before and after value to make it easier to step forwards and
  backwards (only the ShaderDebugState is needed to move forward or backwards,
  you don't have to search back for the last set value of a variable to 'undo' a
  change).
This commit is contained in:
baldurk
2020-02-06 17:58:42 +00:00
parent fa9289c372
commit 661ee35f30
29 changed files with 1804 additions and 1705 deletions
+10 -15
View File
@@ -257,27 +257,22 @@ public:
{
return rdcarray<PixelModification>();
}
ShaderDebugTrace DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset)
ShaderDebugTrace *DebugVertex(uint32_t eventId, uint32_t vertid, uint32_t instid, uint32_t idx,
uint32_t instOffset, uint32_t vertOffset)
{
ShaderDebugTrace ret;
RDCEraseEl(ret);
return ret;
return new ShaderDebugTrace();
}
ShaderDebugTrace DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
uint32_t primitive)
ShaderDebugTrace *DebugPixel(uint32_t eventId, uint32_t x, uint32_t y, uint32_t sample,
uint32_t primitive)
{
ShaderDebugTrace ret;
RDCEraseEl(ret);
return ret;
return new ShaderDebugTrace();
}
ShaderDebugTrace DebugThread(uint32_t eventId, const uint32_t groupid[3],
const uint32_t threadid[3])
ShaderDebugTrace *DebugThread(uint32_t eventId, const uint32_t groupid[3],
const uint32_t threadid[3])
{
ShaderDebugTrace ret;
RDCEraseEl(ret);
return ret;
return new ShaderDebugTrace();
}
rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger) { return {}; }
void BuildTargetShader(ShaderEncoding sourceEncoding, const bytebuf &source, const rdcstr &entry,
const ShaderCompileFlags &compileFlags, ShaderStage type, ResourceId &id,
rdcstr &errors)