Commit: ccfeec8d805bbf3341aa3ccbaccaa0957365375c
Parent: 7878beab76e8e83d59f6cd2655186dc5fda0144f
Author: Randy Palamar
Date: Fri, 24 Jan 2025 05:59:25 -0700
core/das: pack uforces channels into u16s
this doesn't change any functionality or performance but allows a
simple mem copy from our new parameter save format.
closes: #14
Diffstat:
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/beamformer_parameters.h b/beamformer_parameters.h
@@ -26,7 +26,7 @@ enum compute_shaders {
* read and understood the rules, particulary with regards to _member alignment_ */
typedef struct {
u16 channel_mapping[256]; /* Transducer Channel to Verasonics Channel */
- u32 uforces_channels[128]; /* Channels used for virtual UFORCES elements */
+ u16 uforces_channels[256]; /* Channels used for virtual UFORCES elements */
f32 focal_depths[256]; /* [m] Focal Depths for each transmit of a RCA imaging scheme*/
f32 transmit_angles[256]; /* [radians] Transmit Angles for each transmit of a RCA imaging scheme*/
f32 xdc_transform[16]; /* IMPORTANT: column major order */
diff --git a/shaders/das.glsl b/shaders/das.glsl
@@ -102,8 +102,8 @@ float planewave_transmit_distance(vec3 point, float transmit_angle, int transmit
float cylindricalwave_transmit_distance(vec3 point, float focal_depth, float transmit_angle, int transmit_orientation)
{
- vec3 f = focal_depth * vec3(sin(transmit_angle), sin(transmit_angle), cos(transmit_angle));
- return length((point - f) * orientation_projection(transmit_orientation == TX_ROWS));
+ vec3 f = focal_depth * vec3(sin(transmit_angle), sin(transmit_angle), cos(transmit_angle));
+ return length((point - f) * orientation_projection(transmit_orientation == TX_ROWS));
}
vec2 RCA(vec3 image_point, vec3 delta, float apodization_arg)
@@ -217,11 +217,13 @@ vec2 uFORCES(vec3 image_point, vec3 delta, float apodization_arg)
vec2 sum = vec2(0);
for (uint i = uforces; i < dec_data_dim.z; i++) {
- uint base_idx = (i - uforces) / 4;
- uint sub_idx = (i - uforces) % 4;
+ uint base_idx = ((i - uforces) / 8);
+ uint sub_idx = ((i - uforces) % 8) / 2;
+ uint shift = (~(i - uforces) * 1u) * 16u;
+ uint channel = (uforces_channels[base_idx][sub_idx] << shift) >> 16u;
vec2 rdist = vec2(image_point.x, image_point.z);
- vec3 focal_point = uforces_channels[base_idx][sub_idx] * delta + focal_point_offset;
+ vec3 focal_point = channel * delta + focal_point_offset;
float transmit_dist = distance(image_point, focal_point);
for (uint j = 0; j < dec_data_dim.y; j++) {