From d9a7ca3e22d8bddd8c9ff18307b2195cd685318c Mon Sep 17 00:00:00 2001 From: Hyblocker Date: Sun, 6 Oct 2024 21:46:45 +0200 Subject: [PATCH] (chore): Remove redundant parameter for BeginFrame --- Backends/RmlUi_Backend_Win32_DX11.cpp | 2 +- Backends/RmlUi_Renderer_DX11.cpp | 5 +---- Backends/RmlUi_Renderer_DX11.h | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Backends/RmlUi_Backend_Win32_DX11.cpp b/Backends/RmlUi_Backend_Win32_DX11.cpp index f1f6a1703..a43f56c7e 100644 --- a/Backends/RmlUi_Backend_Win32_DX11.cpp +++ b/Backends/RmlUi_Backend_Win32_DX11.cpp @@ -293,7 +293,7 @@ void Backend::BeginFrame() CreateRenderTarget(); } - data->render_interface.BeginFrame(data->d3d_resources.pSwapChain, data->d3d_resources.pMainRenderTargetView); + data->render_interface.BeginFrame(data->d3d_resources.pMainRenderTargetView); } void Backend::PresentFrame() diff --git a/Backends/RmlUi_Renderer_DX11.cpp b/Backends/RmlUi_Renderer_DX11.cpp index ac1e26e3e..4d1c47a0c 100644 --- a/Backends/RmlUi_Renderer_DX11.cpp +++ b/Backends/RmlUi_Renderer_DX11.cpp @@ -1150,11 +1150,10 @@ void RenderInterface_DX11::Cleanup() DX_CLEANUP_RESOURCE_IF_CREATED(m_d3d_device); } -void RenderInterface_DX11::BeginFrame(IDXGISwapChain* p_swapchain, ID3D11RenderTargetView* p_render_target_view) +void RenderInterface_DX11::BeginFrame(ID3D11RenderTargetView* p_render_target_view) { RMLUI_ASSERT(m_viewport_width >= 1 && m_viewport_height >= 1); - RMLUI_ASSERTMSG(p_swapchain, "p_swapchain cannot be nullptr!"); RMLUI_ASSERTMSG(p_render_target_view, "p_render_target_view cannot be nullptr!"); RMLUI_ASSERTMSG(m_d3d_context, "d3d_context cannot be nullptr!"); RMLUI_ASSERTMSG(m_d3d_device, "d3d_device cannot be nullptr!"); @@ -1188,7 +1187,6 @@ void RenderInterface_DX11::BeginFrame(IDXGISwapChain* p_swapchain, ID3D11RenderT } m_bound_render_target = p_render_target_view; - m_bound_swapchain = p_swapchain; // Initialise DX11 state for RmlUi D3D11_VIEWPORT d3dviewport; @@ -1243,7 +1241,6 @@ void RenderInterface_DX11::EndFrame() m_render_layers.EndFrame(); // Reset internal state - m_bound_swapchain = nullptr; m_bound_render_target = nullptr; m_current_blend_state = nullptr; diff --git a/Backends/RmlUi_Renderer_DX11.h b/Backends/RmlUi_Renderer_DX11.h index f0fcdc8b2..fbce19b38 100644 --- a/Backends/RmlUi_Renderer_DX11.h +++ b/Backends/RmlUi_Renderer_DX11.h @@ -82,7 +82,7 @@ class RenderInterface_DX11 : public Rml::RenderInterface { void Cleanup (); // Sets up DirectX11 states for taking rendering commands from RmlUi. - void BeginFrame(IDXGISwapChain* p_swapchain, ID3D11RenderTargetView* p_render_target_view); + void BeginFrame(ID3D11RenderTargetView* p_render_target_view); void EndFrame(); void SetViewport(const int width, const int height); @@ -168,7 +168,6 @@ class RenderInterface_DX11 : public Rml::RenderInterface { ID3D11Device* m_d3d_device = nullptr; ID3D11Device1* m_d3d_device_1 = nullptr; ID3D11DeviceContext1* m_d3d_context = nullptr; - IDXGISwapChain* m_bound_swapchain = nullptr; ID3D11RenderTargetView* m_bound_render_target = nullptr; bool m_scissor_enabled = false; ID3D11RasterizerState* m_rasterizer_state_scissor_enabled = nullptr;