Fix RHI format conversion and add debug logging for D3D12 tests

This commit is contained in:
2026-03-25 17:30:16 +08:00
parent 9c082c72fa
commit 295459067f
10 changed files with 146 additions and 5 deletions

View File

@@ -11,6 +11,9 @@ D3D12Texture::~D3D12Texture() {
}
bool D3D12Texture::Initialize(ID3D12Device* device, const D3D12_RESOURCE_DESC& desc, D3D12_RESOURCE_STATES initialState) {
FILE* f = fopen("D:\\Xuanchi\\Main\\XCEngine\\debug_rhi.log", "a");
if (f) { fprintf(f, "[D3D12Texture::Initialize] Start, device=%p\n", device); fclose(f); }
D3D12_HEAP_PROPERTIES heapProperties = {};
heapProperties.Type = D3D12_HEAP_TYPE_DEFAULT;
heapProperties.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN;
@@ -30,6 +33,8 @@ bool D3D12Texture::Initialize(ID3D12Device* device, const D3D12_RESOURCE_DESC& d
);
if (FAILED(hResult)) {
FILE* f2 = fopen("D:\\Xuanchi\\Main\\XCEngine\\debug_rhi.log", "a");
if (f2) { fprintf(f2, "[D3D12Texture::Initialize] CreateCommittedResource failed: hr=0x%08X\n", hResult); fclose(f2); }
return false;
}