feat: update editor ui framework and assets

This commit is contained in:
2026-03-28 15:07:19 +08:00
parent 4a12e26860
commit 4717b595c4
45 changed files with 2434 additions and 461 deletions

View File

@@ -4,6 +4,7 @@
#include <d3d12.h>
#include <dxgi1_6.h>
#include <array>
#include <windows.h>
namespace XCEngine {
@@ -12,6 +13,8 @@ namespace Platform {
class D3D12WindowRenderer {
public:
static constexpr UINT kSrvDescriptorCount = 64;
bool Initialize(HWND hwnd, int width, int height) {
m_hwnd = hwnd;
m_width = width;
@@ -36,7 +39,9 @@ public:
m_height = 720;
m_fenceValue = 0;
m_rtvDescriptorSize = 0;
m_srvDescriptorSize = 0;
m_frameIndex = 0;
m_srvDescriptorUsage.fill(false);
}
void Resize(int width, int height) {
@@ -107,6 +112,18 @@ public:
return m_srvHeap;
}
ID3D12CommandQueue* GetCommandQueue() const {
return m_commandQueue;
}
UINT GetSrvDescriptorSize() const {
return m_srvDescriptorSize;
}
UINT GetSrvDescriptorCount() const {
return kSrvDescriptorCount;
}
private:
bool CreateDevice() {
HRESULT hr = D3D12CreateDevice(nullptr, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&m_device));
@@ -164,10 +181,12 @@ private:
D3D12_DESCRIPTOR_HEAP_DESC srvDesc = {};
srvDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV;
srvDesc.NumDescriptors = 1;
srvDesc.NumDescriptors = kSrvDescriptorCount;
srvDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE;
hr = m_device->CreateDescriptorHeap(&srvDesc, IID_PPV_ARGS(&m_srvHeap));
if (FAILED(hr)) return false;
m_srvDescriptorSize = m_device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV);
m_srvDescriptorUsage.fill(false);
return true;
}
@@ -210,7 +229,9 @@ private:
ID3D12Fence* m_fence = nullptr;
UINT64 m_fenceValue = 0;
UINT m_rtvDescriptorSize = 0;
UINT m_srvDescriptorSize = 0;
UINT m_frameIndex = 0;
std::array<bool, kSrvDescriptorCount> m_srvDescriptorUsage = {};
};
} // namespace Platform