From c218d6dc10231fc25636b16e3e7659bac55365da Mon Sep 17 00:00:00 2001 From: Triang3l Date: Mon, 21 Sep 2020 23:15:51 +0300 Subject: [PATCH] [D3D12] Move D3D12ImmediateTexture to D3D12ImmediateDrawer --- src/xenia/ui/d3d12/d3d12_immediate_drawer.cc | 26 +++----------------- src/xenia/ui/d3d12/d3d12_immediate_drawer.h | 17 +++++++++++++ 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/src/xenia/ui/d3d12/d3d12_immediate_drawer.cc b/src/xenia/ui/d3d12/d3d12_immediate_drawer.cc index f5cd384ed..d4f0f17ec 100644 --- a/src/xenia/ui/d3d12/d3d12_immediate_drawer.cc +++ b/src/xenia/ui/d3d12/d3d12_immediate_drawer.cc @@ -28,27 +28,9 @@ namespace d3d12 { #include "xenia/ui/d3d12/shaders/dxbc/immediate_ps.h" #include "xenia/ui/d3d12/shaders/dxbc/immediate_vs.h" -class D3D12ImmediateTexture : public ImmediateTexture { - public: - static constexpr DXGI_FORMAT kFormat = DXGI_FORMAT_R8G8B8A8_UNORM; - D3D12ImmediateTexture(uint32_t width, uint32_t height, - ID3D12Resource* resource_if_exists, - ImmediateTextureFilter filter, bool is_repeated); - ~D3D12ImmediateTexture() override; - ID3D12Resource* resource() const { return resource_; } - ImmediateTextureFilter filter() const { return filter_; } - bool is_repeated() const { return is_repeated_; } - - private: - ID3D12Resource* resource_; - ImmediateTextureFilter filter_; - bool is_repeated_; -}; - -D3D12ImmediateTexture::D3D12ImmediateTexture(uint32_t width, uint32_t height, - ID3D12Resource* resource_if_exists, - ImmediateTextureFilter filter, - bool is_repeated) +D3D12ImmediateDrawer::D3D12ImmediateTexture::D3D12ImmediateTexture( + uint32_t width, uint32_t height, ID3D12Resource* resource_if_exists, + ImmediateTextureFilter filter, bool is_repeated) : ImmediateTexture(width, height), resource_(resource_if_exists), filter_(filter), @@ -59,7 +41,7 @@ D3D12ImmediateTexture::D3D12ImmediateTexture(uint32_t width, uint32_t height, handle = reinterpret_cast(this); } -D3D12ImmediateTexture::~D3D12ImmediateTexture() { +D3D12ImmediateDrawer::D3D12ImmediateTexture::~D3D12ImmediateTexture() { if (resource_) { resource_->Release(); } diff --git a/src/xenia/ui/d3d12/d3d12_immediate_drawer.h b/src/xenia/ui/d3d12/d3d12_immediate_drawer.h index bf11f0cff..076a4f43c 100644 --- a/src/xenia/ui/d3d12/d3d12_immediate_drawer.h +++ b/src/xenia/ui/d3d12/d3d12_immediate_drawer.h @@ -46,6 +46,23 @@ class D3D12ImmediateDrawer : public ImmediateDrawer { void End() override; private: + class D3D12ImmediateTexture : public ImmediateTexture { + public: + static constexpr DXGI_FORMAT kFormat = DXGI_FORMAT_R8G8B8A8_UNORM; + D3D12ImmediateTexture(uint32_t width, uint32_t height, + ID3D12Resource* resource_if_exists, + ImmediateTextureFilter filter, bool is_repeated); + ~D3D12ImmediateTexture() override; + ID3D12Resource* resource() const { return resource_; } + ImmediateTextureFilter filter() const { return filter_; } + bool is_repeated() const { return is_repeated_; } + + private: + ID3D12Resource* resource_; + ImmediateTextureFilter filter_; + bool is_repeated_; + }; + void UploadTextures(); D3D12Context& context_;