Merge branch 'remove-renderbuffers' into 'master'

Temporarily remove uses of RHI renderbuffers

Closes RingRacers#1

See merge request KartKrew/Kart!2323
This commit is contained in:
Eidolon 2024-05-01 14:38:27 +00:00
commit 8ab9f9c2cb
4 changed files with 1 additions and 21 deletions

View file

@ -40,11 +40,6 @@ void FramebufferManager::prepass(Rhi& rhi)
rhi.destroy_texture(main_color_); rhi.destroy_texture(main_color_);
main_color_ = kNullHandle; main_color_ = kNullHandle;
} }
if (main_depth_ != kNullHandle)
{
rhi.destroy_renderbuffer(main_depth_);
main_depth_ = kNullHandle;
}
if (post_colors_[0] != kNullHandle) if (post_colors_[0] != kNullHandle)
{ {
@ -81,10 +76,6 @@ void FramebufferManager::prepass(Rhi& rhi)
TextureWrapMode::kClamp TextureWrapMode::kClamp
}); });
} }
if (main_depth_ == kNullHandle)
{
main_depth_ = rhi.create_renderbuffer({current_width, current_height});
}
if (post_colors_[0] == kNullHandle) if (post_colors_[0] == kNullHandle)
{ {

View file

@ -24,7 +24,6 @@ namespace srb2::hwr2
class FramebufferManager final : public Pass class FramebufferManager final : public Pass
{ {
rhi::Handle<rhi::Texture> main_color_; rhi::Handle<rhi::Texture> main_color_;
rhi::Handle<rhi::Renderbuffer> main_depth_;
std::array<rhi::Handle<rhi::Texture>, 2> post_colors_; std::array<rhi::Handle<rhi::Texture>, 2> post_colors_;
rhi::Handle<rhi::Texture> wipe_start_color_; rhi::Handle<rhi::Texture> wipe_start_color_;
rhi::Handle<rhi::Texture> wipe_end_color_; rhi::Handle<rhi::Texture> wipe_end_color_;
@ -52,7 +51,6 @@ public:
void reset_post() noexcept { first_postprocess_ = true; } void reset_post() noexcept { first_postprocess_ = true; }
rhi::Handle<rhi::Texture> main_color() const noexcept { return main_color_; } rhi::Handle<rhi::Texture> main_color() const noexcept { return main_color_; }
rhi::Handle<rhi::Renderbuffer> main_depth() const noexcept { return main_depth_; }
rhi::Handle<rhi::Texture> current_post_color() const noexcept { return post_colors_[post_index_]; } rhi::Handle<rhi::Texture> current_post_color() const noexcept { return post_colors_[post_index_]; }

View file

@ -41,7 +41,7 @@ void UpscaleBackbuffer::begin_pass(Rhi& rhi, Handle<GraphicsContext> ctx)
auto new_renderpass = [&rhi = rhi](AttachmentLoadOp load_op, AttachmentStoreOp store_op) auto new_renderpass = [&rhi = rhi](AttachmentLoadOp load_op, AttachmentStoreOp store_op)
{ {
RenderPassDesc desc {}; RenderPassDesc desc {};
desc.use_depth_stencil = true; desc.use_depth_stencil = false;
desc.color_load_op = load_op; desc.color_load_op = load_op;
desc.color_store_op = store_op; desc.color_store_op = store_op;
desc.depth_load_op = load_op; desc.depth_load_op = load_op;
@ -58,11 +58,6 @@ void UpscaleBackbuffer::begin_pass(Rhi& rhi, Handle<GraphicsContext> ctx)
rhi.destroy_texture(color_); rhi.destroy_texture(color_);
color_ = kNullHandle; color_ = kNullHandle;
} }
if (depth_)
{
rhi.destroy_renderbuffer(depth_);
depth_ = kNullHandle;
}
TextureDesc color_tex {}; TextureDesc color_tex {};
color_tex.format = TextureFormat::kRGBA; color_tex.format = TextureFormat::kRGBA;
@ -76,8 +71,6 @@ void UpscaleBackbuffer::begin_pass(Rhi& rhi, Handle<GraphicsContext> ctx)
depth_tex.width = vid_width; depth_tex.width = vid_width;
depth_tex.height = vid_height; depth_tex.height = vid_height;
depth_ = rhi.create_renderbuffer(depth_tex);
if (!renderpass_clear_) if (!renderpass_clear_)
{ {
renderpass_clear_ = new_renderpass(AttachmentLoadOp::kClear, AttachmentStoreOp::kStore); renderpass_clear_ = new_renderpass(AttachmentLoadOp::kClear, AttachmentStoreOp::kStore);
@ -95,6 +88,5 @@ void UpscaleBackbuffer::begin_pass(Rhi& rhi, Handle<GraphicsContext> ctx)
begin_info.render_pass = remake ? renderpass_clear_ : renderpass_; begin_info.render_pass = remake ? renderpass_clear_ : renderpass_;
begin_info.clear_color = {0, 0, 0, 1}; begin_info.clear_color = {0, 0, 0, 1};
begin_info.color_attachment = color_; begin_info.color_attachment = color_;
begin_info.depth_stencil_attachment = depth_;
rhi.begin_render_pass(ctx, begin_info); rhi.begin_render_pass(ctx, begin_info);
} }

View file

@ -19,7 +19,6 @@ namespace srb2::hwr2
class UpscaleBackbuffer class UpscaleBackbuffer
{ {
rhi::Handle<rhi::Texture> color_; rhi::Handle<rhi::Texture> color_;
rhi::Handle<rhi::Renderbuffer> depth_;
rhi::Handle<rhi::RenderPass> renderpass_; rhi::Handle<rhi::RenderPass> renderpass_;
rhi::Handle<rhi::RenderPass> renderpass_clear_; rhi::Handle<rhi::RenderPass> renderpass_clear_;