Commit: cf740eba2567db46fc8585db1cc159d79ab810d7
Parent: ba4a04ae2f905e5c2775f1c9471c7391558d92b0
Author: Randy Palamar
Date: Thu, 10 Sep 2026 07:16:35 -0700
das: VLS/TPW: split sample index calculation up like in HERCULES
Instead of calculating the sample index from the summed transmit
receive distance calculate the transmit portion first then add it
to receive portion later.
This gives a roughly ~8% speed up since it shortens the dependency
chain for starting a load.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/shaders/das.glsl b/shaders/das.glsl
@@ -246,8 +246,8 @@ RESULT_TYPE RCA(const vec3 world_point)
const u8 tx_rx_orientation = tx_rx_orientation_for_acquisition(acquisition);
const bool rx_rows = RX_ORIENTATION(tx_rx_orientation) == RCAOrientation_Rows;
const vec2 focal_vector = focal_vector_for_acquisition(acquisition);
- vec2 xdc_world_point = rca_plane_projection((xdc_transform * vec4(world_point, 1)).xyz, rx_rows);
- float transmit_distance = rca_transmit_distance(world_point, focal_vector, tx_rx_orientation);
+ vec2 xdc_world_point = rca_plane_projection((xdc_transform * vec4(world_point, 1)).xyz, rx_rows);
+ f32 transmit_index = sample_index(rca_transmit_distance(world_point, focal_vector, tx_rx_orientation));
u64 rf_pointer = RFData + InputDataKindByteSize * acquisition * SampleCount;
rf_pointer -= InputDataKindByteSize * u32(InterpolationMode == InterpolationMode_Cubic);
@@ -259,7 +259,7 @@ RESULT_TYPE RCA(const vec3 world_point)
f32 a_arg = abs(FNumber * receive_vector.x / abs(xdc_world_point.y));
if (a_arg < 0.5f) {
- f32 index = sample_index(transmit_distance + length(receive_vector));
+ f32 index = transmit_index + length(receive_vector) * SamplingFrequency / SpeedOfSound;
SAMPLE_TYPE value = apodize(a_arg) * sample_rf(rf_pointer, index);
result += RESULT_STORE(value);
}