mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-15 01:56:51 +00:00
srb2::hwr2::BlitRectPass::set_output: set x/y as well
This commit is contained in:
parent
2d9d06e267
commit
37dc1189bb
4 changed files with 8 additions and 8 deletions
|
|
@ -432,7 +432,7 @@ void F_WipeEndScreen(void)
|
|||
dst_region.h = std::min(dst_region.h, backbuf_deets.height);
|
||||
rhi->copy_framebuffer_to_texture(ctx, hw_state->wipe_frames.end, dst_region, dst_region);
|
||||
|
||||
hw_state->blit_rect->set_output(dst_region.w, dst_region.h, false, true);
|
||||
hw_state->blit_rect->set_output(0, 0, dst_region.w, dst_region.h, false, true);
|
||||
rhi::TextureDetails start_deets = rhi->get_texture_details(hw_state->wipe_frames.start);
|
||||
hw_state->blit_rect->set_texture(hw_state->wipe_frames.start, start_deets.width, start_deets.height);
|
||||
hw_state->blit_rect->draw(*rhi, ctx);
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ void BlitRectPass::transfer(Rhi& rhi, Handle<GraphicsContext> ctx)
|
|||
if (output_correct_aspect_)
|
||||
{
|
||||
aspect = static_cast<float>(texture_width_) / static_cast<float>(texture_height_);
|
||||
output_aspect = static_cast<float>(output_width_) / static_cast<float>(output_height_);
|
||||
output_aspect = static_cast<float>(output_position_.w) / static_cast<float>(output_position_.h);
|
||||
}
|
||||
bool taller = aspect > output_aspect;
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ void BlitRectPass::transfer(Rhi& rhi, Handle<GraphicsContext> ctx)
|
|||
void BlitRectPass::graphics(Rhi& rhi, Handle<GraphicsContext> ctx)
|
||||
{
|
||||
rhi.bind_pipeline(ctx, pipeline_);
|
||||
rhi.set_viewport(ctx, {0, 0, output_width_, output_height_});
|
||||
rhi.set_viewport(ctx, output_position_);
|
||||
rhi.bind_uniform_set(ctx, 0, uniform_sets_[0]);
|
||||
rhi.bind_uniform_set(ctx, 1, uniform_sets_[1]);
|
||||
rhi.bind_binding_set(ctx, binding_set_);
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ class BlitRectPass
|
|||
uint32_t texture_width_ = 0;
|
||||
uint32_t texture_height_ = 0;
|
||||
rhi::Handle<rhi::Texture> output_;
|
||||
uint32_t output_width_ = 0;
|
||||
uint32_t output_height_ = 0;
|
||||
rhi::Rect output_position_;
|
||||
bool output_correct_aspect_ = false;
|
||||
bool output_flip_ = false;
|
||||
rhi::Handle<rhi::Buffer> quad_vbo_;
|
||||
|
|
@ -63,14 +62,15 @@ public:
|
|||
/// @param width texture width
|
||||
/// @param height texture height
|
||||
void set_output(
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
bool correct_aspect,
|
||||
bool flip
|
||||
) noexcept
|
||||
{
|
||||
output_width_ = width;
|
||||
output_height_ = height;
|
||||
output_position_ = {x, y, width, height};
|
||||
output_correct_aspect_ = correct_aspect;
|
||||
output_flip_ = flip;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ void I_FinishUpdate(void)
|
|||
rhi->begin_default_render_pass(ctx, true);
|
||||
|
||||
// Upscale draw the backbuffer (with postprocessing maybe?)
|
||||
g_hw_state.blit_rect->set_output(vid.realwidth, vid.realheight, true, true);
|
||||
g_hw_state.blit_rect->set_output(0, 0, vid.realwidth, vid.realheight, true, true);
|
||||
g_hw_state.blit_rect->set_texture(g_hw_state.backbuffer->color(), static_cast<uint32_t>(vid.width), static_cast<uint32_t>(vid.height));
|
||||
g_hw_state.blit_rect->draw(*rhi, ctx);
|
||||
rhi->end_render_pass(ctx);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue