Add inital plumbing/stub code for DXR

* Adds specialized serialization for DXR enums, and structs
* Adds new Chunks for DXR API Calls
This commit is contained in:
Amit Prakash
2022-07-12 20:07:18 -04:00
committed by baldurk
parent f67ce809ed
commit b52bb00101
9 changed files with 436 additions and 11 deletions
@@ -725,40 +725,96 @@ void WrappedID3D12GraphicsCommandList::ExecuteMetaCommand(
RDCERR("ExecuteMetaCommand called but no meta commands reported!");
}
template <typename SerialiserType>
bool WrappedID3D12GraphicsCommandList::Serialise_BuildRaytracingAccelerationStructure(
SerialiserType &ser, _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc,
_In_ UINT NumPostbuildInfoDescs,
_In_reads_opt_(NumPostbuildInfoDescs)
const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs)
{
// TODO AMD
return false;
}
void WrappedID3D12GraphicsCommandList::BuildRaytracingAccelerationStructure(
_In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc,
_In_ UINT NumPostbuildInfoDescs,
_In_reads_opt_(NumPostbuildInfoDescs)
const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs)
{
// TODO AMD
RDCERR("BuildRaytracingAccelerationStructure called but raytracing is not supported!");
}
template <typename SerialiserType>
bool WrappedID3D12GraphicsCommandList::Serialise_EmitRaytracingAccelerationStructurePostbuildInfo(
SerialiserType &ser,
_In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc,
_In_ UINT NumSourceAccelerationStructures,
_In_reads_(NumSourceAccelerationStructures)
const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData)
{
// TODO AMD
RDCERR(
"EmitRaytracingAccelerationStructurePostbuildInfo called but raytracing is not supported!");
return false;
}
void WrappedID3D12GraphicsCommandList::EmitRaytracingAccelerationStructurePostbuildInfo(
_In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc,
_In_ UINT NumSourceAccelerationStructures,
_In_reads_(NumSourceAccelerationStructures)
const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData)
{
// TODO AMD
RDCERR(
"EmitRaytracingAccelerationStructurePostbuildInfo called but raytracing is not supported!");
}
template <typename SerialiserType>
bool WrappedID3D12GraphicsCommandList::Serialise_CopyRaytracingAccelerationStructure(
SerialiserType &ser, _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData,
_In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData,
_In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode)
{
// TODO AMD
return false;
}
void WrappedID3D12GraphicsCommandList::CopyRaytracingAccelerationStructure(
_In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData,
_In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData,
_In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode)
{
// TODO AMD
RDCERR("CopyRaytracingAccelerationStructure called but raytracing is not supported!");
}
template <typename SerialiserType>
bool WrappedID3D12GraphicsCommandList::Serialise_SetPipelineState1(SerialiserType &ser,
_In_ ID3D12StateObject *pStateObject)
{
// TODO AMD
return false;
}
void WrappedID3D12GraphicsCommandList::SetPipelineState1(_In_ ID3D12StateObject *pStateObject)
{
// TODO AMD
RDCERR("SetPipelineState1 called but raytracing is not supported!");
}
template <typename SerialiserType>
bool WrappedID3D12GraphicsCommandList::Serialise_DispatchRays(SerialiserType &ser,
_In_ const D3D12_DISPATCH_RAYS_DESC *pDesc)
{
// TODO AMD
return false;
}
void WrappedID3D12GraphicsCommandList::DispatchRays(_In_ const D3D12_DISPATCH_RAYS_DESC *pDesc)
{
// TODO AMD
RDCERR("DispatchRays called but raytracing is not supported!");
}
@@ -768,3 +824,28 @@ INSTANTIATE_FUNCTION_SERIALISED(void, WrappedID3D12GraphicsCommandList, BeginRen
const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil,
D3D12_RENDER_PASS_FLAGS Flags);
INSTANTIATE_FUNCTION_SERIALISED(void, WrappedID3D12GraphicsCommandList, EndRenderPass);
INSTANTIATE_FUNCTION_SERIALISED(
void, WrappedID3D12GraphicsCommandList, BuildRaytracingAccelerationStructure,
const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, _In_ UINT NumPostbuildInfoDescs,
_In_reads_opt_(NumPostbuildInfoDescs)
const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs);
INSTANTIATE_FUNCTION_SERIALISED(
void, WrappedID3D12GraphicsCommandList, EmitRaytracingAccelerationStructurePostbuildInfo,
_In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc,
_In_ UINT NumSourceAccelerationStructures,
_In_reads_(NumSourceAccelerationStructures)
const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData);
INSTANTIATE_FUNCTION_SERIALISED(void, WrappedID3D12GraphicsCommandList,
CopyRaytracingAccelerationStructure,
_In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData,
_In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData,
_In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode);
INSTANTIATE_FUNCTION_SERIALISED(void, WrappedID3D12GraphicsCommandList, SetPipelineState1,
_In_ ID3D12StateObject *pStateObject);
INSTANTIATE_FUNCTION_SERIALISED(void, WrappedID3D12GraphicsCommandList, DispatchRays,
_In_ const D3D12_DISPATCH_RAYS_DESC *pDesc);
+24
View File
@@ -923,6 +923,28 @@ bool WrappedID3D12CommandQueue::ProcessChunk(ReadSerialiser &ser, D3D12Chunk chu
case D3D12Chunk::List_ClearState: ret = m_ReplayList->Serialise_ClearState(ser, NULL); break;
/*-----AMD TODO------*/
case D3D12Chunk::List_BuildRaytracingAccelerationStructure:
ret = m_ReplayList->Serialise_BuildRaytracingAccelerationStructure(ser, NULL, 0, NULL);
break;
case D3D12Chunk::List_CopyRaytracingAccelerationStructure:
ret = m_ReplayList->Serialise_CopyRaytracingAccelerationStructure(
ser, D3D12_GPU_VIRTUAL_ADDRESS(), D3D12_GPU_VIRTUAL_ADDRESS(),
D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_CLONE);
break;
case D3D12Chunk::List_EmitRaytracingAccelerationStructurePostbuildInfo:
ret = m_ReplayList->Serialise_EmitRaytracingAccelerationStructurePostbuildInfo(ser, NULL, 0,
NULL);
break;
case D3D12Chunk::List_DispatchRays:
ret = m_ReplayList->Serialise_DispatchRays(ser, NULL);
break;
case D3D12Chunk::List_SetPipelineState1:
ret = m_ReplayList->Serialise_SetPipelineState1(ser, NULL);
break;
/*-----AMD TODO-------*/
// in order to get a warning if we miss a case, we explicitly handle the device creation chunks
// here. If we actually encounter one it's an error (we shouldn't see these inside the captured
// frame itself)
@@ -961,6 +983,8 @@ bool WrappedID3D12CommandQueue::ProcessChunk(ReadSerialiser &ser, D3D12Chunk chu
case D3D12Chunk::Device_CreatePlacedResource2:
case D3D12Chunk::Device_CreateReservedResource1:
case D3D12Chunk::Device_CreateReservedResource2:
case D3D12Chunk::Device_CreateStateObject:
case D3D12Chunk::Device_AddToStateObject:
RDCERR("Unexpected chunk while processing frame: %s", ToStr(chunk).c_str());
return false;
+25
View File
@@ -530,6 +530,7 @@ SERIALISE_D3D_INTERFACES();
// a thin utility wrapper around a UINT64, that serialises a BufferLocation as an Id + Offset.
struct D3D12BufferLocation
{
D3D12BufferLocation() : Location(0) {}
D3D12BufferLocation(UINT64 l) : Location(l) {}
operator UINT64() const { return Location; }
UINT64 Location;
@@ -807,6 +808,13 @@ DECLARE_REFLECTION_ENUM(D3D12_BARRIER_SYNC);
DECLARE_REFLECTION_ENUM(D3D12_BARRIER_LAYOUT);
DECLARE_REFLECTION_ENUM(D3D12_BARRIER_TYPE);
DECLARE_REFLECTION_ENUM(D3D12_TEXTURE_BARRIER_FLAGS);
DECLARE_REFLECTION_ENUM(D3D12_RAYTRACING_GEOMETRY_TYPE);
DECLARE_REFLECTION_ENUM(D3D12_RAYTRACING_GEOMETRY_FLAGS);
DECLARE_REFLECTION_ENUM(D3D12_ELEMENTS_LAYOUT);
DECLARE_REFLECTION_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE);
DECLARE_REFLECTION_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS);
DECLARE_REFLECTION_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE);
DECLARE_REFLECTION_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE);
DECLARE_REFLECTION_STRUCT(D3D12_RESOURCE_DESC);
DECLARE_REFLECTION_STRUCT(D3D12_COMMAND_QUEUE_DESC);
@@ -924,6 +932,15 @@ DECLARE_REFLECTION_STRUCT(D3D12_TEXTURE_BARRIER);
DECLARE_REFLECTION_STRUCT(D3D12_GLOBAL_BARRIER);
DECLARE_REFLECTION_STRUCT(D3D12_BARRIER_GROUP);
DECLARE_REFLECTION_STRUCT(D3D12ResourceLayout);
DECLARE_REFLECTION_STRUCT(D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC);
DECLARE_REFLECTION_STRUCT(D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS);
DECLARE_REFLECTION_STRUCT(D3D12_RAYTRACING_GEOMETRY_DESC);
DECLARE_REFLECTION_STRUCT(D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC);
DECLARE_REFLECTION_STRUCT(D3D12_RAYTRACING_GEOMETRY_AABBS_DESC);
DECLARE_REFLECTION_STRUCT(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC);
DECLARE_REFLECTION_STRUCT(D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE);
DECLARE_REFLECTION_STRUCT(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC);
DECLARE_REFLECTION_STRUCT(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_SRV);
DECLARE_DESERIALISE_TYPE(D3D12_DISCARD_REGION);
DECLARE_DESERIALISE_TYPE(D3D12_GRAPHICS_PIPELINE_STATE_DESC);
@@ -933,6 +950,7 @@ DECLARE_DESERIALISE_TYPE(D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC);
DECLARE_DESERIALISE_TYPE(D3D12_RENDER_PASS_RENDER_TARGET_DESC);
DECLARE_DESERIALISE_TYPE(D3D12_RENDER_PASS_DEPTH_STENCIL_DESC);
DECLARE_DESERIALISE_TYPE(D3D12_BARRIER_GROUP);
DECLARE_DESERIALISE_TYPE(D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC);
enum class D3D12Chunk : uint32_t
{
@@ -1060,5 +1078,12 @@ enum class D3D12Chunk : uint32_t
List_IASetIndexBufferStripCutValue,
List_Barrier,
List_DispatchMesh,
Device_CreateStateObject,
Device_AddToStateObject,
List_BuildRaytracingAccelerationStructure,
List_CopyRaytracingAccelerationStructure,
List_EmitRaytracingAccelerationStructurePostbuildInfo,
List_DispatchRays,
List_SetPipelineState1,
Max,
};
+9
View File
@@ -4230,6 +4230,10 @@ bool WrappedID3D12Device::ProcessChunk(ReadSerialiser &ser, D3D12Chunk context)
case D3D12Chunk::Device_CreateReservedResource2:
return Serialise_CreateReservedResource2(ser, NULL, D3D12_BARRIER_LAYOUT_COMMON, NULL, NULL,
0, NULL, IID(), NULL);
case D3D12Chunk::Device_CreateStateObject:
return Serialise_CreateStateObject(ser, NULL, IID(), NULL);
case D3D12Chunk::Device_AddToStateObject:
return Serialise_AddToStateObject(ser, NULL, NULL, IID(), NULL);
// in order to get a warning if we miss a case, we explicitly handle the list/queue chunks here.
// If we actually encounter one it's an error (we should hit CaptureBegin first and switch to
@@ -4323,6 +4327,11 @@ bool WrappedID3D12Device::ProcessChunk(ReadSerialiser &ser, D3D12Chunk context)
case D3D12Chunk::List_IASetIndexBufferStripCutValue:
case D3D12Chunk::List_Barrier:
case D3D12Chunk::List_DispatchMesh:
case D3D12Chunk::List_BuildRaytracingAccelerationStructure:
case D3D12Chunk::List_CopyRaytracingAccelerationStructure:
case D3D12Chunk::List_EmitRaytracingAccelerationStructurePostbuildInfo:
case D3D12Chunk::List_DispatchRays:
case D3D12Chunk::List_SetPipelineState1:
RDCERR("Unexpected chunk while processing initialisation: %s", ToStr(context).c_str());
return false;
+4 -4
View File
@@ -1625,10 +1625,10 @@ public:
//////////////////////////////
// implement ID3D12Device7
virtual HRESULT STDMETHODCALLTYPE AddToStateObject(const D3D12_STATE_OBJECT_DESC *pAddition,
ID3D12StateObject *pStateObjectToGrowFrom,
REFIID riid,
_COM_Outptr_ void **ppNewStateObject);
IMPLEMENT_FUNCTION_THREAD_SERIALISED(virtual HRESULT STDMETHODCALLTYPE, AddToStateObject,
const D3D12_STATE_OBJECT_DESC *pAddition,
ID3D12StateObject *pStateObjectToGrowFrom, REFIID riid,
_COM_Outptr_ void **ppNewStateObject);
virtual HRESULT STDMETHODCALLTYPE
CreateProtectedResourceSession1(_In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc,
+24 -6
View File
@@ -74,9 +74,26 @@ HRESULT WrappedID3D12Device::CreateMetaCommand(_In_ REFGUID CommandId, _In_ UINT
return E_INVALIDARG;
}
template <typename SerialiserType>
bool WrappedID3D12Device::Serialise_CreateStateObject(SerialiserType &ser,
const D3D12_STATE_OBJECT_DESC *pDesc,
REFIID riid, _COM_Outptr_ void **ppStateObject)
{
// AMD TODO - //Serialize Members
if(IsReplayingAndReading())
{
// AMD TODO
// Handle reading, and replaying
}
return false;
}
HRESULT WrappedID3D12Device::CreateStateObject(const D3D12_STATE_OBJECT_DESC *pDesc, REFIID riid,
_COM_Outptr_ void **ppStateObject)
{
// AMD TODO
RDCERR("CreateStateObject called but raytracing is not supported!");
return E_INVALIDARG;
}
@@ -85,16 +102,17 @@ void WrappedID3D12Device::GetRaytracingAccelerationStructurePrebuildInfo(
_In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc,
_Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo)
{
RDCERR("GetRaytracingAccelerationStructurePrebuildInfo called raytracing is not supported!");
if(pInfo)
*pInfo = {0, 0, 0};
return;
return m_pDevice5->GetRaytracingAccelerationStructurePrebuildInfo(pDesc, pInfo);
}
D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS WrappedID3D12Device::CheckDriverMatchingIdentifier(
_In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType,
_In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck)
{
// always say the data is unrecognised
return D3D12_DRIVER_MATCHING_IDENTIFIER_UNRECOGNIZED;
// AMD TODO: Investigate if this needs additional handling
return m_pDevice5->CheckDriverMatchingIdentifier(SerializedDataType, pIdentifierToCheck);
}
INSTANTIATE_FUNCTION_SERIALISED(HRESULT, WrappedID3D12Device, CreateStateObject,
const D3D12_STATE_OBJECT_DESC *pDesc, REFIID riid,
_COM_Outptr_ void **ppStateObject)
@@ -25,10 +25,29 @@
#include "d3d12_device.h"
#include "d3d12_resources.h"
template <typename SerialiserType>
bool WrappedID3D12Device::Serialise_AddToStateObject(SerialiserType &ser,
const D3D12_STATE_OBJECT_DESC *pAddition,
ID3D12StateObject *pStateObjectToGrowFrom,
REFIID riid,
_COM_Outptr_ void **ppNewStateObject)
{
// AMD TODO - //Serialize Members
if(IsReplayingAndReading())
{
// AMD TODO
// Handle reading, and replaying
}
return false;
}
HRESULT STDMETHODCALLTYPE WrappedID3D12Device::AddToStateObject(
const D3D12_STATE_OBJECT_DESC *pAddition, ID3D12StateObject *pStateObjectToGrowFrom,
REFIID riid, _COM_Outptr_ void **ppNewStateObject)
{
// TODO AMD
RDCERR("AddToStateObject called but raytracing is not supported!");
return E_INVALIDARG;
}
@@ -64,3 +83,8 @@ HRESULT WrappedID3D12Device::CreateProtectedResourceSession1(
return ret;
}
INSTANTIATE_FUNCTION_SERIALISED(HRESULT, WrappedID3D12Device, AddToStateObject,
const D3D12_STATE_OBJECT_DESC *pAddition,
ID3D12StateObject *pStateObjectToGrowFrom, REFIID riid,
_COM_Outptr_ void **ppNewStateObject)
+142
View File
@@ -1082,6 +1082,9 @@ void DoSerialise(SerialiserType &ser, D3D12_SHADER_RESOURCE_VIEW_DESC &el)
case D3D12_SRV_DIMENSION_TEXTURE3D: SERIALISE_MEMBER(Texture3D); break;
case D3D12_SRV_DIMENSION_TEXTURECUBE: SERIALISE_MEMBER(TextureCube); break;
case D3D12_SRV_DIMENSION_TEXTURECUBEARRAY: SERIALISE_MEMBER(TextureCubeArray); break;
case D3D12_SRV_DIMENSION_RAYTRACING_ACCELERATION_STRUCTURE:
SERIALISE_MEMBER(RaytracingAccelerationStructure);
break;
default: RDCERR("Unrecognised SRV Dimension %d", el.ViewDimension); break;
}
}
@@ -1840,6 +1843,136 @@ void Deserialise(const D3D12_BARRIER_GROUP &el)
}
}
template <class SerialiserType>
void DoSerialise(SerialiserType &ser, D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE &el)
{
SERIALISE_MEMBER_TYPED(D3D12BufferLocation, StartAddress).Important();
SERIALISE_MEMBER(StrideInBytes);
}
template <>
void Deserialise(const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC &el)
{
// We will be allocating only dynamic memory for el.Inputs
if(el.Inputs.Type == D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL)
delete[] el.Inputs.pGeometryDescs;
}
template <class SerialiserType>
void DoSerialise(SerialiserType &ser, D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC &el)
{
SERIALISE_MEMBER_TYPED(D3D12BufferLocation, DestAccelerationStructureData).Important();
SERIALISE_MEMBER(Inputs);
if(el.SourceAccelerationStructureData)
{
SERIALISE_MEMBER_TYPED(D3D12BufferLocation, SourceAccelerationStructureData).Important();
}
else
{
SERIALISE_MEMBER_TYPED(D3D12BufferLocation, SourceAccelerationStructureData);
}
SERIALISE_MEMBER_TYPED(D3D12BufferLocation, ScratchAccelerationStructureData).Important();
}
template <class SerialiserType>
void DoSerialise(SerialiserType &ser, D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS &el)
{
SERIALISE_MEMBER(Type);
SERIALISE_MEMBER(Flags);
SERIALISE_MEMBER(NumDescs);
SERIALISE_MEMBER(DescsLayout);
if(el.Type == D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL)
{
SERIALISE_MEMBER_TYPED(D3D12BufferLocation, InstanceDescs).Important();
}
else
{
if(el.DescsLayout == D3D12_ELEMENTS_LAYOUT_ARRAY)
{
SERIALISE_MEMBER_ARRAY(pGeometryDescs, NumDescs);
}
else
{
D3D12_RAYTRACING_GEOMETRY_DESC *tempDescs = new D3D12_RAYTRACING_GEOMETRY_DESC[el.NumDescs];
if(ser.IsWriting())
{
for(size_t i = 0; i < el.NumDescs; i++)
{
tempDescs[i] = *el.ppGeometryDescs[i];
}
}
SERIALISE_ELEMENT_ARRAY(tempDescs, el.NumDescs).Named("ppGeometryDescs");
if(ser.IsReading())
{
el.pGeometryDescs = tempDescs;
el.DescsLayout = D3D12_ELEMENTS_LAYOUT_ARRAY;
}
}
}
}
template <class SerialiserType>
void DoSerialise(SerialiserType &ser, D3D12_RAYTRACING_GEOMETRY_DESC &el)
{
SERIALISE_MEMBER(Type);
SERIALISE_MEMBER(Flags);
if(el.Type == D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES)
{
SERIALISE_MEMBER(Triangles);
}
else
{
SERIALISE_MEMBER(AABBs);
}
}
template <class SerialiserType>
void DoSerialise(SerialiserType &ser, D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC &el)
{
SERIALISE_MEMBER_TYPED(D3D12BufferLocation, Transform3x4);
SERIALISE_MEMBER(IndexFormat);
SERIALISE_MEMBER(VertexFormat);
SERIALISE_MEMBER(IndexCount);
SERIALISE_MEMBER(VertexCount);
SERIALISE_MEMBER_TYPED(D3D12BufferLocation, IndexBuffer);
SERIALISE_MEMBER(VertexBuffer);
}
template <class SerialiserType>
void DoSerialise(SerialiserType &ser, D3D12_RAYTRACING_GEOMETRY_AABBS_DESC &el)
{
SERIALISE_MEMBER(AABBCount);
SERIALISE_MEMBER(AABBs);
}
template <class SerialiserType>
void DoSerialise(SerialiserType &ser, D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC &el)
{
SERIALISE_MEMBER_TYPED(D3D12BufferLocation, DestBuffer);
SERIALISE_MEMBER(InfoType);
}
template <class SerialiserType>
void DoSerialise(SerialiserType &ser,
D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC &el)
{
SERIALISE_MEMBER(SerializedSizeInBytes);
SERIALISE_MEMBER(NumBottomLevelAccelerationStructurePointers);
}
template <class SerialiserType>
void DoSerialise(SerialiserType &ser, D3D12_RAYTRACING_ACCELERATION_STRUCTURE_SRV &el)
{
SERIALISE_MEMBER_TYPED(D3D12BufferLocation, Location);
}
INSTANTIATE_SERIALISE_TYPE(D3D12RootSignature);
INSTANTIATE_SERIALISE_TYPE(PortableHandle);
INSTANTIATE_SERIALISE_TYPE(D3D12_CPU_DESCRIPTOR_HANDLE);
@@ -1900,3 +2033,12 @@ INSTANTIATE_SERIALISE_TYPE(D3D12_DRAW_ARGUMENTS);
INSTANTIATE_SERIALISE_TYPE(D3D12_DRAW_INDEXED_ARGUMENTS);
INSTANTIATE_SERIALISE_TYPE(D3D12_DISPATCH_ARGUMENTS);
INSTANTIATE_SERIALISE_TYPE(D3D12_DISPATCH_MESH_ARGUMENTS);
INSTANTIATE_SERIALISE_TYPE(D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE);
INSTANTIATE_SERIALISE_TYPE(D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC);
INSTANTIATE_SERIALISE_TYPE(D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS);
INSTANTIATE_SERIALISE_TYPE(D3D12_RAYTRACING_GEOMETRY_DESC);
INSTANTIATE_SERIALISE_TYPE(D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC);
INSTANTIATE_SERIALISE_TYPE(D3D12_RAYTRACING_GEOMETRY_AABBS_DESC);
INSTANTIATE_SERIALISE_TYPE(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC);
INSTANTIATE_SERIALISE_TYPE(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC);
INSTANTIATE_SERIALISE_TYPE(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_SRV);
+103 -1
View File
@@ -28,7 +28,7 @@
template <>
rdcstr DoStringise(const D3D12Chunk &el)
{
RDCCOMPILE_ASSERT((uint32_t)D3D12Chunk::Max == 1124, "Chunks changed without updating names");
RDCCOMPILE_ASSERT((uint32_t)D3D12Chunk::Max == 1131, "Chunks changed without updating names");
BEGIN_ENUM_STRINGISE(D3D12Chunk)
{
@@ -221,6 +221,18 @@ rdcstr DoStringise(const D3D12Chunk &el)
"ID3D12GraphicsCommandList9::IASetIndexBufferStripCutValue");
STRINGISE_ENUM_CLASS_NAMED(List_Barrier, "ID3D12GraphicsCommandList7::Barrier");
STRINGISE_ENUM_CLASS_NAMED(List_DispatchMesh, "ID3D12GraphicsCommandList6::DispatchMesh");
STRINGISE_ENUM_CLASS_NAMED(Device_CreateStateObject, "ID3D12Device5::CreateStateObject");
STRINGISE_ENUM_CLASS_NAMED(Device_AddToStateObject, "ID3D12Device7::CreateStateObject");
STRINGISE_ENUM_CLASS_NAMED(List_BuildRaytracingAccelerationStructure,
"ID3D12GraphicsCommandList4::BuildRaytracingAccelerationStructure");
STRINGISE_ENUM_CLASS_NAMED(List_CopyRaytracingAccelerationStructure,
"ID3D12GraphicsCommandList4::CopyRaytracingAccelerationStructure");
STRINGISE_ENUM_CLASS_NAMED(
List_EmitRaytracingAccelerationStructurePostbuildInfo,
"ID3D12GraphicsCommandList4::EmitRaytracingAccelerationStructurePostbuildInfo");
STRINGISE_ENUM_CLASS_NAMED(List_DispatchRays, "ID3D12GraphicsCommandList4::DispatchRays");
STRINGISE_ENUM_CLASS_NAMED(List_SetPipelineState1,
"ID3D12GraphicsCommandList4::SetPipelineState1");
STRINGISE_ENUM_CLASS_NAMED(Max, "Max Chunk");
}
END_ENUM_STRINGISE()
@@ -389,6 +401,7 @@ rdcstr DoStringise(const D3D12_SRV_DIMENSION &el)
STRINGISE_ENUM(D3D12_SRV_DIMENSION_TEXTURE3D)
STRINGISE_ENUM(D3D12_SRV_DIMENSION_TEXTURECUBE)
STRINGISE_ENUM(D3D12_SRV_DIMENSION_TEXTURECUBEARRAY)
STRINGISE_ENUM(D3D12_SRV_DIMENSION_RAYTRACING_ACCELERATION_STRUCTURE)
}
END_ENUM_STRINGISE();
}
@@ -1444,3 +1457,92 @@ rdcstr DoStringise(const D3D12ResourceLayout &el)
else
return DoStringise(el.ToStates());
}
template <>
rdcstr DoStringise(const D3D12_ELEMENTS_LAYOUT &el)
{
BEGIN_ENUM_STRINGISE(D3D12_ELEMENTS_LAYOUT);
{
STRINGISE_ENUM(D3D12_ELEMENTS_LAYOUT_ARRAY);
STRINGISE_ENUM(D3D12_ELEMENTS_LAYOUT_ARRAY_OF_POINTERS);
}
END_ENUM_STRINGISE();
}
template <>
rdcstr DoStringise(const D3D12_RAYTRACING_GEOMETRY_TYPE &el)
{
BEGIN_ENUM_STRINGISE(D3D12_RAYTRACING_GEOMETRY_TYPE);
{
STRINGISE_ENUM(D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES);
STRINGISE_ENUM(D3D12_RAYTRACING_GEOMETRY_TYPE_PROCEDURAL_PRIMITIVE_AABBS);
}
END_ENUM_STRINGISE();
}
template <>
rdcstr DoStringise(const D3D12_RAYTRACING_GEOMETRY_FLAGS &el)
{
BEGIN_BITFIELD_STRINGISE(D3D12_RAYTRACING_GEOMETRY_FLAGS);
{
STRINGISE_BITFIELD_VALUE(D3D12_RAYTRACING_GEOMETRY_FLAG_NONE);
STRINGISE_BITFIELD_BIT(D3D12_RAYTRACING_GEOMETRY_FLAG_OPAQUE);
STRINGISE_BITFIELD_BIT(D3D12_RAYTRACING_GEOMETRY_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION);
}
END_BITFIELD_STRINGISE();
}
template <>
rdcstr DoStringise(const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE &el)
{
BEGIN_ENUM_STRINGISE(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE);
{
STRINGISE_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL);
STRINGISE_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL);
}
END_ENUM_STRINGISE();
}
template <>
rdcstr DoStringise(const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS &el)
{
BEGIN_BITFIELD_STRINGISE(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS);
{
STRINGISE_BITFIELD_VALUE(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_NONE);
STRINGISE_BITFIELD_BIT(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_UPDATE);
STRINGISE_BITFIELD_BIT(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_COMPACTION);
STRINGISE_BITFIELD_BIT(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_TRACE);
STRINGISE_BITFIELD_BIT(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_BUILD);
STRINGISE_BITFIELD_BIT(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_MINIMIZE_MEMORY);
STRINGISE_BITFIELD_BIT(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PERFORM_UPDATE);
}
END_BITFIELD_STRINGISE();
}
template <>
rdcstr DoStringise(const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE &el)
{
BEGIN_ENUM_STRINGISE(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE);
{
STRINGISE_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE);
STRINGISE_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION);
STRINGISE_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION);
STRINGISE_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE);
}
END_ENUM_STRINGISE();
}
template <>
rdcstr DoStringise(const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE &el)
{
BEGIN_ENUM_STRINGISE(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE);
{
STRINGISE_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_CLONE);
STRINGISE_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_COMPACT);
STRINGISE_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_VISUALIZATION_DECODE_FOR_TOOLS);
STRINGISE_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_SERIALIZE);
STRINGISE_ENUM(D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_DESERIALIZE);
}
END_ENUM_STRINGISE();
}