use r16g16b16a16_float for ui & backbuffer formats
This commit is contained in:
parent
52128ff772
commit
9b97a7c3b0
15
src/pp/pp.c
15
src/pp/pp.c
@ -1986,14 +1986,7 @@ void PP_UpdateUser(void)
|
||||
g->lister_pos = SubVec2(g->ui_cursor, rep.last_m1_offset);
|
||||
}
|
||||
{
|
||||
// titlebar_color = LerpSrgbU32(window_background_color, Color_White, 0.1);
|
||||
// titlebar_border_color = LerpSrgbU32(window_background_color, Color_White, 0.1);
|
||||
// titlebar_border_color = Color_White;
|
||||
// window_border_color = Color_White;
|
||||
// window_border_color = LerpSrgbU32(base_border_color, Color_White, 0.25);
|
||||
|
||||
// u32 highlight = LerpSrgbU32(base_border_color, Rgb32F(0.25, 0.25, 0.25), rep.hot);
|
||||
window_border_color = LerpSrgbU32(window_border_color, Rgb32F(0.5, 0.5, 0.5), rep.hot);
|
||||
window_border_color = BlendSrgbU32(window_border_color, Rgb32F(0.5, 0.5, 0.5), rep.hot);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2071,9 +2064,9 @@ void PP_UpdateUser(void)
|
||||
|
||||
u32 color = 0;
|
||||
u32 border_color = 0;
|
||||
color = LerpSrgbU32(color, hovered_color, hot);
|
||||
color = LerpSrgbU32(color, pressed_color, active * hovered);
|
||||
border_color = LerpSrgbU32(border_color, Rgb32(0x00, 0x79, 0xa6), hot);
|
||||
color = BlendSrgbU32(color, hovered_color, hot);
|
||||
color = BlendSrgbU32(color, pressed_color, active * hovered);
|
||||
border_color = BlendSrgbU32(border_color, Rgb32(0x00, 0x79, 0xa6), hot);
|
||||
|
||||
String button_text = UI_StringF("Button %F", FmtSint(i));
|
||||
|
||||
|
||||
@ -197,6 +197,10 @@ JobDef(PP_VisWorker, sig, job_id)
|
||||
WND_PushCmd(window_frame, .kind = WND_CmdKind_SetForcedTop, .v = new);
|
||||
LogInfoF("Toggled topmost: %F", FmtSint(new));
|
||||
}
|
||||
if (PP_BuildListerButton(&persist.lister, Lit("Spawn")).m1_presses > 0)
|
||||
{
|
||||
LogErrorF("RAAAAH");
|
||||
}
|
||||
}
|
||||
PP_EndListerWidget(&persist.lister);
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@ UI_Report PP_BuildListerButton(PP_ListerWidget *lister, String text)
|
||||
UI_Report rep = UI_ReportFromKey(btn_key);
|
||||
|
||||
u32 hovered_color = Rgb32(0x10, 0x3c, 0x4c);
|
||||
u32 pressed_color = Alpha32F(hovered_color, 0.25);
|
||||
u32 pressed_color = Alpha32F(hovered_color, 0.2);
|
||||
|
||||
f32 hot = rep.hot;
|
||||
f32 active = rep.active;
|
||||
|
||||
@ -646,9 +646,9 @@ UI_Frame UI_BeginFrame(UI_FrameFlag frame_flags)
|
||||
f32 target_hot = box == active_box || (box == hovered_box && (box == active_box || active_box == 0));
|
||||
f32 target_active = box == active_box;
|
||||
f32 target_hovered = box == hovered_box;
|
||||
f32 hot_blend_rate = target_hot == 1 ? 1 : (15 * dt);
|
||||
f32 active_blend_rate = target_active == 1 ? 1 : (15 * dt);
|
||||
f32 hovered_blend_rate = target_hovered == 1 ? 1 : (15 * dt);
|
||||
f32 hot_blend_rate = target_hot == 1 ? 1 : (5 * dt);
|
||||
f32 active_blend_rate = target_active == 1 ? 1 : (5 * dt);
|
||||
f32 hovered_blend_rate = target_hovered == 1 ? 1 : (5 * dt);
|
||||
report->hot = LerpF32(report->hot, target_hot, hot_blend_rate);
|
||||
report->active = LerpF32(report->active, target_active, active_blend_rate);
|
||||
report->hovered = LerpF32(report->hovered, target_hovered, hovered_blend_rate);
|
||||
@ -753,7 +753,8 @@ i64 UI_EndFrame(UI_Frame frame)
|
||||
GPU_ResourceDesc desc = ZI;
|
||||
desc.kind = GPU_ResourceKind_Texture2D;
|
||||
desc.flags = GPU_ResourceFlag_Renderable | GPU_ResourceFlag_Writable;
|
||||
desc.texture.format = GPU_Format_R8G8B8A8_Unorm;
|
||||
// desc.texture.format = GPU_Format_R8G8B8A8_Unorm;
|
||||
desc.texture.format = GPU_Format_R16G16B16A16_Float;
|
||||
desc.texture.size = VEC3I32(monitor_size.x, monitor_size.y, 1);
|
||||
g->render_target = GPU_AcquireResource(desc);
|
||||
}
|
||||
@ -1396,6 +1397,7 @@ i64 UI_EndFrame(UI_Frame frame)
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
//- Prep post pass
|
||||
{
|
||||
GPU_TransitionToWritable(cl, g->render_target);
|
||||
@ -1412,6 +1414,7 @@ i64 UI_EndFrame(UI_Frame frame)
|
||||
sig.gamma = 2.2f;
|
||||
GPU_Compute(cl, &sig, UI_PostCS, (viewport_size.x + 7) / 8, (viewport_size.y + 7) / 8, 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
g->gpu_submit_fence_target = GPU_EndCommandList(cl);
|
||||
|
||||
@ -1426,7 +1429,7 @@ i64 UI_EndFrame(UI_Frame frame)
|
||||
Vec2I32 backbuffer_size = monitor_size;
|
||||
if (!g->swapchain)
|
||||
{
|
||||
g->swapchain = GPU_AcquireSwapchain(frame.window_frame.window_handle, GPU_Format_R8G8B8A8_Unorm, backbuffer_size);
|
||||
g->swapchain = GPU_AcquireSwapchain(frame.window_frame.window_handle, GPU_Format_R16G16B16A16_Float, backbuffer_size);
|
||||
}
|
||||
Vec2I32 dst_p0 = VEC2I32(0, 0);
|
||||
Vec2I32 dst_p1 = VEC2I32(0, 0);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user