refactor: 将截图功能移到RHI模块的D3D12Screenshot类

This commit is contained in:
2026-03-15 15:39:15 +08:00
parent c79533c436
commit 4881aee70a
4 changed files with 209 additions and 176 deletions

View File

@@ -0,0 +1,28 @@
#pragma once
#include <d3d12.h>
#include <string>
namespace XCEngine {
namespace RHI {
class D3D12Screenshot {
public:
static bool Capture(ID3D12Device* device,
ID3D12CommandQueue* commandQueue,
ID3D12Resource* renderTarget,
const char* filename,
uint32_t width,
uint32_t height);
private:
static bool CopyToReadbackAndSave(ID3D12Device* device,
ID3D12CommandQueue* commandQueue,
ID3D12Resource* renderTarget,
const char* filename,
uint32_t width,
uint32_t height);
};
} // namespace RHI
} // namespace XCEngine