D3D12: Add Quad integration test with texture sampling

- Add quad test that renders a textured quad with earth texture
- Add quad.hlsl shader with texture sampling (Texture2D + SamplerState)
- Add SRV descriptor heap and root signature with SRV table
- Fix MessageBox errors -> Log() console output
- Fix shader float2->float4 type mismatch
- Fix texture initialization to use proper command list handling
- Add shader error output to stderr in D3D12Shader
- Add Map error logging in D3D12Screenshot
This commit is contained in:
2026-03-21 12:38:16 +08:00
parent 91291b2075
commit c563db3123
7 changed files with 519 additions and 0 deletions

View File

@@ -159,6 +159,7 @@ bool D3D12Screenshot::CopyToReadbackAndSave(ID3D12Device* device,
unsigned char* mappedData = nullptr;
hr = readbackBuffer->Map(0, &readRange, (void**)&mappedData);
if (FAILED(hr)) {
XCEngine::Debug::Logger::Get().Error(XCEngine::Debug::LogCategory::Rendering, "Screenshot: Map failed");
cmdList->Release();
cmdAlloc->Release();
readbackBuffer->Release();

View File

@@ -20,6 +20,7 @@ bool D3D12Shader::CompileFromFile(const wchar_t* filePath, const char* entryPoin
if (m_error) {
const char* errorMsg = static_cast<const char*>(m_error->GetBufferPointer());
OutputDebugStringA(errorMsg);
fprintf(stderr, "[SHADER ERROR] %s\n", errorMsg);
}
return false;
}