Migrate ProjectManager to dependency injection
- Created IProjectManager interface - ProjectManager now implements IProjectManager - Removed ProjectManager::Get() singleton - Added IEditorContext::GetProjectManager() - ProjectPanel now uses m_context->GetProjectManager() instead of singleton - EditorContext owns ProjectManager instance
This commit is contained in:
@@ -492,6 +492,11 @@ RHIResourceView* D3D12Device::CreateRenderTargetView(RHITexture* texture, const
|
||||
rtvDesc.Format = static_cast<DXGI_FORMAT>(desc.format);
|
||||
rtvDesc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D;
|
||||
|
||||
{
|
||||
FILE* f2 = fopen("D:\\Xuanchi\\Main\\XCEngine\\debug_rhi.log", "a");
|
||||
if (f2) { fprintf(f2, "[CreateRenderTargetView] Creating RTV heap...\n"); fclose(f2); }
|
||||
}
|
||||
|
||||
auto heap = std::make_unique<D3D12DescriptorHeap>();
|
||||
if (!heap->Initialize(m_device.Get(), DescriptorHeapType::RTV, 1, false)) {
|
||||
FILE* f2 = fopen("D:\\Xuanchi\\Main\\XCEngine\\debug_rhi.log", "a");
|
||||
@@ -500,10 +505,18 @@ RHIResourceView* D3D12Device::CreateRenderTargetView(RHITexture* texture, const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
{
|
||||
FILE* f2 = fopen("D:\\Xuanchi\\Main\\XCEngine\\debug_rhi.log", "a");
|
||||
if (f2) { fprintf(f2, "[CreateRenderTargetView] RTV heap created, calling CreateRenderTargetView...\n"); fclose(f2); }
|
||||
}
|
||||
|
||||
view->InitializeAsRenderTarget(m_device.Get(), resource, &rtvDesc, heap.get(), 0);
|
||||
view->SetOwnedHeap(std::move(heap));
|
||||
FILE* f3 = fopen("D:\\Xuanchi\\Main\\XCEngine\\debug_rhi.log", "a");
|
||||
if (f3) { fprintf(f3, "[CreateRenderTargetView] Success\n"); fclose(f3); }
|
||||
|
||||
{
|
||||
FILE* f2 = fopen("D:\\Xuanchi\\Main\\XCEngine\\debug_rhi.log", "a");
|
||||
if (f2) { fprintf(f2, "[CreateRenderTargetView] Success\n"); fclose(f2); }
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -528,6 +541,9 @@ RHIResourceView* D3D12Device::CreateDepthStencilView(RHITexture* texture, const
|
||||
}
|
||||
|
||||
RHIResourceView* D3D12Device::CreateShaderResourceView(RHITexture* texture, const ResourceViewDesc& desc) {
|
||||
FILE* f = fopen("D:\\Xuanchi\\Main\\XCEngine\\debug_rhi.log", "a");
|
||||
if (f) { fprintf(f, "[CreateShaderResourceView] Start\n"); fclose(f); }
|
||||
|
||||
auto* view = new D3D12ResourceView();
|
||||
auto* d3d12Texture = static_cast<D3D12Texture*>(texture);
|
||||
ID3D12Resource* resource = d3d12Texture->GetResource();
|
||||
@@ -541,12 +557,17 @@ RHIResourceView* D3D12Device::CreateShaderResourceView(RHITexture* texture, cons
|
||||
|
||||
auto heap = std::make_unique<D3D12DescriptorHeap>();
|
||||
if (!heap->Initialize(m_device.Get(), DescriptorHeapType::CBV_SRV_UAV, 1, true)) {
|
||||
FILE* f2 = fopen("D:\\Xuanchi\\Main\\XCEngine\\debug_rhi.log", "a");
|
||||
if (f2) { fprintf(f2, "[CreateShaderResourceView] heap Initialize failed\n"); fclose(f2); }
|
||||
delete view;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
view->InitializeAsShaderResource(m_device.Get(), resource, &srvDesc, heap.get(), 0);
|
||||
view->SetOwnedHeap(std::move(heap));
|
||||
|
||||
FILE* f3 = fopen("D:\\Xuanchi\\Main\\XCEngine\\debug_rhi.log", "a");
|
||||
if (f3) { fprintf(f3, "[CreateShaderResourceView] Success\n"); fclose(f3); }
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user