ogl_beamforming

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

Commit: b6a8bb5e69ce934b58760a68ba3d8704af79f397
Parent: e0401f63b26d25721c16ce9e260214a1f4444798
Author: Randy Palamar
Date:   Wed, 16 Apr 2025 10:54:07 -0600

lib: account for data elements in push api

The intention with push_focal_vectors was that vectors were
2-component and that the count was number of two component
elements (usually N for N transmits).

Diffstat:
Mhelpers/ogl_beamformer_lib.c | 24++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/helpers/ogl_beamformer_lib.c b/helpers/ogl_beamformer_lib.c @@ -283,20 +283,20 @@ beamformer_upload_buffer(char *shm_name, void *data, u32 size, i32 store_offset, } #define BEAMFORMER_UPLOAD_FNS \ - X(channel_mapping, i16, CHANNEL_MAPPING) \ - X(sparse_elements, i16, SPARSE_ELEMENTS) \ - X(focal_vectors, f32, FOCAL_VECTORS) + X(channel_mapping, i16, 1, CHANNEL_MAPPING) \ + X(sparse_elements, i16, 1, SPARSE_ELEMENTS) \ + X(focal_vectors, f32, 2, FOCAL_VECTORS) -#define X(name, dtype, command) \ +#define X(name, dtype, elements, command) \ b32 beamformer_push_##name (char *shm_id, dtype *data, u32 count, i32 timeout_ms) { \ - b32 result = count <= ARRAY_COUNT(g_bp->name); \ - if (result) { \ - result = beamformer_upload_buffer(shm_id, data, count * sizeof(dtype), \ - offsetof(BeamformerSharedMemory, name), \ - offsetof(BeamformerSharedMemory, name##_sync), \ - BU_KIND_##command, timeout_ms); \ - } \ - return result; \ + b32 result = count <= ARRAY_COUNT(g_bp->name); \ + if (result) { \ + result = beamformer_upload_buffer(shm_id, data, count * elements * sizeof(dtype), \ + offsetof(BeamformerSharedMemory, name), \ + offsetof(BeamformerSharedMemory, name##_sync), \ + BU_KIND_##command, timeout_ms); \ + } \ + return result; \ } BEAMFORMER_UPLOAD_FNS #undef X