ogl_beamforming

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

Commit: f2b420f8ba454b8eaaa469ba2438ea1b2af86813
Parent: 84f4efe28dfdf8a68c988920499b44f32a9ee21b
Author: Randy Palamar
Date:   Fri, 27 Feb 2026 16:59:26 -0700

core: don't rearrange api provided output points

While we need all dimensions to be 1 or greater we can not shuffle
the points around as the passed in transform matrix expects the
layout to remain in a certain order.

Diffstat:
Mbeamformer_core.c | 14++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/beamformer_core.c b/beamformer_core.c @@ -207,10 +207,20 @@ beamformer_frame_compatible(BeamformerFrame *f, iv3 dim, GLenum gl_kind) return result; } +function iv3 +das_valid_points(iv3 points) +{ + iv3 result; + result.x = Max(points.x, 1); + result.y = Max(points.y, 1); + result.z = Max(points.z, 1); + return result; +} + function void alloc_beamform_frame(BeamformerFrame *out, iv3 out_dim, GLenum gl_kind, s8 name, Arena arena) { - out->dim = das_output_dimension(out_dim); + out->dim = das_valid_points(out_dim); /* NOTE: allocate storage for beamformed output data; * this is shared between compute and fragment shaders */ @@ -792,7 +802,7 @@ beamformer_commit_parameter_block(BeamformerCtx *ctx, BeamformerComputePlan *cp, case BeamformerParameterBlockRegion_ComputePipeline: case BeamformerParameterBlockRegion_Parameters: { - cp->output_points = das_output_dimension(pb->parameters.output_points.xyz); + cp->output_points = das_valid_points(pb->parameters.output_points.xyz); cp->average_frames = pb->parameters.output_points.E[3]; plan_compute_pipeline(cp, pb);