Add GetDescriptorHandleIncrementSize to D3D12Device and update main.cpp to use wrapper

This commit is contained in:
2026-03-15 20:31:37 +08:00
parent 3e6388c221
commit 2a5fc4f0d4
5 changed files with 19 additions and 3 deletions

View File

@@ -147,5 +147,13 @@ void D3D12Buffer::Shutdown() {
m_resource.Reset();
}
void D3D12Buffer::UpdateData(const void* data, uint64_t size) {
D3D12_RANGE range = { 0, static_cast<SIZE_T>(size) };
unsigned char* pBuffer = nullptr;
m_resource->Map(0, &range, reinterpret_cast<void**>(&pBuffer));
memcpy(pBuffer, data, static_cast<size_t>(size));
m_resource->Unmap(0, nullptr);
}
} // namespace RHI
} // namespace XCEngine

View File

@@ -165,5 +165,9 @@ std::vector<AdapterInfo> D3D12Device::EnumerateAdapters() {
return adapters;
}
UINT D3D12Device::GetDescriptorHandleIncrementSize(DescriptorHeapType type) const {
return m_device->GetDescriptorHandleIncrementSize(ToD3D12(type));
}
} // namespace RHI
} // namespace XCEngine