Commit: eaecccedbced8b589438a6ab16b4f70065c28ddb
Parent: 35595c17b35aa38564f8f47a963749beffc4f463
Author: Randy Palamar
Date: Tue, 11 Mar 2025 08:34:31 -0600
ui: append uforces transmit count to label
I meant to do this originally but got distracted.
Diffstat:
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/beamformer.c b/beamformer.c
@@ -668,6 +668,7 @@ DEBUG_EXPORT BEAMFORMER_COMPLETE_COMPUTE_FN(beamformer_complete_compute)
frame->min_coordinate = ctx->params->raw.output_min_coordinate;
frame->max_coordinate = ctx->params->raw.output_max_coordinate;
frame->das_shader_id = ctx->params->raw.das_shader_id;
+ frame->compound_count = ctx->params->raw.dec_data_dim.z;
u32 stage_count = ctx->params->compute_stages_count;
ComputeShaderID *stages = ctx->params->compute_stages;
diff --git a/beamformer.h b/beamformer.h
@@ -243,7 +243,9 @@ typedef struct {
b32 in_flight;
b32 ready_to_present;
DASShaderID das_shader_id;
+ u32 compound_count;
+ /* TODO(rnp): move this out so that saved frame copies can save some space */
u32 timer_ids[CS_LAST];
f32 compute_times[CS_LAST];
b32 timer_active[CS_LAST];
diff --git a/ui.c b/ui.c
@@ -31,16 +31,21 @@ lerp_v4(v4 a, v4 b, f32 t)
}
static s8
-das_shader_id_to_s8(DASShaderID shader)
+push_das_shader_id(Stream *s, DASShaderID shader, u32 transmit_count)
{
- s8 result = {0};
switch (shader) {
- #define X(type, id, pretty) case id: result = s8(pretty); break;
+ #define X(type, id, pretty) case id: stream_append_s8(s, s8(pretty)); break;
DAS_TYPES
#undef X
default: break;
}
- return result;
+
+ if (shader == DAS_UFORCES) {
+ stream_append_byte(s, '-');
+ stream_append_u64(s, transmit_count);
+ }
+
+ return stream_to_s8(s);
}
static v2
@@ -331,7 +336,8 @@ draw_display_overlay(BeamformerCtx *ctx, Arena a, v2 mouse, Rect display_rect, B
}
{
- s8 shader = das_shader_id_to_s8(frame->das_shader_id);
+ buf.widx = 0;
+ s8 shader = push_das_shader_id(&buf, frame->das_shader_id, frame->compound_count);
v2 txt_s = measure_text(ui->font, shader);
v2 txt_p = {
.x = vr.pos.x + vr.size.w - txt_s.w - 16,