mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-03-09 20:56:43 +00:00
Fixes wipes potentially reading invalid data from the framebuffer if the texture was recreated but not yet rendered to.
40 lines
1.2 KiB
C++
40 lines
1.2 KiB
C++
// SONIC ROBO BLAST 2
|
|
//-----------------------------------------------------------------------------
|
|
// Copyright (C) 2023 by Ronald "Eidolon" Kinard
|
|
//
|
|
// This program is free software distributed under the
|
|
// terms of the GNU General Public License, version 2.
|
|
// See the 'LICENSE' file for more details.
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#ifndef __SRB2_HWR2_UPSCALE_BACKBUFFER_HPP__
|
|
#define __SRB2_HWR2_UPSCALE_BACKBUFFER_HPP__
|
|
|
|
#include "../rhi/rhi.hpp"
|
|
|
|
namespace srb2::hwr2
|
|
{
|
|
|
|
class UpscaleBackbuffer
|
|
{
|
|
rhi::Handle<rhi::Texture> color_;
|
|
rhi::Handle<rhi::Renderbuffer> depth_;
|
|
rhi::Handle<rhi::RenderPass> renderpass_;
|
|
rhi::Handle<rhi::RenderPass> renderpass_clear_;
|
|
|
|
public:
|
|
UpscaleBackbuffer();
|
|
UpscaleBackbuffer(const UpscaleBackbuffer&) = delete;
|
|
UpscaleBackbuffer(UpscaleBackbuffer&&);
|
|
~UpscaleBackbuffer();
|
|
|
|
UpscaleBackbuffer& operator=(const UpscaleBackbuffer&) = delete;
|
|
UpscaleBackbuffer& operator=(UpscaleBackbuffer&&);
|
|
|
|
void begin_pass(rhi::Rhi& rhi, rhi::Handle<rhi::GraphicsContext> ctx);
|
|
rhi::Handle<rhi::Texture> color() const noexcept { return color_; }
|
|
};
|
|
|
|
} // namespace srb2::hwr2
|
|
|
|
#endif // __SRB2_HWR2_UPSCALE_BACKBUFFER_HPP__
|