mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Add Unknown FrameRefType
This represents a (sub)resource for which no usage info is available. It should be conservatively assumed that such a resource needs to be re-initialized before each replay (and this behaviour is reflected in `InitReq()`). Change-Id: I12235a6cb1c4b2e3e21bed8834653ec6a3aea009
This commit is contained in:
committed by
Baldur Karlsson
parent
ecd108c6c3
commit
35a15cf8d1
@@ -125,6 +125,14 @@ FrameRefType ComposeFrameRefsDisjoint(FrameRefType x, FrameRefType y)
|
||||
return RDCMAX(x, y);
|
||||
}
|
||||
|
||||
FrameRefType ComposeFrameRefsFirstKnown(FrameRefType first, FrameRefType second)
|
||||
{
|
||||
if(eFrameRef_Minimum <= first && first <= eFrameRef_Maximum)
|
||||
return first;
|
||||
else
|
||||
return second;
|
||||
}
|
||||
|
||||
bool IncludesRead(FrameRefType refType)
|
||||
{
|
||||
switch(refType)
|
||||
|
||||
@@ -103,6 +103,11 @@ enum FrameRefType
|
||||
// read could, incorrectly, be observed. This is because read-only resources
|
||||
// are not reset, so the write from the previous replay may still be present.
|
||||
eFrameRef_WriteBeforeRead = 5,
|
||||
|
||||
// No reference info is available;
|
||||
// This should only appear durring replay, and any (sub)resource with `Unknown`
|
||||
// reference type should be conservatively reset before each replay.
|
||||
eFrameRef_Unknown = 1000000000,
|
||||
};
|
||||
|
||||
bool IncludesRead(FrameRefType refType);
|
||||
@@ -135,6 +140,9 @@ FrameRefType ComposeFrameRefsUnordered(FrameRefType first, FrameRefType second);
|
||||
// frame refs of their subresources.
|
||||
FrameRefType ComposeFrameRefsDisjoint(FrameRefType x, FrameRefType y);
|
||||
|
||||
// Returns whichever of `first` or `second` is valid.
|
||||
FrameRefType ComposeFrameRefsFirstKnown(FrameRefType first, FrameRefType second);
|
||||
|
||||
bool IsDirtyFrameRef(FrameRefType refType);
|
||||
|
||||
// Captures the possible initialization/reset requirements for resources.
|
||||
@@ -200,6 +208,8 @@ enum InitPolicy
|
||||
// Return the initialization/reset requirements for a FrameRefType
|
||||
inline InitReqType InitReq(FrameRefType refType, InitPolicy policy, bool initialized)
|
||||
{
|
||||
if(eFrameRef_Minimum > refType || refType > eFrameRef_Maximum)
|
||||
return eInitReq_Copy;
|
||||
#define COPY_ONCE (initialized ? eInitReq_None : eInitReq_Copy)
|
||||
#define CLEAR_ONCE (initialized ? eInitReq_None : eInitReq_Clear)
|
||||
switch(policy)
|
||||
|
||||
Reference in New Issue
Block a user