ogl_beamforming

Ultrasound Beamforming Implemented with OpenGL
git clone anongit@rnpnr.xyz:ogl_beamforming.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

Commit: 5db505adf3ecf2b8c0d760fe18b86a1ce6433925
Parent: 2e593e5f54f802dbd3d93eeb509e7ee33acca826
Author: Randy Palamar
Date:   Wed, 14 Jan 2026 12:57:21 -0700

core: das_shader_id -> acquisition_kind

I don't know why this was still named incorrectly in the structs.
If the beamformer has a different system for assigning IDs to the
DAS shader its the beamformer's responsibility to remap from the
acquisition kind. The acquisition kind is the actually relavent
info.

Diffstat:
Mbeamformer.meta | 2+-
Mbeamformer_core.c | 8++++----
Mgenerated/beamformer.meta.c | 6+++---
Mlib/ogl_beamformer_lib.c | 5++++-
Mtests/throughput.c | 6+++---
5 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/beamformer.meta b/beamformer.meta @@ -96,7 +96,7 @@ [sample_count U32] [channel_count U32] [acquisition_count U32] - [das_shader_id U32] + [acquisition_kind U32] [time_offset F32] [single_focus U8] [single_orientation U8] diff --git a/beamformer_core.c b/beamformer_core.c @@ -418,7 +418,7 @@ das_voxel_transform_matrix(BeamformerParameters *bp) m4 S = m4_scale(v3_div(extent, points)); m4 R; - switch (bp->das_shader_id) { + switch (bp->acquisition_kind) { case BeamformerAcquisitionKind_FORCES: case BeamformerAcquisitionKind_UFORCES: case BeamformerAcquisitionKind_Flash: @@ -659,7 +659,7 @@ plan_compute_pipeline(BeamformerComputePlan *cp, BeamformerParameterBlock *pb) db->speed_of_sound = pb->parameters.speed_of_sound; db->time_offset = time_offset; db->f_number = pb->parameters.f_number; - db->acquisition_kind = pb->parameters.das_shader_id; + db->acquisition_kind = pb->parameters.acquisition_kind; db->sample_count = sample_count; db->channel_count = pb->parameters.channel_count; db->acquisition_count = pb->parameters.acquisition_count; @@ -673,7 +673,7 @@ plan_compute_pipeline(BeamformerComputePlan *cp, BeamformerParameterBlock *pb) if (pb->parameters.coherency_weighting) sd->bake.flags |= BeamformerShaderDASFlags_CoherencyWeighting; else sd->bake.flags |= BeamformerShaderDASFlags_Fast; - u32 id = pb->parameters.das_shader_id; + u32 id = pb->parameters.acquisition_kind; if (id == BeamformerAcquisitionKind_UFORCES || id == BeamformerAcquisitionKind_UHERCULES) sd->bake.flags |= BeamformerShaderDASFlags_Sparse; @@ -844,7 +844,7 @@ beamformer_commit_parameter_block(BeamformerCtx *ctx, BeamformerComputePlan *cp, #undef X cp->acquisition_count = pb->parameters.acquisition_count; - cp->acquisition_kind = pb->parameters.das_shader_id; + cp->acquisition_kind = pb->parameters.acquisition_kind; u32 decoded_data_size = cp->rf_size; if (ctx->compute_context.ping_pong_ssbo_size < decoded_data_size) diff --git a/generated/beamformer.meta.c b/generated/beamformer.meta.c @@ -182,7 +182,7 @@ typedef struct { u32 sample_count; u32 channel_count; u32 acquisition_count; - u32 das_shader_id; + u32 acquisition_kind; f32 time_offset; u8 single_focus; u8 single_orientation; @@ -213,7 +213,7 @@ typedef struct { u32 sample_count; u32 channel_count; u32 acquisition_count; - u32 das_shader_id; + u32 acquisition_kind; f32 time_offset; u8 single_focus; u8 single_orientation; @@ -245,7 +245,7 @@ typedef struct { u32 sample_count; u32 channel_count; u32 acquisition_count; - u32 das_shader_id; + u32 acquisition_kind; f32 time_offset; u8 single_focus; u8 single_orientation; diff --git a/lib/ogl_beamformer_lib.c b/lib/ogl_beamformer_lib.c @@ -481,8 +481,11 @@ beamformer_push_simple_parameters_at(BeamformerSimpleParameters *bp, u32 block) result &= beamformer_push_transmit_receive_orientations_at(bp->transmit_receive_orientations, bp->acquisition_count, block); - if (bp->das_shader_id == BeamformerAcquisitionKind_UFORCES || bp->das_shader_id == BeamformerAcquisitionKind_UHERCULES) + if (bp->acquisition_kind == BeamformerAcquisitionKind_UFORCES || + bp->acquisition_kind == BeamformerAcquisitionKind_UHERCULES) + { result &= beamformer_push_sparse_elements_at(bp->sparse_elements, bp->acquisition_count, block); + } for (u32 stage = 0; stage < bp->compute_stages_count; stage++) result &= beamformer_set_pipeline_stage_parameters_at(stage, bp->compute_stage_parameters[stage], block); diff --git a/tests/throughput.c b/tests/throughput.c @@ -182,7 +182,7 @@ beamformer_parameters_from_zemp_bp_v1(zemp_bp_v1 *zbp, BeamformerParameters *out out->channel_count = zbp->decoded_data_dim[1]; out->acquisition_count = zbp->decoded_data_dim[2]; out->decode_mode = (u8)zbp->decode_mode; - out->das_shader_id = zbp->beamform_mode; + out->acquisition_kind = zbp->beamform_mode; out->time_offset = zbp->time_offset; out->sampling_frequency = zbp->sampling_frequency; out->demodulation_frequency = zbp->center_frequency; @@ -352,8 +352,8 @@ execute_study(s8 study, Arena arena, Stream path, Options *options) if (rx_rows) packed_tx_rx |= BeamformerRCAOrientation_Rows << 0; else packed_tx_rx |= BeamformerRCAOrientation_Columns << 0; - if (bp.das_shader_id == BeamformerAcquisitionKind_HERCULES || - bp.das_shader_id == BeamformerAcquisitionKind_UHERCULES) + if (bp.acquisition_kind == BeamformerAcquisitionKind_HERCULES || + bp.acquisition_kind == BeamformerAcquisitionKind_UHERCULES) { bp.single_focus = 1; bp.single_orientation = 1;