further block non-visible ui boxes from reaching gpu
This commit is contained in:
parent
f52d07d3bc
commit
2308263256
@ -2947,6 +2947,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
||||
|
||||
// emitter.count = CeilF32(Kibi(64) * frame->dt);
|
||||
// emitter.count = CeilF32(Mebi(32) * frame->dt);
|
||||
// emitter.count = CeilF32(Mebi(8) * frame->dt);
|
||||
// emitter.count = Mebi(16);
|
||||
// emitter.count = Mebi(2);
|
||||
// emitter.count = Kibi(32);
|
||||
|
||||
@ -1533,11 +1533,20 @@ void UI_EndFrame(UI_Frame *frame, i32 vsync)
|
||||
for (u64 pre_index = 0; pre_index < boxes_count; ++pre_index)
|
||||
{
|
||||
UI_Box *box = boxes_pre[pre_index];
|
||||
GC_Run raw_run_unscaled = box->glyph_run;
|
||||
GC_Run raw_run = UI_ScaleRun(frame->arena, raw_run_unscaled, box->solved_scale);
|
||||
|
||||
b32 is_visible = 1;
|
||||
is_visible = is_visible && (box->desc.tint.w >= 0.0025);
|
||||
is_visible = is_visible && (box->screen_rect.p1.x - box->screen_rect.p0.x > 0.0025);
|
||||
is_visible = is_visible && (box->screen_rect.p1.y - box->screen_rect.p0.y > 0.0025);
|
||||
is_visible = is_visible && (
|
||||
!G_IsRefNil(box->raw_texture) ||
|
||||
!SPR_IsSheetKeyNil(box->desc.sprite_sheet) ||
|
||||
(AnyBit(box->desc.flags, UI_BoxFlag_DrawText) && raw_run.ready) ||
|
||||
box->desc.tint.a * box->desc.background_color.a >= 0.0025
|
||||
);
|
||||
|
||||
if (is_visible || AnyBit(frame->frame_flags, UI_FrameFlag_Debug))
|
||||
{
|
||||
Vec4 debug_lin = is_visible ? LinearFromSrgb(box->desc.debug_color) : LinearFromSrgb(box->desc.invisible_debug_color);
|
||||
@ -1572,9 +1581,6 @@ void UI_EndFrame(UI_Frame *frame, i32 vsync)
|
||||
}
|
||||
}
|
||||
|
||||
// Text rects
|
||||
GC_Run raw_run_unscaled = box->glyph_run;
|
||||
GC_Run raw_run = UI_ScaleRun(frame->arena, raw_run_unscaled, box->solved_scale);
|
||||
if (AnyBit(box->desc.flags, UI_BoxFlag_DrawText) && raw_run.ready)
|
||||
{
|
||||
f32 max_baseline_length = CeilF32(DimsFromRng2(box->screen_rect).x);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user