mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-09 01:00:51 +00:00
Update D3D12 headers to 1.618.2
* This includes some support for the new serialised-root signature representation for precompilation which also affects runtime. GetRootSignature*() functions in pipeline state and state object are not implemented as it's unclear if they are supported. * The interfaces for the precompilation are *not* supported as there is no need.
This commit is contained in:
@@ -148,7 +148,7 @@ struct WrappedDownlevelQueue : public ID3D12CommandQueueDownlevel
|
||||
|
||||
class WrappedID3D12GraphicsCommandList;
|
||||
|
||||
class WrappedID3D12CommandQueue : public ID3D12CommandQueue,
|
||||
class WrappedID3D12CommandQueue : public ID3D12CommandQueue1,
|
||||
public RefCounter12<ID3D12CommandQueue>,
|
||||
public ID3DDevice,
|
||||
public IDXGISwapper
|
||||
@@ -156,6 +156,7 @@ class WrappedID3D12CommandQueue : public ID3D12CommandQueue,
|
||||
friend class WrappedID3D12GraphicsCommandList;
|
||||
|
||||
ID3D12CommandQueueDownlevel *m_pDownlevel;
|
||||
ID3D12CommandQueue1 *m_pReal1;
|
||||
|
||||
WrappedDownlevelQueue m_WrappedDownlevel;
|
||||
|
||||
@@ -408,6 +409,35 @@ public:
|
||||
virtual HRESULT STDMETHODCALLTYPE Present(ID3D12GraphicsCommandList *pOpenCommandList,
|
||||
ID3D12Resource *pSourceTex2D, HWND hWindow,
|
||||
D3D12_DOWNLEVEL_PRESENT_FLAGS Flags);
|
||||
|
||||
// implement ID3D12CommandQueue1
|
||||
virtual HRESULT STDMETHODCALLTYPE SetProcessPriority(D3D12_COMMAND_QUEUE_PROCESS_PRIORITY Priority)
|
||||
{
|
||||
if(!m_pReal1)
|
||||
return E_NOINTERFACE;
|
||||
return m_pReal1->SetProcessPriority(Priority);
|
||||
}
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetProcessPriority(D3D12_COMMAND_QUEUE_PROCESS_PRIORITY *pOutValue)
|
||||
{
|
||||
if(!m_pReal1)
|
||||
return E_NOINTERFACE;
|
||||
return m_pReal1->GetProcessPriority(pOutValue);
|
||||
}
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetGlobalPriority(D3D12_COMMAND_QUEUE_GLOBAL_PRIORITY Priority)
|
||||
{
|
||||
if(!m_pReal1)
|
||||
return E_NOINTERFACE;
|
||||
return m_pReal1->SetGlobalPriority(Priority);
|
||||
}
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetGlobalPriority(D3D12_COMMAND_QUEUE_GLOBAL_PRIORITY *pOutValue)
|
||||
{
|
||||
if(!m_pReal1)
|
||||
return E_NOINTERFACE;
|
||||
return m_pReal1->GetGlobalPriority(pOutValue);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
|
||||
@@ -505,11 +505,13 @@ WrappedID3D12CommandQueue::WrappedID3D12CommandQueue(ID3D12CommandQueue *real,
|
||||
|
||||
m_WrappedDebug.m_pQueue = this;
|
||||
m_pDownlevel = NULL;
|
||||
m_pReal1 = NULL;
|
||||
if(m_pReal)
|
||||
{
|
||||
m_pReal->QueryInterface(__uuidof(ID3D12DebugCommandQueue), (void **)&m_WrappedDebug.m_pReal);
|
||||
m_pReal->QueryInterface(__uuidof(ID3D12DebugCommandQueue1), (void **)&m_WrappedDebug.m_pReal1);
|
||||
m_pReal->QueryInterface(__uuidof(ID3D12CommandQueueDownlevel), (void **)&m_pDownlevel);
|
||||
m_pReal->QueryInterface(__uuidof(ID3D12CommandQueue1), (void **)&m_pReal1);
|
||||
m_pReal->QueryInterface(__uuidof(ID3D12CompatibilityQueue), (void **)&m_WrappedCompat.m_pReal);
|
||||
}
|
||||
|
||||
@@ -566,6 +568,7 @@ WrappedID3D12CommandQueue::~WrappedID3D12CommandQueue()
|
||||
m_pDevice->RemoveQueue(this);
|
||||
|
||||
SAFE_RELEASE(m_pDownlevel);
|
||||
SAFE_RELEASE(m_pReal1);
|
||||
|
||||
SAFE_RELEASE(m_WrappedCompat.m_pReal);
|
||||
SAFE_RELEASE(m_WrappedDebug.m_pReal);
|
||||
|
||||
@@ -541,6 +541,10 @@ bool D3D12InitParams::IsSupportedVersion(uint64_t ver)
|
||||
if(ver == 0x13)
|
||||
return true;
|
||||
|
||||
// 0x14 -> 0x15 - Add serialisation of new root signature blob in PSO desc
|
||||
if(ver == 0x14)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1596,6 +1600,7 @@ struct D3D12_PTR_PSO_SUBOBJECT
|
||||
D3D12_INPUT_LAYOUT_DESC InputLayout;
|
||||
D3D12_CACHED_PIPELINE_STATE CachedPSO;
|
||||
D3D12_VIEW_INSTANCING_DESC ViewInstancing;
|
||||
D3D12_SERIALIZED_ROOT_SIGNATURE_DESC RootSig;
|
||||
} data;
|
||||
};
|
||||
|
||||
@@ -1712,6 +1717,12 @@ D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC::D3D12_EXPANDED_PIPELINE_STATE_STREAM_
|
||||
ITER_ADV(ID3D12RootSignature *);
|
||||
break;
|
||||
}
|
||||
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SERIALIZED_ROOT_SIGNATURE:
|
||||
{
|
||||
RootSigBlob = ptr->data.RootSig;
|
||||
ITER_ADV(D3D12_SERIALIZED_ROOT_SIGNATURE_DESC);
|
||||
break;
|
||||
}
|
||||
case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS:
|
||||
{
|
||||
VS = ptr->data.shader;
|
||||
@@ -1921,26 +1932,66 @@ D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC::D3D12_EXPANDED_PIPELINE_STATE_STREAM_
|
||||
}
|
||||
}
|
||||
|
||||
ID3D12RootSignature *D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC::GetOrCreateRootSig(
|
||||
WrappedID3D12Device *dev)
|
||||
{
|
||||
if(pRootSignature == NULL && RootSigBlob.SerializedBlobSizeInBytes > 0)
|
||||
{
|
||||
pRootSignature = dev->CreateImplicitRootSig(RootSigBlob);
|
||||
RootSigBlob = {};
|
||||
}
|
||||
|
||||
return pRootSignature;
|
||||
}
|
||||
|
||||
void D3D12_PACKED_PIPELINE_STATE_STREAM_DESC::Unwrap()
|
||||
{
|
||||
m_GraphicsStreamData.pRootSignature = ::Unwrap(m_GraphicsStreamData.pRootSignature);
|
||||
m_ComputeStreamData.pRootSignature = ::Unwrap(m_ComputeStreamData.pRootSignature);
|
||||
*m_RootSigToUnwrap = ::Unwrap(*m_RootSigToUnwrap);
|
||||
}
|
||||
|
||||
D3D12_PACKED_PIPELINE_STATE_STREAM_DESC &D3D12_PACKED_PIPELINE_STATE_STREAM_DESC::operator=(
|
||||
const D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC &expanded)
|
||||
{
|
||||
#define WRITE_VERSIONED_SUBOJBECT(subobjType, subobj) \
|
||||
type = subobjType; \
|
||||
memcpy(ptr, &type, sizeof(type)); \
|
||||
ptr += sizeof(type); \
|
||||
ptr = AlignUpPtr(ptr, alignof(decltype(subobj))); \
|
||||
memcpy(ptr, &subobj, sizeof(subobj)); \
|
||||
ptr += sizeof(subobj); \
|
||||
ptr = AlignUpPtr(ptr, sizeof(void *));
|
||||
|
||||
if(expanded.CS.BytecodeLength > 0)
|
||||
{
|
||||
m_ComputeStreamData.pRootSignature = expanded.pRootSignature;
|
||||
m_ComputeStreamData.CS = expanded.CS;
|
||||
m_ComputeStreamData.NodeMask = expanded.NodeMask;
|
||||
m_ComputeStreamData.CachedPSO = expanded.CachedPSO;
|
||||
m_ComputeStreamData.Flags = expanded.Flags;
|
||||
|
||||
byte *ptr = m_ComputeStreamData.VariableVersionedData;
|
||||
const byte *start = ptr;
|
||||
D3D12_PIPELINE_STATE_SUBOBJECT_TYPE type;
|
||||
|
||||
D3D12_SERIALIZED_ROOT_SIGNATURE_DESC RootSigBlob = expanded.GetRootSigBlob();
|
||||
if(RootSigBlob.SerializedBlobSizeInBytes > 0)
|
||||
{
|
||||
WRITE_VERSIONED_SUBOJBECT(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SERIALIZED_ROOT_SIGNATURE,
|
||||
RootSigBlob);
|
||||
|
||||
m_RootSigToUnwrap = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
ID3D12RootSignature *sig = expanded.GetRootSigIfPresent();
|
||||
WRITE_VERSIONED_SUBOJBECT(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE, sig);
|
||||
|
||||
m_RootSigToUnwrap = ((ID3D12RootSignature **)ptr) - 1;
|
||||
}
|
||||
|
||||
m_VariableVersionedDataLength = ptr - start;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_GraphicsStreamData.pRootSignature = expanded.pRootSignature;
|
||||
m_GraphicsStreamData.VS = expanded.VS;
|
||||
m_GraphicsStreamData.PS = expanded.PS;
|
||||
m_GraphicsStreamData.DS = expanded.DS;
|
||||
@@ -1966,14 +2017,21 @@ D3D12_PACKED_PIPELINE_STATE_STREAM_DESC &D3D12_PACKED_PIPELINE_STATE_STREAM_DESC
|
||||
const byte *start = ptr;
|
||||
D3D12_PIPELINE_STATE_SUBOBJECT_TYPE type;
|
||||
|
||||
#define WRITE_VERSIONED_SUBOJBECT(subobjType, subobj) \
|
||||
type = subobjType; \
|
||||
memcpy(ptr, &type, sizeof(type)); \
|
||||
ptr += sizeof(type); \
|
||||
ptr = AlignUpPtr(ptr, alignof(decltype(subobj))); \
|
||||
memcpy(ptr, &subobj, sizeof(subobj)); \
|
||||
ptr += sizeof(subobj); \
|
||||
ptr = AlignUpPtr(ptr, sizeof(void *));
|
||||
D3D12_SERIALIZED_ROOT_SIGNATURE_DESC RootSigBlob = expanded.GetRootSigBlob();
|
||||
if(RootSigBlob.SerializedBlobSizeInBytes > 0)
|
||||
{
|
||||
WRITE_VERSIONED_SUBOJBECT(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SERIALIZED_ROOT_SIGNATURE,
|
||||
RootSigBlob);
|
||||
|
||||
m_RootSigToUnwrap = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
ID3D12RootSignature *sig = expanded.GetRootSigIfPresent();
|
||||
WRITE_VERSIONED_SUBOJBECT(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE, sig);
|
||||
|
||||
m_RootSigToUnwrap = ((ID3D12RootSignature **)ptr) - 1;
|
||||
}
|
||||
|
||||
// is the line rasterization mode narrow quadrilateral? if so we need version 2.
|
||||
if(expanded.RasterizerState.LineRasterizationMode ==
|
||||
|
||||
@@ -736,8 +736,16 @@ struct D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC
|
||||
|
||||
bool errored = false;
|
||||
|
||||
ID3D12RootSignature *GetRootSigIfPresent() const { return pRootSignature; }
|
||||
ID3D12RootSignature *GetOrCreateRootSig(WrappedID3D12Device *dev);
|
||||
const D3D12_SERIALIZED_ROOT_SIGNATURE_DESC &GetRootSigBlob() const { return RootSigBlob; }
|
||||
void SetRootSig(ID3D12RootSignature *sig)
|
||||
{
|
||||
RootSigBlob = {};
|
||||
pRootSignature = sig;
|
||||
}
|
||||
|
||||
// graphics properties
|
||||
ID3D12RootSignature *pRootSignature = NULL;
|
||||
D3D12_SHADER_BYTECODE VS = {};
|
||||
D3D12_SHADER_BYTECODE PS = {};
|
||||
D3D12_SHADER_BYTECODE DS = {};
|
||||
@@ -763,6 +771,14 @@ struct D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC
|
||||
|
||||
// unique compute properties (many are duplicated above)
|
||||
D3D12_SHADER_BYTECODE CS = {};
|
||||
|
||||
// governed by accessors so we can hide the ugly blob method
|
||||
private:
|
||||
ID3D12RootSignature *pRootSignature = NULL;
|
||||
D3D12_SERIALIZED_ROOT_SIGNATURE_DESC RootSigBlob = {};
|
||||
|
||||
template <typename SerialiserType>
|
||||
friend void DoSerialise(SerialiserType &ser, D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC &el);
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_STRUCT(D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC);
|
||||
@@ -796,7 +812,8 @@ public:
|
||||
if(m_ComputeStreamData.CS.BytecodeLength > 0)
|
||||
{
|
||||
m_StreamDesc.pPipelineStateSubobjectStream = &m_ComputeStreamData;
|
||||
m_StreamDesc.SizeInBytes = sizeof(m_ComputeStreamData);
|
||||
m_StreamDesc.SizeInBytes =
|
||||
offsetof(ComputeStreamData, VariableVersionedData) + m_VariableVersionedDataLength;
|
||||
return &m_StreamDesc;
|
||||
}
|
||||
else
|
||||
@@ -828,8 +845,6 @@ private:
|
||||
struct GraphicsStreamData
|
||||
{
|
||||
// graphics properties
|
||||
SUBOBJECT_HEADER(ROOT_SIGNATURE);
|
||||
ID3D12RootSignature *pRootSignature = NULL;
|
||||
SUBOBJECT_HEADER(INPUT_LAYOUT);
|
||||
D3D12_INPUT_LAYOUT_DESC InputLayout = {};
|
||||
SUBOBJECT_HEADER(VS);
|
||||
@@ -882,7 +897,9 @@ private:
|
||||
// AS ...
|
||||
sizeof(D3D12_SHADER_BYTECODE) + sizeof(void *) +
|
||||
// ... and MS are optional
|
||||
sizeof(D3D12_SHADER_BYTECODE) + sizeof(void *)];
|
||||
sizeof(D3D12_SHADER_BYTECODE) + sizeof(void *) +
|
||||
// root signature could come in pointer or blob form
|
||||
sizeof(D3D12_SERIALIZED_ROOT_SIGNATURE_DESC) + sizeof(void *)];
|
||||
} m_GraphicsStreamData;
|
||||
|
||||
D3D12_SHADER_BYTECODE AS = {};
|
||||
@@ -890,11 +907,9 @@ private:
|
||||
|
||||
size_t m_VariableVersionedDataLength;
|
||||
|
||||
struct
|
||||
struct ComputeStreamData
|
||||
{
|
||||
// compute properties
|
||||
SUBOBJECT_HEADER(ROOT_SIGNATURE);
|
||||
ID3D12RootSignature *pRootSignature = NULL;
|
||||
SUBOBJECT_HEADER(CS);
|
||||
D3D12_SHADER_BYTECODE CS = {};
|
||||
SUBOBJECT_HEADER(NODE_MASK);
|
||||
@@ -903,9 +918,15 @@ private:
|
||||
D3D12_CACHED_PIPELINE_STATE CachedPSO = {};
|
||||
SUBOBJECT_HEADER(FLAGS);
|
||||
D3D12_PIPELINE_STATE_FLAGS Flags = D3D12_PIPELINE_STATE_FLAG_NONE;
|
||||
alignas(void *) byte VariableVersionedData[
|
||||
// root signature could come in pointer or blob form
|
||||
sizeof(D3D12_SERIALIZED_ROOT_SIGNATURE_DESC) + sizeof(void *)];
|
||||
} m_ComputeStreamData;
|
||||
|
||||
D3D12_PIPELINE_STATE_STREAM_DESC m_StreamDesc;
|
||||
|
||||
private:
|
||||
ID3D12RootSignature **m_RootSigToUnwrap;
|
||||
};
|
||||
|
||||
#undef SUBOBJECT_HEADER
|
||||
@@ -1126,6 +1147,8 @@ DECLARE_REFLECTION_STRUCT(D3D12_STATE_SUBOBJECT);
|
||||
DECLARE_REFLECTION_STRUCT(D3D12_STATE_OBJECT_CONFIG);
|
||||
DECLARE_REFLECTION_STRUCT(D3D12_GLOBAL_ROOT_SIGNATURE);
|
||||
DECLARE_REFLECTION_STRUCT(D3D12_LOCAL_ROOT_SIGNATURE);
|
||||
DECLARE_REFLECTION_STRUCT(D3D12_GLOBAL_SERIALIZED_ROOT_SIGNATURE);
|
||||
DECLARE_REFLECTION_STRUCT(D3D12_LOCAL_SERIALIZED_ROOT_SIGNATURE);
|
||||
DECLARE_REFLECTION_STRUCT(D3D12_NODE_MASK);
|
||||
DECLARE_REFLECTION_STRUCT(D3D12_DXIL_LIBRARY_DESC);
|
||||
DECLARE_REFLECTION_STRUCT(D3D12_EXISTING_COLLECTION_DESC);
|
||||
@@ -1139,6 +1162,7 @@ DECLARE_REFLECTION_STRUCT(D3D12_EXPORT_DESC);
|
||||
DECLARE_REFLECTION_STRUCT(D3D12_GPU_VIRTUAL_ADDRESS_RANGE);
|
||||
DECLARE_REFLECTION_STRUCT(D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE);
|
||||
DECLARE_REFLECTION_STRUCT(D3D12_DISPATCH_RAYS_DESC);
|
||||
DECLARE_REFLECTION_STRUCT(D3D12_SERIALIZED_ROOT_SIGNATURE_DESC);
|
||||
|
||||
DECLARE_DESERIALISE_TYPE(D3D12_DISCARD_REGION);
|
||||
DECLARE_DESERIALISE_TYPE(D3D12_GRAPHICS_PIPELINE_STATE_DESC);
|
||||
|
||||
@@ -1683,6 +1683,33 @@ ID3D12Resource *WrappedID3D12Device::GetUploadBuffer(uint64_t chunkOffset, uint6
|
||||
return buf;
|
||||
}
|
||||
|
||||
ID3D12RootSignature *WrappedID3D12Device::CreateImplicitRootSig(
|
||||
D3D12_SERIALIZED_ROOT_SIGNATURE_DESC &RootSigBlob)
|
||||
{
|
||||
rdcfixedarray<uint32_t, 4> hash;
|
||||
DXBC::DXBCContainer::GetHash(hash, false, RootSigBlob.pSerializedBlob,
|
||||
RootSigBlob.SerializedBlobSizeInBytes);
|
||||
|
||||
ID3D12RootSignature *cacheEntry = m_ImplicitRootSigs[hash];
|
||||
|
||||
// if we've already cached this root sig, return it! check for collisions by not trusting th
|
||||
if(cacheEntry)
|
||||
return cacheEntry;
|
||||
|
||||
// otherwise create it
|
||||
HRESULT hr =
|
||||
CreateRootSignature(0, RootSigBlob.pSerializedBlob, RootSigBlob.SerializedBlobSizeInBytes,
|
||||
__uuidof(ID3D12RootSignature), (void **)&cacheEntry);
|
||||
if(cacheEntry)
|
||||
InternalRef();
|
||||
if(FAILED(hr))
|
||||
RDCERR("Failed to create implicit root signature from blob: %s", ToStr(hr).c_str());
|
||||
|
||||
m_ImplicitRootSigs[hash] = cacheEntry;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void WrappedID3D12Device::ApplyInitialContents()
|
||||
{
|
||||
RENDERDOC_PROFILEFUNCTION();
|
||||
@@ -3499,7 +3526,7 @@ HRESULT WrappedID3D12Device::CreatePipeState(D3D12_EXPANDED_PIPELINE_STATE_STREA
|
||||
if(desc.CS.BytecodeLength > 0)
|
||||
{
|
||||
D3D12_COMPUTE_PIPELINE_STATE_DESC compDesc;
|
||||
compDesc.pRootSignature = desc.pRootSignature;
|
||||
compDesc.pRootSignature = desc.GetOrCreateRootSig(this);
|
||||
compDesc.CS = desc.CS;
|
||||
compDesc.NodeMask = desc.NodeMask;
|
||||
compDesc.CachedPSO = desc.CachedPSO;
|
||||
@@ -3509,7 +3536,7 @@ HRESULT WrappedID3D12Device::CreatePipeState(D3D12_EXPANDED_PIPELINE_STATE_STREA
|
||||
else
|
||||
{
|
||||
D3D12_GRAPHICS_PIPELINE_STATE_DESC graphicsDesc;
|
||||
graphicsDesc.pRootSignature = desc.pRootSignature;
|
||||
graphicsDesc.pRootSignature = desc.GetOrCreateRootSig(this);
|
||||
graphicsDesc.VS = desc.VS;
|
||||
graphicsDesc.PS = desc.PS;
|
||||
graphicsDesc.DS = desc.DS;
|
||||
|
||||
@@ -64,7 +64,7 @@ struct D3D12InitParams
|
||||
UINT SDKVersion = 0;
|
||||
|
||||
// check if a frame capture section version is supported
|
||||
static const uint64_t CurrentVersion = 0x14;
|
||||
static const uint64_t CurrentVersion = 0x15;
|
||||
|
||||
static bool IsSupportedVersion(uint64_t ver);
|
||||
};
|
||||
@@ -714,6 +714,8 @@ private:
|
||||
rdcflatmap<uint64_t, ID3D12Resource *> m_UploadBuffers;
|
||||
rdcflatmap<uint64_t, D3D12_RANGE> m_UploadRanges;
|
||||
|
||||
rdcflatmap<rdcfixedarray<uint32_t, 4>, ID3D12RootSignature *> m_ImplicitRootSigs;
|
||||
|
||||
Threading::CriticalSection m_MapsLock;
|
||||
rdcarray<MapState> m_Maps;
|
||||
|
||||
@@ -1081,6 +1083,8 @@ public:
|
||||
void CloseInitialStateList();
|
||||
ID3D12Resource *GetUploadBuffer(uint64_t chunkOffset, uint64_t byteSize);
|
||||
|
||||
ID3D12RootSignature *CreateImplicitRootSig(D3D12_SERIALIZED_ROOT_SIGNATURE_DESC &RootSigBlob);
|
||||
|
||||
HRESULT CreateInitialStateBuffer(const D3D12_RESOURCE_DESC &desc, ID3D12Resource **buf);
|
||||
rdcarray<ID3D12Heap *> m_InitialStateHeaps;
|
||||
UINT64 m_LastInitialStateHeapOffset = 0;
|
||||
|
||||
@@ -121,8 +121,8 @@ bool WrappedID3D12Device::Serialise_CreatePipelineState(SerialiserType &ser,
|
||||
};
|
||||
|
||||
AddResource(pPipelineState, ResourceType::PipelineState, "Pipeline State");
|
||||
if(OrigDescriptor.pRootSignature)
|
||||
DerivedResource(OrigDescriptor.pRootSignature, pPipelineState);
|
||||
if(OrigDescriptor.GetRootSigIfPresent())
|
||||
DerivedResource(OrigDescriptor.GetRootSigIfPresent(), pPipelineState);
|
||||
|
||||
for(size_t i = 0; i < ARRAY_COUNT(shaders); i++)
|
||||
{
|
||||
@@ -329,8 +329,8 @@ HRESULT WrappedID3D12Device::CreatePipelineState(const D3D12_PIPELINE_STATE_STRE
|
||||
record->Length = 0;
|
||||
wrapped->SetResourceRecord(record);
|
||||
|
||||
if(expandedDesc.pRootSignature)
|
||||
record->AddParent(GetRecord(expandedDesc.pRootSignature));
|
||||
if(expandedDesc.GetRootSigIfPresent())
|
||||
record->AddParent(GetRecord(expandedDesc.GetRootSigIfPresent()));
|
||||
|
||||
if(vendorChunk)
|
||||
record->AddChunk(vendorChunk);
|
||||
|
||||
@@ -942,6 +942,12 @@ private:
|
||||
|
||||
static HRESULT WINAPI D3D12GetDebugInterface_hook(REFIID riid, void **ppvDebug)
|
||||
{
|
||||
if(riid == CLSID_D3D12StateObjectFactory)
|
||||
{
|
||||
RDCLOG("Deliberately reporting no support for state object factories");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
IUnknown *realUnk = NULL;
|
||||
HRESULT real = d3d12hooks.GetDebugInterface()(riid, (void **)&realUnk);
|
||||
|
||||
@@ -961,6 +967,12 @@ private:
|
||||
|
||||
static HRESULT WINAPI D3D12GetInterface_hook(REFCLSID rclsid, REFIID riid, void **ppvDebug)
|
||||
{
|
||||
if(riid == CLSID_D3D12StateObjectFactory)
|
||||
{
|
||||
RDCLOG("Deliberately reporting no support for state object factories");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
IUnknown *realUnk = NULL;
|
||||
HRESULT real = d3d12hooks.GetInterface()(rclsid, riid, (void **)&realUnk);
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ struct D3D12QuadOverdrawCallback : public D3D12ActionCallback
|
||||
return;
|
||||
}
|
||||
|
||||
pipeDesc.pRootSignature = cache.sig;
|
||||
pipeDesc.SetRootSig(cache.sig);
|
||||
|
||||
hr = m_pDevice->CreatePipeState(pipeDesc, &cache.pipe);
|
||||
RDCASSERTEQUAL(hr, S_OK);
|
||||
@@ -1617,7 +1617,7 @@ ResourceId D3D12Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De
|
||||
|
||||
D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC pipeDesc;
|
||||
pipe->Fill(pipeDesc);
|
||||
pipeDesc.pRootSignature = GetDebugManager()->GetMeshRootSig();
|
||||
pipeDesc.SetRootSig(GetDebugManager()->GetMeshRootSig());
|
||||
pipeDesc.SampleMask = 0xFFFFFFFF;
|
||||
pipeDesc.SampleDesc = overlayTexDesc.SampleDesc;
|
||||
pipeDesc.IBStripCutValue = D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED;
|
||||
|
||||
@@ -2245,7 +2245,7 @@ void D3D12Replay::InitPostMSBuffers(uint32_t eventId)
|
||||
}
|
||||
}
|
||||
|
||||
pipeDesc.pRootSignature = annotatedSig;
|
||||
pipeDesc.SetRootSig(annotatedSig);
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
@@ -3041,7 +3041,7 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId)
|
||||
psoDesc.DepthStencilState.StencilEnable = FALSE;
|
||||
|
||||
if(soSig)
|
||||
psoDesc.pRootSignature = soSig;
|
||||
psoDesc.SetRootSig(soSig);
|
||||
|
||||
// render as points
|
||||
psoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT;
|
||||
|
||||
@@ -702,9 +702,14 @@ void WrappedID3D12PipelineState::FetchRootSig(D3D12ShaderCache *shaderCache)
|
||||
{
|
||||
if(compute)
|
||||
{
|
||||
if(compute->pRootSignature)
|
||||
if(compute->GetRootSigBlob().SerializedBlobSizeInBytes > 0)
|
||||
{
|
||||
usedSig = ((WrappedID3D12RootSignature *)compute->pRootSignature)->sig;
|
||||
usedSig = DecodeRootSig(compute->GetRootSigBlob().pSerializedBlob,
|
||||
compute->GetRootSigBlob().SerializedBlobSizeInBytes);
|
||||
}
|
||||
else if(compute->GetRootSigIfPresent())
|
||||
{
|
||||
usedSig = ((WrappedID3D12RootSignature *)compute->GetRootSigIfPresent())->sig;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -721,9 +726,14 @@ void WrappedID3D12PipelineState::FetchRootSig(D3D12ShaderCache *shaderCache)
|
||||
}
|
||||
else if(graphics)
|
||||
{
|
||||
if(graphics->pRootSignature)
|
||||
if(graphics->GetRootSigBlob().SerializedBlobSizeInBytes > 0)
|
||||
{
|
||||
usedSig = ((WrappedID3D12RootSignature *)graphics->pRootSignature)->sig;
|
||||
usedSig = DecodeRootSig(graphics->GetRootSigBlob().pSerializedBlob,
|
||||
graphics->GetRootSigBlob().SerializedBlobSizeInBytes);
|
||||
}
|
||||
else if(graphics->GetRootSigIfPresent())
|
||||
{
|
||||
usedSig = ((WrappedID3D12RootSignature *)graphics->GetRootSigIfPresent())->sig;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -881,7 +891,7 @@ void D3D12ShaderExportDatabase::PopulateDatabase(size_t NumSubobjects,
|
||||
const D3D12_STATE_SUBOBJECT *subobjects)
|
||||
{
|
||||
// store the default local root signature - if we only find one in the whole state object then it becomes default
|
||||
ID3D12RootSignature *defaultRoot = NULL;
|
||||
uint32_t defaultRoot = ~0U;
|
||||
bool unassocDefaultValid = false;
|
||||
bool explicitDefault = false;
|
||||
bool unassocDXILDefaultValid = false;
|
||||
@@ -1051,8 +1061,25 @@ void D3D12ShaderExportDatabase::PopulateDatabase(size_t NumSubobjects,
|
||||
if(!explicitDefault)
|
||||
{
|
||||
// if multiple root signatures are defined, then there can't be an unspecified default
|
||||
unassocDefaultValid = defaultRoot == NULL;
|
||||
defaultRoot = ((D3D12_LOCAL_ROOT_SIGNATURE *)subobjects[i].pDesc)->pLocalRootSignature;
|
||||
unassocDefaultValid = (defaultRoot == ~0U);
|
||||
WrappedID3D12RootSignature *wrappedRoot =
|
||||
(WrappedID3D12RootSignature *)((D3D12_LOCAL_ROOT_SIGNATURE *)subobjects[i].pDesc)
|
||||
->pLocalRootSignature;
|
||||
|
||||
defaultRoot = wrappedRoot->localRootSigIdx;
|
||||
}
|
||||
}
|
||||
else if(subobjects[i].Type == D3D12_STATE_SUBOBJECT_TYPE_LOCAL_SERIALIZED_ROOT_SIGNATURE)
|
||||
{
|
||||
// ignore these if an explicit default association has been made
|
||||
if(!explicitDefault)
|
||||
{
|
||||
// if multiple root signatures are defined, then there can't be an unspecified default
|
||||
unassocDefaultValid = (defaultRoot == ~0U);
|
||||
D3D12_SERIALIZED_ROOT_SIGNATURE_DESC &RootDesc =
|
||||
((D3D12_LOCAL_SERIALIZED_ROOT_SIGNATURE *)subobjects[i].pDesc)->Desc;
|
||||
defaultRoot = m_RayManager->RegisterLocalRootSig(
|
||||
DecodeRootSig(RootDesc.pSerializedBlob, RootDesc.SerializedBlobSizeInBytes));
|
||||
}
|
||||
}
|
||||
else if(subobjects[i].Type == D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION)
|
||||
@@ -1063,26 +1090,40 @@ void D3D12ShaderExportDatabase::PopulateDatabase(size_t NumSubobjects,
|
||||
const D3D12_STATE_SUBOBJECT *other = assoc->pSubobjectToAssociate;
|
||||
|
||||
// only care about associating local root signatures
|
||||
if(other->Type == D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE)
|
||||
if(other->Type == D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE ||
|
||||
other->Type == D3D12_STATE_SUBOBJECT_TYPE_LOCAL_SERIALIZED_ROOT_SIGNATURE)
|
||||
{
|
||||
ID3D12RootSignature *root = ((D3D12_LOCAL_ROOT_SIGNATURE *)other->pDesc)->pLocalRootSignature;
|
||||
uint32_t localRSIdx = ~0U;
|
||||
|
||||
WrappedID3D12RootSignature *wrappedRoot = (WrappedID3D12RootSignature *)root;
|
||||
if(other->Type == D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE)
|
||||
{
|
||||
ID3D12RootSignature *root =
|
||||
((D3D12_LOCAL_ROOT_SIGNATURE *)other->pDesc)->pLocalRootSignature;
|
||||
|
||||
WrappedID3D12RootSignature *wrappedRoot = (WrappedID3D12RootSignature *)root;
|
||||
localRSIdx = wrappedRoot->localRootSigIdx;
|
||||
}
|
||||
else if(other->Type == D3D12_STATE_SUBOBJECT_TYPE_LOCAL_SERIALIZED_ROOT_SIGNATURE)
|
||||
{
|
||||
D3D12_SERIALIZED_ROOT_SIGNATURE_DESC &RootDesc =
|
||||
((D3D12_LOCAL_SERIALIZED_ROOT_SIGNATURE *)other->pDesc)->Desc;
|
||||
localRSIdx = m_RayManager->RegisterLocalRootSig(
|
||||
DecodeRootSig(RootDesc.pSerializedBlob, RootDesc.SerializedBlobSizeInBytes));
|
||||
}
|
||||
|
||||
// if there are no exports this is an explicit default association. We assume this
|
||||
// matches and doesn't conflict
|
||||
if(assoc->NumExports == NULL)
|
||||
{
|
||||
explicitDefault = true;
|
||||
defaultRoot = root;
|
||||
defaultRoot = localRSIdx;
|
||||
}
|
||||
else
|
||||
{
|
||||
// otherwise record the explicit associations - these may refer to exports that
|
||||
// haven't been seen yet so we record them locally
|
||||
for(UINT e = 0; e < assoc->NumExports; e++)
|
||||
explicitRootSigAssocs.push_back(
|
||||
{StringFormat::Wide2UTF8(assoc->pExports[e]), wrappedRoot->localRootSigIdx});
|
||||
explicitRootSigAssocs.push_back({StringFormat::Wide2UTF8(assoc->pExports[e]), localRSIdx});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1123,16 +1164,12 @@ void D3D12ShaderExportDatabase::PopulateDatabase(size_t NumSubobjects,
|
||||
|
||||
if(explicitDefault)
|
||||
{
|
||||
WrappedID3D12RootSignature *wrappedRoot = (WrappedID3D12RootSignature *)defaultRoot;
|
||||
|
||||
ApplyDefaultRoot(SubObjectPriority::CodeExplicitDefault, wrappedRoot->localRootSigIdx);
|
||||
ApplyDefaultRoot(SubObjectPriority::CodeExplicitDefault, defaultRoot);
|
||||
}
|
||||
// shouldn't be possible to have both explicit and implicit defaults?
|
||||
else if(unassocDefaultValid)
|
||||
{
|
||||
WrappedID3D12RootSignature *wrappedRoot = (WrappedID3D12RootSignature *)defaultRoot;
|
||||
|
||||
ApplyDefaultRoot(SubObjectPriority::CodeImplicitDefault, wrappedRoot->localRootSigIdx);
|
||||
ApplyDefaultRoot(SubObjectPriority::CodeImplicitDefault, defaultRoot);
|
||||
}
|
||||
|
||||
for(size_t i = 0; i < explicitDxilAssocs.size(); i++)
|
||||
|
||||
@@ -795,7 +795,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class WrappedID3D12PipelineState : public WrappedDeviceChild12<ID3D12PipelineState>
|
||||
class WrappedID3D12PipelineState
|
||||
: public WrappedDeviceChild12<ID3D12PipelineState, ID3D12PipelineState1>
|
||||
{
|
||||
public:
|
||||
ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12PipelineState);
|
||||
@@ -1087,6 +1088,25 @@ public:
|
||||
{
|
||||
return m_pReal->GetCachedBlob(ppBlob);
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
// implement ID3D12PipelineState1
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetRootSignature(REFIID riid, _COM_Outptr_ void **ppvRootSignature)
|
||||
{
|
||||
ID3D12PipelineState1 *real1 = NULL;
|
||||
m_pReal->QueryInterface(__uuidof(ID3D12PipelineState1), (void **)&real1);
|
||||
|
||||
if(ppvRootSignature)
|
||||
*ppvRootSignature = NULL;
|
||||
if(!real1)
|
||||
return E_NOINTERFACE;
|
||||
|
||||
SAFE_RELEASE(real1);
|
||||
|
||||
// unclear if this is supposed to be supported?
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
};
|
||||
|
||||
// the priorities of subobject associations. Default associations are not(?) inherited from
|
||||
@@ -1240,10 +1260,11 @@ private:
|
||||
};
|
||||
|
||||
class WrappedID3D12StateObject : public WrappedDeviceChild12<ID3D12StateObject>,
|
||||
public ID3D12StateObjectProperties1
|
||||
public ID3D12StateObjectProperties2
|
||||
{
|
||||
ID3D12StateObjectProperties *properties;
|
||||
ID3D12StateObjectProperties1 *properties1;
|
||||
ID3D12StateObjectProperties2 *properties2;
|
||||
|
||||
public:
|
||||
ALLOCATE_WITH_WRAPPED_POOL(WrappedID3D12StateObject);
|
||||
@@ -1269,12 +1290,14 @@ public:
|
||||
m_pReal = real;
|
||||
real->QueryInterface(__uuidof(ID3D12StateObjectProperties), (void **)&properties);
|
||||
real->QueryInterface(__uuidof(ID3D12StateObjectProperties1), (void **)&properties1);
|
||||
real->QueryInterface(__uuidof(ID3D12StateObjectProperties2), (void **)&properties2);
|
||||
}
|
||||
|
||||
virtual ~WrappedID3D12StateObject()
|
||||
{
|
||||
SAFE_RELEASE(properties);
|
||||
SAFE_RELEASE(properties1);
|
||||
SAFE_RELEASE(properties2);
|
||||
SAFE_RELEASE(exports);
|
||||
Shutdown();
|
||||
}
|
||||
@@ -1302,6 +1325,19 @@ public:
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
}
|
||||
else if(riid == __uuidof(ID3D12StateObjectProperties2))
|
||||
{
|
||||
if(properties2)
|
||||
{
|
||||
*ppvObject = (ID3D12StateObjectProperties2 *)this;
|
||||
AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
}
|
||||
if(riid == __uuidof(ID3D12WorkGraphProperties))
|
||||
{
|
||||
// work graphs are not currently supported
|
||||
@@ -1350,6 +1386,31 @@ public:
|
||||
return properties1->GetProgramIdentifier(pProgramName);
|
||||
return {};
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
// implement ID3D12StateObjectProperties2
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetGlobalRootSignatureForProgram(
|
||||
LPCWSTR pProgramName, REFIID riid, _COM_Outptr_ void **ppvRootSignature)
|
||||
{
|
||||
if(ppvRootSignature)
|
||||
*ppvRootSignature = NULL;
|
||||
if(!properties2)
|
||||
return E_NOINTERFACE;
|
||||
// unclear if this is supposed to be supported?
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetGlobalRootSignatureForShader(
|
||||
LPCWSTR pExportName, REFIID riid, _COM_Outptr_ void **ppvRootSignature)
|
||||
{
|
||||
if(ppvRootSignature)
|
||||
*ppvRootSignature = NULL;
|
||||
if(!properties2)
|
||||
return E_NOINTERFACE;
|
||||
// unclear if this is supposed to be supported?
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
};
|
||||
|
||||
class WrappedID3D12QueryHeap : public WrappedDeviceChild12<ID3D12QueryHeap>
|
||||
|
||||
@@ -591,10 +591,40 @@ void DoSerialise(SerialiserType &ser, D3D12Descriptor &el)
|
||||
}
|
||||
}
|
||||
|
||||
template <class SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, D3D12_SERIALIZED_ROOT_SIGNATURE_DESC &el)
|
||||
{
|
||||
SERIALISE_MEMBER_ARRAY(pSerializedBlob, SerializedBlobSizeInBytes).Important();
|
||||
|
||||
// don't serialise size_t, otherwise capture/replay between different bit-ness won't work
|
||||
{
|
||||
uint64_t SerializedBlobSizeInBytes = el.SerializedBlobSizeInBytes;
|
||||
ser.Serialise("SerializedBlobSizeInBytes"_lit, SerializedBlobSizeInBytes);
|
||||
if(ser.IsReading())
|
||||
el.SerializedBlobSizeInBytes = (size_t)SerializedBlobSizeInBytes;
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void Deserialise(const D3D12_SERIALIZED_ROOT_SIGNATURE_DESC &el)
|
||||
{
|
||||
FreeAlignedBuffer((byte *)(el.pSerializedBlob));
|
||||
}
|
||||
|
||||
template <class SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC &el)
|
||||
{
|
||||
SERIALISE_MEMBER(pRootSignature);
|
||||
|
||||
if(ser.VersionAtLeast(0x15))
|
||||
{
|
||||
SERIALISE_MEMBER(RootSigBlob);
|
||||
}
|
||||
else if(ser.IsReading())
|
||||
{
|
||||
el.RootSigBlob = {};
|
||||
}
|
||||
|
||||
SERIALISE_MEMBER(VS).Important();
|
||||
SERIALISE_MEMBER(PS).Important();
|
||||
SERIALISE_MEMBER(DS);
|
||||
@@ -606,6 +636,11 @@ void DoSerialise(SerialiserType &ser, D3D12_EXPANDED_PIPELINE_STATE_STREAM_DESC
|
||||
SERIALISE_MEMBER(AS);
|
||||
SERIALISE_MEMBER(MS);
|
||||
}
|
||||
else if(ser.IsReading())
|
||||
{
|
||||
el.AS = {};
|
||||
el.MS = {};
|
||||
}
|
||||
|
||||
SERIALISE_MEMBER(StreamOutput);
|
||||
SERIALISE_MEMBER(BlendState);
|
||||
@@ -2118,9 +2153,17 @@ void Deserialise(const D3D12_STATE_OBJECT_DESC &el)
|
||||
delete temp;
|
||||
break;
|
||||
}
|
||||
case D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE:
|
||||
case D3D12_STATE_SUBOBJECT_TYPE_GLOBAL_SERIALIZED_ROOT_SIGNATURE:
|
||||
{
|
||||
D3D12_LOCAL_ROOT_SIGNATURE *temp = (D3D12_LOCAL_ROOT_SIGNATURE *)el.pSubobjects[i].pDesc;
|
||||
D3D12_GLOBAL_SERIALIZED_ROOT_SIGNATURE *temp =
|
||||
(D3D12_GLOBAL_SERIALIZED_ROOT_SIGNATURE *)el.pSubobjects[i].pDesc;
|
||||
delete temp;
|
||||
break;
|
||||
}
|
||||
case D3D12_STATE_SUBOBJECT_TYPE_LOCAL_SERIALIZED_ROOT_SIGNATURE:
|
||||
{
|
||||
D3D12_LOCAL_SERIALIZED_ROOT_SIGNATURE *temp =
|
||||
(D3D12_LOCAL_SERIALIZED_ROOT_SIGNATURE *)el.pSubobjects[i].pDesc;
|
||||
delete temp;
|
||||
break;
|
||||
}
|
||||
@@ -2213,6 +2256,12 @@ void DoSerialise(SerialiserType &ser, D3D12_STATE_SUBOBJECT &el)
|
||||
case D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE:
|
||||
ser.SerialiseNullable("pDesc"_lit, (D3D12_LOCAL_ROOT_SIGNATURE *&)el.pDesc);
|
||||
break;
|
||||
case D3D12_STATE_SUBOBJECT_TYPE_GLOBAL_SERIALIZED_ROOT_SIGNATURE:
|
||||
ser.SerialiseNullable("pDesc"_lit, (D3D12_GLOBAL_SERIALIZED_ROOT_SIGNATURE *&)el.pDesc);
|
||||
break;
|
||||
case D3D12_STATE_SUBOBJECT_TYPE_LOCAL_SERIALIZED_ROOT_SIGNATURE:
|
||||
ser.SerialiseNullable("pDesc"_lit, (D3D12_LOCAL_SERIALIZED_ROOT_SIGNATURE *&)el.pDesc);
|
||||
break;
|
||||
case D3D12_STATE_SUBOBJECT_TYPE_NODE_MASK:
|
||||
ser.SerialiseNullable("pDesc"_lit, (D3D12_NODE_MASK *&)el.pDesc);
|
||||
break;
|
||||
@@ -2262,6 +2311,18 @@ void DoSerialise(SerialiserType &ser, D3D12_LOCAL_ROOT_SIGNATURE &el)
|
||||
SERIALISE_MEMBER(pLocalRootSignature);
|
||||
}
|
||||
|
||||
template <class SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, D3D12_GLOBAL_SERIALIZED_ROOT_SIGNATURE &el)
|
||||
{
|
||||
SERIALISE_MEMBER(Desc);
|
||||
}
|
||||
|
||||
template <class SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, D3D12_LOCAL_SERIALIZED_ROOT_SIGNATURE &el)
|
||||
{
|
||||
SERIALISE_MEMBER(Desc);
|
||||
}
|
||||
|
||||
template <class SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, D3D12_NODE_MASK &el)
|
||||
{
|
||||
@@ -2592,6 +2653,8 @@ INSTANTIATE_SERIALISE_TYPE(D3D12_STATE_SUBOBJECT);
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D12_STATE_OBJECT_CONFIG);
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D12_GLOBAL_ROOT_SIGNATURE);
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D12_LOCAL_ROOT_SIGNATURE);
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D12_GLOBAL_SERIALIZED_ROOT_SIGNATURE);
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D12_LOCAL_SERIALIZED_ROOT_SIGNATURE);
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D12_NODE_MASK);
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D12_DXIL_LIBRARY_DESC);
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D12_EXISTING_COLLECTION_DESC);
|
||||
@@ -2605,3 +2668,4 @@ INSTANTIATE_SERIALISE_TYPE(D3D12_EXPORT_DESC);
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D12_GPU_VIRTUAL_ADDRESS_RANGE);
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE);
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D12_DISPATCH_RAYS_DESC);
|
||||
INSTANTIATE_SERIALISE_TYPE(D3D12_SERIALIZED_ROOT_SIGNATURE_DESC);
|
||||
|
||||
@@ -1572,7 +1572,7 @@ bool D3D12Replay::FetchShaderFeedback(uint32_t eventId)
|
||||
ID3D12PipelineState *annotatedPipe = NULL;
|
||||
|
||||
{
|
||||
pipeDesc.pRootSignature = annotatedSig;
|
||||
pipeDesc.SetRootSig(annotatedSig);
|
||||
|
||||
HRESULT hr = m_pDevice->CreatePipeState(pipeDesc, &annotatedPipe);
|
||||
if(annotatedPipe == NULL || FAILED(hr))
|
||||
|
||||
@@ -2353,7 +2353,7 @@ ShaderDebugTrace *D3D12Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui
|
||||
|
||||
pipeDesc.VS.BytecodeLength = vsBlob->GetBufferSize();
|
||||
pipeDesc.VS.pShaderBytecode = vsBlob->GetBufferPointer();
|
||||
pipeDesc.pRootSignature = pRootSignature;
|
||||
pipeDesc.SetRootSig(pRootSignature);
|
||||
|
||||
// disable rasterizaion
|
||||
pipeDesc.PS = {};
|
||||
@@ -2969,7 +2969,7 @@ ShaderDebugTrace *D3D12Replay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t
|
||||
// All PSO state is the same as the event's, except for the pixel shader and root signature
|
||||
pipeDesc.PS.BytecodeLength = psBlob->GetBufferSize();
|
||||
pipeDesc.PS.pShaderBytecode = psBlob->GetBufferPointer();
|
||||
pipeDesc.pRootSignature = pRootSignature;
|
||||
pipeDesc.SetRootSig(pRootSignature);
|
||||
|
||||
ID3D12PipelineState *initialPso = NULL;
|
||||
HRESULT hr = m_pDevice->CreatePipeState(pipeDesc, &initialPso);
|
||||
@@ -3632,7 +3632,7 @@ ShaderDebugTrace *D3D12Replay::DebugThread(uint32_t eventId,
|
||||
|
||||
pipeDesc.CS.BytecodeLength = csBlob->GetBufferSize();
|
||||
pipeDesc.CS.pShaderBytecode = csBlob->GetBufferPointer();
|
||||
pipeDesc.pRootSignature = pRootSignature;
|
||||
pipeDesc.SetRootSig(pRootSignature);
|
||||
|
||||
ID3D12PipelineState *initialPso = NULL;
|
||||
HRESULT hr = m_pDevice->CreatePipeState(pipeDesc, &initialPso);
|
||||
|
||||
@@ -1045,7 +1045,7 @@ rdcstr DoStringise(const D3D12_BARRIER_LAYOUT &el)
|
||||
STRINGISE_ENUM(D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE)
|
||||
STRINGISE_ENUM(D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE)
|
||||
STRINGISE_ENUM(D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST)
|
||||
STRINGISE_ENUM(D3D12_BARRIER_LAYOUT_VIDEO_QUEUE_COMMON)
|
||||
STRINGISE_ENUM(D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ_COMPUTE_QUEUE_ACCESSIBLE)
|
||||
}
|
||||
END_ENUM_STRINGISE();
|
||||
}
|
||||
@@ -1230,6 +1230,7 @@ rdcstr DoStringise(const D3D12_RESOURCE_FLAGS &el)
|
||||
STRINGISE_BITFIELD_BIT(D3D12_RESOURCE_FLAG_VIDEO_DECODE_REFERENCE_ONLY);
|
||||
STRINGISE_BITFIELD_BIT(D3D12_RESOURCE_FLAG_VIDEO_ENCODE_REFERENCE_ONLY);
|
||||
STRINGISE_BITFIELD_BIT(D3D12_RESOURCE_FLAG_RAYTRACING_ACCELERATION_STRUCTURE);
|
||||
STRINGISE_BITFIELD_BIT(D3D12_RESOURCE_FLAG_USE_TIGHT_ALIGNMENT);
|
||||
}
|
||||
END_BITFIELD_STRINGISE();
|
||||
}
|
||||
@@ -1242,6 +1243,7 @@ rdcstr DoStringise(const D3D12_COMMAND_QUEUE_FLAGS &el)
|
||||
STRINGISE_BITFIELD_VALUE(D3D12_COMMAND_QUEUE_FLAG_NONE);
|
||||
|
||||
STRINGISE_BITFIELD_BIT(D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT);
|
||||
STRINGISE_BITFIELD_BIT(D3D12_COMMAND_QUEUE_FLAG_ALLOW_DYNAMIC_PRIORITY);
|
||||
}
|
||||
END_BITFIELD_STRINGISE();
|
||||
}
|
||||
@@ -1625,6 +1627,10 @@ rdcstr DoStringise(const D3D12_STATE_SUBOBJECT_TYPE &el)
|
||||
STRINGISE_ENUM(D3D12_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING);
|
||||
STRINGISE_ENUM(D3D12_STATE_SUBOBJECT_TYPE_GENERIC_PROGRAM);
|
||||
STRINGISE_ENUM(D3D12_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2);
|
||||
STRINGISE_ENUM(D3D12_STATE_SUBOBJECT_TYPE_GLOBAL_SERIALIZED_ROOT_SIGNATURE);
|
||||
STRINGISE_ENUM(D3D12_STATE_SUBOBJECT_TYPE_LOCAL_SERIALIZED_ROOT_SIGNATURE);
|
||||
STRINGISE_ENUM(D3D12_STATE_SUBOBJECT_TYPE_COMPILER_EXISITING_COLLECTION);
|
||||
STRINGISE_ENUM(D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION_BY_KEY);
|
||||
STRINGISE_ENUM(D3D12_STATE_SUBOBJECT_TYPE_MAX_VALID);
|
||||
}
|
||||
END_ENUM_STRINGISE();
|
||||
@@ -1834,6 +1840,10 @@ rdcstr DoStringise(const D3D12_FEATURE &el)
|
||||
STRINGISE_ENUM(D3D12_FEATURE_PLACED_RESOURCE_SUPPORT_INFO);
|
||||
STRINGISE_ENUM(D3D12_FEATURE_HARDWARE_COPY);
|
||||
STRINGISE_ENUM(D3D12_FEATURE_D3D12_OPTIONS21);
|
||||
STRINGISE_ENUM(D3D12_FEATURE_D3D12_TIGHT_ALIGNMENT);
|
||||
STRINGISE_ENUM(D3D12_FEATURE_APPLICATION_SPECIFIC_DRIVER_STATE);
|
||||
STRINGISE_ENUM(D3D12_FEATURE_BYTECODE_BYPASS_HASH_SUPPORTED);
|
||||
STRINGISE_ENUM(D3D12_FEATURE_SHADER_CACHE_ABI_SUPPORT);
|
||||
}
|
||||
END_ENUM_STRINGISE();
|
||||
}
|
||||
|
||||
+1294
-170
File diff suppressed because it is too large
Load Diff
@@ -3360,8 +3360,10 @@ enum D3D12_MESSAGE_ID
|
||||
D3D12_MESSAGE_ID_RENDER_TARGET_OR_DEPTH_STENCIL_RESOUCE_NOT_INITIALIZED = 1422,
|
||||
D3D12_MESSAGE_ID_BYTECODE_VALIDATION_ERROR = 1423,
|
||||
D3D12_MESSAGE_ID_FENCE_ZERO_WAIT = 1424,
|
||||
D3D12_MESSAGE_ID_NON_COMMON_RESOURCE_IN_COPY_QUEUE = 1425,
|
||||
D3D12_MESSAGE_ID_D3D12_MESSAGES_END = ( D3D12_MESSAGE_ID_NON_COMMON_RESOURCE_IN_COPY_QUEUE + 1 )
|
||||
D3D12_MESSAGE_ID_NON_COMMON_RESOURCE_IN_COPY_QUEUE = 1431,
|
||||
D3D12_MESSAGE_ID_CREATEPIPELINESTATE_MULTIPLE_ROOT_SIGNATURES_DEFINED = 1435,
|
||||
D3D12_MESSAGE_ID_TEXTURE_BARRIER_INVALID_FLAGS = 1436,
|
||||
D3D12_MESSAGE_ID_D3D12_MESSAGES_END = 1442
|
||||
} D3D12_MESSAGE_ID;
|
||||
|
||||
typedef struct D3D12_MESSAGE
|
||||
|
||||
+1294
-170
File diff suppressed because it is too large
Load Diff
@@ -3360,8 +3360,10 @@ enum D3D12_MESSAGE_ID
|
||||
D3D12_MESSAGE_ID_RENDER_TARGET_OR_DEPTH_STENCIL_RESOUCE_NOT_INITIALIZED = 1422,
|
||||
D3D12_MESSAGE_ID_BYTECODE_VALIDATION_ERROR = 1423,
|
||||
D3D12_MESSAGE_ID_FENCE_ZERO_WAIT = 1424,
|
||||
D3D12_MESSAGE_ID_NON_COMMON_RESOURCE_IN_COPY_QUEUE = 1425,
|
||||
D3D12_MESSAGE_ID_D3D12_MESSAGES_END = ( D3D12_MESSAGE_ID_NON_COMMON_RESOURCE_IN_COPY_QUEUE + 1 )
|
||||
D3D12_MESSAGE_ID_NON_COMMON_RESOURCE_IN_COPY_QUEUE = 1431,
|
||||
D3D12_MESSAGE_ID_CREATEPIPELINESTATE_MULTIPLE_ROOT_SIGNATURES_DEFINED = 1435,
|
||||
D3D12_MESSAGE_ID_TEXTURE_BARRIER_INVALID_FLAGS = 1436,
|
||||
D3D12_MESSAGE_ID_D3D12_MESSAGES_END = 1442
|
||||
} D3D12_MESSAGE_ID;
|
||||
|
||||
typedef struct D3D12_MESSAGE
|
||||
|
||||
Reference in New Issue
Block a user