refactor: 删除旧的RHI实现,添加D3D12测试用例和第二阶段计划

This commit is contained in:
2026-03-15 01:58:30 +08:00
parent 9932d860a7
commit f427eb2588
32 changed files with 9454 additions and 2929 deletions

View File

@@ -1,40 +0,0 @@
#include <Rendering\Shader.h>
#include <d3dcompiler.h>
#include <wrl/client.h>
#include <string>
namespace XCEngine {
namespace RHI {
bool CompileShader(const char* filePath, const char* entryPoint, const char* target, ShaderBytecode& outBytecode) {
UINT flags = D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION;
ID3DBlob* shaderBuffer = nullptr;
ID3DBlob* errorBuffer = nullptr;
HRESULT hr = D3DCompileFromFile(
std::wstring(filePath, filePath + strlen(filePath)).c_str(),
nullptr,
nullptr,
entryPoint,
target,
flags,
0,
&shaderBuffer,
&errorBuffer);
if (FAILED(hr)) {
if (errorBuffer) {
OutputDebugStringA((const char*)errorBuffer->GetBufferPointer());
errorBuffer->Release();
}
return false;
}
outBytecode.bytecode = shaderBuffer->GetBufferPointer();
outBytecode.size = shaderBuffer->GetBufferSize();
return true;
}
} // namespace RHI
} // namespace XCEngine