ogl_beamforming

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

Commit: 9286c1b99ad08d36463fac13ec6eecf88008d25b
Parent: a5400b32e0c4ebfbd85139f5b93f7bb1f76f49e8
Author: Randy Palamar
Date:   Tue, 10 Dec 2024 11:05:35 -0700

add cycle_t to das shader for help with debugging

Diffstat:
Mbeamformer.c | 5+++++
Mbeamformer.h | 1+
Mshaders/das.glsl | 1+
3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/beamformer.c b/beamformer.c @@ -2,6 +2,7 @@ #include "beamformer.h" static f32 dt_for_frame; +static f32 cycle_t; static size decoded_data_size(ComputeShaderCtx *cs) @@ -641,6 +642,10 @@ DEBUG_EXPORT BEAMFORMER_FRAME_STEP_FN(beamformer_frame_step) { dt_for_frame = GetFrameTime(); + cycle_t += dt_for_frame; + if (cycle_t > 1) cycle_t -= 1; + glProgramUniform1f(ctx->csctx.programs[CS_DAS], ctx->csctx.cycle_t_id, cycle_t); + if (IsWindowResized()) { ctx->window_size.h = GetScreenHeight(); ctx->window_size.w = GetScreenWidth(); diff --git a/beamformer.h b/beamformer.h @@ -131,6 +131,7 @@ typedef struct { X(CS_DAS, volume_export_pass) \ X(CS_DAS, xdc_index) \ X(CS_DAS, xdc_transform) \ + X(CS_DAS, cycle_t) \ X(CS_MIN_MAX, mips_level) \ X(CS_SUM, sum_prescale) diff --git a/shaders/das.glsl b/shaders/das.glsl @@ -11,6 +11,7 @@ layout(location = 2) uniform int u_volume_export_pass; layout(location = 3) uniform ivec3 u_volume_export_dim_offset; layout(location = 4) uniform mat4 u_xdc_transform; layout(location = 5) uniform int u_xdc_index; +layout(location = 6) uniform float u_cycle_t; #define C_SPLINE 0.5