mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-16 11:36:48 +00:00
Serialisation definitions/preliminary support for D3D12 tiled resources.
This commit is contained in:
committed by
Baldur Karlsson
parent
9e5736f03e
commit
8f69735780
@@ -65,6 +65,16 @@ struct IFrameCapturer
|
||||
virtual bool EndFrameCapture(void *dev, void *wnd) = 0;
|
||||
};
|
||||
|
||||
// READING and EXECUTING are replay states.
|
||||
// WRITING_IDLE and WRITING_CAPFRAME are capture states.
|
||||
// WRITING isn't actually a state, it's just a midpoint in the enum,
|
||||
// so it takes fewer characters to check which state we're in.
|
||||
//
|
||||
// on replay, m_State < WRITING is the same as
|
||||
//(m_State == READING || m_State == EXECUTING)
|
||||
//
|
||||
// on capture, m_State >= WRITING is the same as
|
||||
//(m_State == WRITING_IDLE || m_State == WRITING_CAPFRAME)
|
||||
enum LogState
|
||||
{
|
||||
READING = 0,
|
||||
|
||||
@@ -4872,6 +4872,15 @@ void WrappedID3D12GraphicsCommandList::ResolveSubresource(ID3D12Resource *pDstRe
|
||||
}
|
||||
}
|
||||
|
||||
bool WrappedID3D12GraphicsCommandList::Serialise_CopyTiles(
|
||||
ID3D12Resource *pTiledResource, const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate,
|
||||
const D3D12_TILE_REGION_SIZE *pTileRegionSize, ID3D12Resource *pBuffer,
|
||||
UINT64 BufferStartOffsetInBytes, D3D12_TILE_COPY_FLAGS Flags)
|
||||
{
|
||||
D3D12NOTIMP("Tiled Resources");
|
||||
return true;
|
||||
}
|
||||
|
||||
void WrappedID3D12GraphicsCommandList::CopyTiles(
|
||||
ID3D12Resource *pTiledResource, const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate,
|
||||
const D3D12_TILE_REGION_SIZE *pTileRegionSize, ID3D12Resource *pBuffer,
|
||||
|
||||
@@ -26,6 +26,17 @@
|
||||
#include "d3d12_command_list.h"
|
||||
#include "d3d12_resources.h"
|
||||
|
||||
bool WrappedID3D12CommandQueue::Serialise_UpdateTileMappings(
|
||||
ID3D12Resource *pResource, UINT NumResourceRegions,
|
||||
const D3D12_TILED_RESOURCE_COORDINATE *pResourceRegionStartCoordinates,
|
||||
const D3D12_TILE_REGION_SIZE *pResourceRegionSizes, ID3D12Heap *pHeap, UINT NumRanges,
|
||||
const D3D12_TILE_RANGE_FLAGS *pRangeFlags, const UINT *pHeapRangeStartOffsets,
|
||||
const UINT *pRangeTileCounts, D3D12_TILE_MAPPING_FLAGS Flags)
|
||||
{
|
||||
D3D12NOTIMP("Tiled Resources");
|
||||
return true;
|
||||
}
|
||||
|
||||
void STDMETHODCALLTYPE WrappedID3D12CommandQueue::UpdateTileMappings(
|
||||
ID3D12Resource *pResource, UINT NumResourceRegions,
|
||||
const D3D12_TILED_RESOURCE_COORDINATE *pResourceRegionStartCoordinates,
|
||||
@@ -39,6 +50,15 @@ void STDMETHODCALLTYPE WrappedID3D12CommandQueue::UpdateTileMappings(
|
||||
pHeapRangeStartOffsets, pRangeTileCounts, Flags);
|
||||
}
|
||||
|
||||
bool WrappedID3D12CommandQueue::Serialise_CopyTileMappings(
|
||||
ID3D12Resource *pDstResource, const D3D12_TILED_RESOURCE_COORDINATE *pDstRegionStartCoordinate,
|
||||
ID3D12Resource *pSrcResource, const D3D12_TILED_RESOURCE_COORDINATE *pSrcRegionStartCoordinate,
|
||||
const D3D12_TILE_REGION_SIZE *pRegionSize, D3D12_TILE_MAPPING_FLAGS Flags)
|
||||
{
|
||||
D3D12NOTIMP("Tiled Resources");
|
||||
return true;
|
||||
}
|
||||
|
||||
void STDMETHODCALLTYPE WrappedID3D12CommandQueue::CopyTileMappings(
|
||||
ID3D12Resource *pDstResource, const D3D12_TILED_RESOURCE_COORDINATE *pDstRegionStartCoordinate,
|
||||
ID3D12Resource *pSrcResource, const D3D12_TILED_RESOURCE_COORDINATE *pSrcRegionStartCoordinate,
|
||||
|
||||
@@ -386,6 +386,13 @@ void WrappedID3D12CommandQueue::ProcessChunk(uint64_t offset, D3D12ChunkType chu
|
||||
m_pDevice->Serialise_DynamicDescriptorCopies(m_pDevice->GetMainSerialiser(), NULL);
|
||||
break;
|
||||
|
||||
case UPDATE_TILE_MAPPINGS:
|
||||
Serialise_UpdateTileMappings(NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL,
|
||||
D3D12_TILE_MAPPING_FLAG_NONE);
|
||||
break;
|
||||
case COPY_TILE_MAPPINGS:
|
||||
Serialise_CopyTileMappings(NULL, NULL, NULL, NULL, NULL, D3D12_TILE_MAPPING_FLAG_NONE);
|
||||
break;
|
||||
case EXECUTE_CMD_LISTS: Serialise_ExecuteCommandLists(0, NULL); break;
|
||||
case SIGNAL: Serialise_Signal(NULL, 0); break;
|
||||
case WAIT: Serialise_Wait(NULL, 0); break;
|
||||
|
||||
@@ -1696,6 +1696,29 @@ void Serialiser::Serialise(const char *name, D3D12_TEXTURE_COPY_LOCATION &el)
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, D3D12_TILED_RESOURCE_COORDINATE &el)
|
||||
{
|
||||
ScopedContext scope(this, name, "D3D12_TILED_RESOURCE_COORDINATE", 0, true);
|
||||
|
||||
Serialise("X", el.X);
|
||||
Serialise("Y", el.Y);
|
||||
Serialise("Z", el.Z);
|
||||
Serialise("Subresource", el.Subresource);
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, D3D12_TILE_REGION_SIZE &el)
|
||||
{
|
||||
ScopedContext scope(this, name, "D3D12_TILE_REGION_SIZE", 0, true);
|
||||
|
||||
Serialise("NumTiles", el.NumTiles);
|
||||
Serialise("UseBox", el.UseBox);
|
||||
Serialise("Width", el.Width);
|
||||
Serialise("Height", el.Height);
|
||||
Serialise("Depth", el.Depth);
|
||||
}
|
||||
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, D3D12_DISCARD_REGION &el)
|
||||
{
|
||||
@@ -2603,3 +2626,85 @@ string ToStrHelper<false, D3D12_COMMAND_QUEUE_FLAGS>::Get(const D3D12_COMMAND_QU
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
string ToStrHelper<false, D3D12_TILE_COPY_FLAGS>::Get(const D3D12_TILE_COPY_FLAGS &el)
|
||||
{
|
||||
string ret;
|
||||
|
||||
if(el == D3D12_TILE_COPY_FLAG_NONE)
|
||||
return "D3D12_TILE_COPY_FLAG_NONE";
|
||||
|
||||
if(el & D3D12_TILE_COPY_FLAG_NO_HAZARD)
|
||||
ret += " | D3D12_TILE_COPY_FLAG_NO_HAZARD";
|
||||
|
||||
if(el & D3D12_TILE_COPY_FLAG_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE)
|
||||
ret += " | D3D12_TILE_COPY_FLAG_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE";
|
||||
|
||||
if(el & D3D12_TILE_COPY_FLAG_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER)
|
||||
ret += " | D3D12_TILE_COPY_FLAG_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER";
|
||||
|
||||
if(!ret.empty())
|
||||
ret = ret.substr(3);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
string ToStrHelper<false, D3D12_TILE_MAPPING_FLAGS>::Get(const D3D12_TILE_MAPPING_FLAGS &el)
|
||||
{
|
||||
string ret;
|
||||
|
||||
if(el == D3D12_TILE_MAPPING_FLAG_NONE)
|
||||
return "D3D12_TILE_MAPPING_FLAG_NONE";
|
||||
|
||||
if(el & D3D12_TILE_MAPPING_FLAG_NO_HAZARD)
|
||||
ret += " | D3D12_TILE_MAPPING_FLAG_NO_HAZARD";
|
||||
|
||||
if(!ret.empty())
|
||||
ret = ret.substr(3);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
string ToStrHelper<false, D3D12_TILE_RANGE_FLAGS>::Get(const D3D12_TILE_RANGE_FLAGS &el)
|
||||
{
|
||||
string ret;
|
||||
|
||||
if(el == D3D12_TILE_RANGE_FLAG_NONE)
|
||||
return "D3D12_TILE_RANGE_FLAG_NONE";
|
||||
|
||||
if(el & D3D12_TILE_RANGE_FLAG_NULL)
|
||||
ret += " | D3D12_TILE_RANGE_FLAG_NULL";
|
||||
|
||||
if(el & D3D12_TILE_RANGE_FLAG_SKIP)
|
||||
ret += " | D3D12_TILE_RANGE_FLAG_SKIP";
|
||||
|
||||
if(el & D3D12_TILE_RANGE_FLAG_REUSE_SINGLE_TILE)
|
||||
ret += " | D3D12_TILE_RANGE_FLAG_REUSE_SINGLE_TILE";
|
||||
|
||||
if(!ret.empty())
|
||||
ret = ret.substr(3);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
string ToStrHelper<false, D3D12_TILED_RESOURCES_TIER>::Get(const D3D12_TILED_RESOURCES_TIER &el)
|
||||
{
|
||||
string ret;
|
||||
|
||||
if(el == D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED)
|
||||
return "D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED";
|
||||
|
||||
if(el & D3D12_TILED_RESOURCES_TIER_1)
|
||||
ret += " | D3D12_TILED_RESOURCES_TIER_1";
|
||||
|
||||
if(el & D3D12_TILED_RESOURCES_TIER_2)
|
||||
ret += " | D3D12_TILED_RESOURCES_TIER_2";
|
||||
|
||||
if(el & D3D12_TILED_RESOURCES_TIER_3)
|
||||
ret += " | D3D12_TILED_RESOURCES_TIER_3";
|
||||
|
||||
if(!ret.empty())
|
||||
ret = ret.substr(3);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -339,6 +339,10 @@ void Serialiser::Serialise(const char *name, D3D12_CLEAR_VALUE &el);
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, D3D12_TEXTURE_COPY_LOCATION &el);
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, D3D12_TILED_RESOURCE_COORDINATE &el);
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, D3D12_TILE_REGION_SIZE &el);
|
||||
template <>
|
||||
void Serialiser::Serialise(const char *name, D3D12_DISCARD_REGION &el);
|
||||
template <>
|
||||
void Serialiser::Deserialise(const D3D12_DISCARD_REGION *const el) const;
|
||||
@@ -459,6 +463,11 @@ void Serialiser::Serialise(const char *name, D3D12Descriptor &el);
|
||||
D3D12_CHUNK_MACRO(SIGNAL, "ID3D12GraphicsCommandQueue::Signal") \
|
||||
D3D12_CHUNK_MACRO(WAIT, "ID3D12GraphicsCommandQueue::Wait") \
|
||||
\
|
||||
D3D12_CHUNK_MACRO(CREATE_RESERVED_RESOURCE, "ID3D12Device::CreateReservedResource") \
|
||||
D3D12_CHUNK_MACRO(COPY_TILES, "ID3D12GraphicsCommandList::CopyTiles") \
|
||||
D3D12_CHUNK_MACRO(UPDATE_TILE_MAPPINGS, "ID3D12GraphicsCommandQueue::UpdateTileMappings") \
|
||||
D3D12_CHUNK_MACRO(COPY_TILE_MAPPINGS, "ID3D12GraphicsCommandQueue::CopyTileMappings") \
|
||||
\
|
||||
D3D12_CHUNK_MACRO(NUM_D3D12_CHUNKS, "")
|
||||
|
||||
enum D3D12ChunkType
|
||||
|
||||
@@ -2269,6 +2269,10 @@ void WrappedID3D12Device::ProcessChunk(uint64_t offset, D3D12ChunkType context)
|
||||
Serialise_CreatePlacedResource(GetMainSerialiser(), NULL, 0, NULL,
|
||||
D3D12_RESOURCE_STATE_COMMON, NULL, IID(), NULL);
|
||||
break;
|
||||
case CREATE_RESERVED_RESOURCE:
|
||||
Serialise_CreateReservedResource(GetMainSerialiser(), NULL, D3D12_RESOURCE_STATE_COMMON, NULL,
|
||||
IID(), NULL);
|
||||
break;
|
||||
|
||||
case CREATE_QUERY_HEAP:
|
||||
Serialise_CreateQueryHeap(GetMainSerialiser(), NULL, IID(), NULL);
|
||||
|
||||
@@ -1243,6 +1243,14 @@ HRESULT WrappedID3D12Device::CreatePlacedResource(ID3D12Heap *pHeap, UINT64 Heap
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool WrappedID3D12Device::Serialise_CreateReservedResource(
|
||||
Serialiser *localSerialiser, const D3D12_RESOURCE_DESC *pDesc, D3D12_RESOURCE_STATES InitialState,
|
||||
const D3D12_CLEAR_VALUE *pOptimizedClearValue, REFIID riid, void **ppvResource)
|
||||
{
|
||||
D3D12NOTIMP("Tiled Resources");
|
||||
return true;
|
||||
}
|
||||
|
||||
HRESULT WrappedID3D12Device::CreateReservedResource(const D3D12_RESOURCE_DESC *pDesc,
|
||||
D3D12_RESOURCE_STATES InitialState,
|
||||
const D3D12_CLEAR_VALUE *pOptimizedClearValue,
|
||||
|
||||
Reference in New Issue
Block a user