Skip to content

Commit

Permalink
Fix some call IDs missing in to-string generator (#1200)
Browse files Browse the repository at this point in the history
  • Loading branch information
rurra-amd authored Aug 9, 2023
1 parent f5f4b8c commit 7a7d18d
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def write_include(self):

def write_function_call(self):
code = (
"std::wstring GetDx12CallIdString(format::ApiCallId call_id){}\n"
"inline std::wstring GetDx12CallIdString(format::ApiCallId call_id){}\n"
"\n"
.format(
self.get_function_call_body()
Expand All @@ -75,16 +75,14 @@ def write_function_call(self):
def get_function_call_body(self):
code = '\n'\
'{\n'\
' std::wstring out = L"Unknown";\n'\
' std::wstring out = L"Unknown_ApiCallId";\n'\
' switch (call_id)\n'\
' {\n'

header_dict = self.source_dict['header_dict']
for k, v in header_dict.items():
for m in v.functions:
if self.is_required_function_data(m) and (
not self.is_cmd_black_listed(m['name'])
):
if self.is_required_function_data(m):
code += (
" case format::ApiCallId::ApiCall_{0}:\n"
" out = L\"{0}\";\n"
Expand All @@ -94,16 +92,14 @@ def get_function_call_body(self):
for class_name, class_value in v.classes.items():
if self.is_required_class_data(class_value):
for m in class_value['methods']['public']:
if not self.is_method_black_listed(
class_name, m['name']
):
code += (
" case format::ApiCallId::ApiCall_{0}_{1}:\n"
" out = L\"{0}_{1}\";\n"
" break;\n".format(
class_name, m['name']
)
code += (
" case format::ApiCallId::ApiCall_{0}_{1}:\n"
" out = L\"{0}_{1}\";\n"
" break;\n".format(
class_name, m['name']
)
)


code += ' default:\n'\
' break;\n'\
Expand Down
76 changes: 74 additions & 2 deletions framework/generated/generated_dx12_call_id_to_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
GFXRECON_BEGIN_NAMESPACE(gfxrecon)
GFXRECON_BEGIN_NAMESPACE(util)

std::wstring GetDx12CallIdString(format::ApiCallId call_id)
inline std::wstring GetDx12CallIdString(format::ApiCallId call_id)
{
std::wstring out = L"Unknown";
std::wstring out = L"Unknown_ApiCallId";
switch (call_id)
{
case format::ApiCallId::ApiCall_CreateDXGIFactory:
Expand Down Expand Up @@ -476,6 +476,9 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_IDXGIDevice4_ReclaimResources1:
out = L"IDXGIDevice4_ReclaimResources1";
break;
case format::ApiCallId::ApiCall_IDXGIFactory5_CheckFeatureSupport:
out = L"IDXGIFactory5_CheckFeatureSupport";
break;
case format::ApiCallId::ApiCall_DXGIDeclareAdapterRemovalSupport:
out = L"DXGIDeclareAdapterRemovalSupport";
break;
Expand All @@ -500,6 +503,9 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_D3D12SerializeRootSignature:
out = L"D3D12SerializeRootSignature";
break;
case format::ApiCallId::ApiCall_D3D12CreateRootSignatureDeserializer:
out = L"D3D12CreateRootSignatureDeserializer";
break;
case format::ApiCallId::ApiCall_D3D12SerializeVersionedRootSignature:
out = L"D3D12SerializeVersionedRootSignature";
break;
Expand Down Expand Up @@ -533,18 +539,33 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_ID3D12DeviceChild_GetDevice:
out = L"ID3D12DeviceChild_GetDevice";
break;
case format::ApiCallId::ApiCall_ID3D12RootSignatureDeserializer_GetRootSignatureDesc:
out = L"ID3D12RootSignatureDeserializer_GetRootSignatureDesc";
break;
case format::ApiCallId::ApiCall_ID3D12VersionedRootSignatureDeserializer_GetRootSignatureDescAtVersion:
out = L"ID3D12VersionedRootSignatureDeserializer_GetRootSignatureDescAtVersion";
break;
case format::ApiCallId::ApiCall_ID3D12VersionedRootSignatureDeserializer_GetUnconvertedRootSignatureDesc:
out = L"ID3D12VersionedRootSignatureDeserializer_GetUnconvertedRootSignatureDesc";
break;
case format::ApiCallId::ApiCall_ID3D12Heap_GetDesc:
out = L"ID3D12Heap_GetDesc";
break;
case format::ApiCallId::ApiCall_ID3D12Resource_Map:
out = L"ID3D12Resource_Map";
break;
case format::ApiCallId::ApiCall_ID3D12Resource_Unmap:
out = L"ID3D12Resource_Unmap";
break;
case format::ApiCallId::ApiCall_ID3D12Resource_GetDesc:
out = L"ID3D12Resource_GetDesc";
break;
case format::ApiCallId::ApiCall_ID3D12Resource_GetGPUVirtualAddress:
out = L"ID3D12Resource_GetGPUVirtualAddress";
break;
case format::ApiCallId::ApiCall_ID3D12Resource_WriteToSubresource:
out = L"ID3D12Resource_WriteToSubresource";
break;
case format::ApiCallId::ApiCall_ID3D12Resource_ReadFromSubresource:
out = L"ID3D12Resource_ReadFromSubresource";
break;
Expand All @@ -569,6 +590,18 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_ID3D12PipelineState_GetCachedBlob:
out = L"ID3D12PipelineState_GetCachedBlob";
break;
case format::ApiCallId::ApiCall_ID3D12DescriptorHeap_GetDesc:
out = L"ID3D12DescriptorHeap_GetDesc";
break;
case format::ApiCallId::ApiCall_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart:
out = L"ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart";
break;
case format::ApiCallId::ApiCall_ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart:
out = L"ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart";
break;
case format::ApiCallId::ApiCall_ID3D12CommandList_GetType:
out = L"ID3D12CommandList_GetType";
break;
case format::ApiCallId::ApiCall_ID3D12GraphicsCommandList_Close:
out = L"ID3D12GraphicsCommandList_Close";
break;
Expand Down Expand Up @@ -620,6 +653,9 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_ID3D12GraphicsCommandList_SetPipelineState:
out = L"ID3D12GraphicsCommandList_SetPipelineState";
break;
case format::ApiCallId::ApiCall_ID3D12GraphicsCommandList_ResourceBarrier:
out = L"ID3D12GraphicsCommandList_ResourceBarrier";
break;
case format::ApiCallId::ApiCall_ID3D12GraphicsCommandList_ExecuteBundle:
out = L"ID3D12GraphicsCommandList_ExecuteBundle";
break;
Expand Down Expand Up @@ -770,6 +806,9 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_ID3D12CommandQueue_GetClockCalibration:
out = L"ID3D12CommandQueue_GetClockCalibration";
break;
case format::ApiCallId::ApiCall_ID3D12CommandQueue_GetDesc:
out = L"ID3D12CommandQueue_GetDesc";
break;
case format::ApiCallId::ApiCall_ID3D12Device_GetNodeCount:
out = L"ID3D12Device_GetNodeCount";
break;
Expand All @@ -788,12 +827,18 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_ID3D12Device_CreateCommandList:
out = L"ID3D12Device_CreateCommandList";
break;
case format::ApiCallId::ApiCall_ID3D12Device_CheckFeatureSupport:
out = L"ID3D12Device_CheckFeatureSupport";
break;
case format::ApiCallId::ApiCall_ID3D12Device_CreateDescriptorHeap:
out = L"ID3D12Device_CreateDescriptorHeap";
break;
case format::ApiCallId::ApiCall_ID3D12Device_GetDescriptorHandleIncrementSize:
out = L"ID3D12Device_GetDescriptorHandleIncrementSize";
break;
case format::ApiCallId::ApiCall_ID3D12Device_CreateRootSignature:
out = L"ID3D12Device_CreateRootSignature";
break;
case format::ApiCallId::ApiCall_ID3D12Device_CreateConstantBufferView:
out = L"ID3D12Device_CreateConstantBufferView";
break;
Expand All @@ -818,6 +863,12 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_ID3D12Device_CopyDescriptorsSimple:
out = L"ID3D12Device_CopyDescriptorsSimple";
break;
case format::ApiCallId::ApiCall_ID3D12Device_GetResourceAllocationInfo:
out = L"ID3D12Device_GetResourceAllocationInfo";
break;
case format::ApiCallId::ApiCall_ID3D12Device_GetCustomHeapProperties:
out = L"ID3D12Device_GetCustomHeapProperties";
break;
case format::ApiCallId::ApiCall_ID3D12Device_CreateCommittedResource:
out = L"ID3D12Device_CreateCommittedResource";
break;
Expand Down Expand Up @@ -866,6 +917,9 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_ID3D12Device_GetResourceTiling:
out = L"ID3D12Device_GetResourceTiling";
break;
case format::ApiCallId::ApiCall_ID3D12Device_GetAdapterLuid:
out = L"ID3D12Device_GetAdapterLuid";
break;
case format::ApiCallId::ApiCall_ID3D12PipelineLibrary_StorePipeline:
out = L"ID3D12PipelineLibrary_StorePipeline";
break;
Expand All @@ -884,6 +938,9 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_ID3D12PipelineLibrary1_LoadPipeline:
out = L"ID3D12PipelineLibrary1_LoadPipeline";
break;
case format::ApiCallId::ApiCall_ID3D12Device1_CreatePipelineLibrary:
out = L"ID3D12Device1_CreatePipelineLibrary";
break;
case format::ApiCallId::ApiCall_ID3D12Device1_SetEventOnMultipleFenceCompletion:
out = L"ID3D12Device1_SetEventOnMultipleFenceCompletion";
break;
Expand All @@ -908,6 +965,9 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_ID3D12ProtectedSession_GetSessionStatus:
out = L"ID3D12ProtectedSession_GetSessionStatus";
break;
case format::ApiCallId::ApiCall_ID3D12ProtectedResourceSession_GetDesc:
out = L"ID3D12ProtectedResourceSession_GetDesc";
break;
case format::ApiCallId::ApiCall_ID3D12Device4_CreateCommandList1:
out = L"ID3D12Device4_CreateCommandList1";
break;
Expand All @@ -923,6 +983,9 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_ID3D12Device4_CreateReservedResource1:
out = L"ID3D12Device4_CreateReservedResource1";
break;
case format::ApiCallId::ApiCall_ID3D12Device4_GetResourceAllocationInfo1:
out = L"ID3D12Device4_GetResourceAllocationInfo1";
break;
case format::ApiCallId::ApiCall_ID3D12LifetimeOwner_LifetimeStateUpdated:
out = L"ID3D12LifetimeOwner_LifetimeStateUpdated";
break;
Expand Down Expand Up @@ -1307,6 +1370,9 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_ID3D12InfoQueue_ClearStoredMessages:
out = L"ID3D12InfoQueue_ClearStoredMessages";
break;
case format::ApiCallId::ApiCall_ID3D12InfoQueue_GetMessage:
out = L"ID3D12InfoQueue_GetMessage";
break;
case format::ApiCallId::ApiCall_ID3D12InfoQueue_GetNumMessagesAllowedByStorageFilter:
out = L"ID3D12InfoQueue_GetNumMessagesAllowedByStorageFilter";
break;
Expand All @@ -1328,6 +1394,9 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_ID3D12InfoQueue_AddStorageFilterEntries:
out = L"ID3D12InfoQueue_AddStorageFilterEntries";
break;
case format::ApiCallId::ApiCall_ID3D12InfoQueue_GetStorageFilter:
out = L"ID3D12InfoQueue_GetStorageFilter";
break;
case format::ApiCallId::ApiCall_ID3D12InfoQueue_ClearStorageFilter:
out = L"ID3D12InfoQueue_ClearStorageFilter";
break;
Expand All @@ -1349,6 +1418,9 @@ std::wstring GetDx12CallIdString(format::ApiCallId call_id)
case format::ApiCallId::ApiCall_ID3D12InfoQueue_AddRetrievalFilterEntries:
out = L"ID3D12InfoQueue_AddRetrievalFilterEntries";
break;
case format::ApiCallId::ApiCall_ID3D12InfoQueue_GetRetrievalFilter:
out = L"ID3D12InfoQueue_GetRetrievalFilter";
break;
case format::ApiCallId::ApiCall_ID3D12InfoQueue_ClearRetrievalFilter:
out = L"ID3D12InfoQueue_ClearRetrievalFilter";
break;
Expand Down

0 comments on commit 7a7d18d

Please sign in to comment.