beamformer.c (27524B)
1 /* See LICENSE for license details. */ 2 3 // GENERATED CODE 4 5 // NOTE: Constants (Integer) 6 #define BeamformerChunkChannelCount (16) 7 #define BeamformerFilterSlots (4) 8 #define BeamformerMaxBacklogFrames (4096) 9 #define BeamformerMaxChannelCount (256) 10 #define BeamformerMaxEmissionsCount (256) 11 #define BeamformerMaxComputeShaderStages (16) 12 #define BeamformerMaxParameterBlocks (16) 13 #define BeamformerMaxRawDataFramesInFlight (3) 14 15 typedef enum { 16 BeamformerDecodeMode_None = 0, 17 BeamformerDecodeMode_Hadamard = 1, 18 BeamformerDecodeMode_Count, 19 } BeamformerDecodeMode; 20 21 typedef enum { 22 BeamformerRCAOrientation_None = 0, 23 BeamformerRCAOrientation_Rows = 1, 24 BeamformerRCAOrientation_Columns = 2, 25 BeamformerRCAOrientation_Count, 26 } BeamformerRCAOrientation; 27 28 typedef enum { 29 BeamformerSamplingMode_2X = 0, 30 BeamformerSamplingMode_4X = 1, 31 BeamformerSamplingMode_Count, 32 } BeamformerSamplingMode; 33 34 typedef enum { 35 BeamformerDataKind_Int16 = 0, 36 BeamformerDataKind_Int16Complex = 1, 37 BeamformerDataKind_Float32 = 2, 38 BeamformerDataKind_Float32Complex = 3, 39 BeamformerDataKind_Float16 = 4, 40 BeamformerDataKind_Float16Complex = 5, 41 BeamformerDataKind_Count, 42 } BeamformerDataKind; 43 44 typedef enum { 45 BeamformerRFDimension_Channels = 0, 46 BeamformerRFDimension_Events = 1, 47 BeamformerRFDimension_Samples = 2, 48 BeamformerRFDimension_Frames = 3, 49 BeamformerRFDimension_Count, 50 } BeamformerRFDimension; 51 52 typedef enum { 53 BeamformerDataLayout_ChannelEventSample = 0, 54 BeamformerDataLayout_ChannelSampleEvent = 1, 55 BeamformerDataLayout_EventChannelSample = 2, 56 BeamformerDataLayout_SampleChannelEvent = 3, 57 BeamformerDataLayout_Image = 4, 58 BeamformerDataLayout_Count, 59 } BeamformerDataLayout; 60 61 typedef enum { 62 BeamformerContrastMode_None = 0, 63 BeamformerContrastMode_A1S2 = 1, 64 BeamformerContrastMode_Count, 65 } BeamformerContrastMode; 66 67 typedef enum { 68 BeamformerEmissionKind_Sine = 0, 69 BeamformerEmissionKind_Chirp = 1, 70 BeamformerEmissionKind_Count, 71 } BeamformerEmissionKind; 72 73 typedef enum { 74 BeamformerInterpolationMode_Nearest = 0, 75 BeamformerInterpolationMode_Linear = 1, 76 BeamformerInterpolationMode_Cubic = 2, 77 BeamformerInterpolationMode_Count, 78 } BeamformerInterpolationMode; 79 80 typedef enum { 81 BeamformerViewPlaneTag_XZ = 0, 82 BeamformerViewPlaneTag_YZ = 1, 83 BeamformerViewPlaneTag_XY = 2, 84 BeamformerViewPlaneTag_Arbitrary = 3, 85 BeamformerViewPlaneTag_Count, 86 } BeamformerViewPlaneTag; 87 88 typedef enum { 89 BeamformerAcquisitionKind_FORCES = 0, 90 BeamformerAcquisitionKind_UFORCES = 1, 91 BeamformerAcquisitionKind_HERCULES = 2, 92 BeamformerAcquisitionKind_RCA_VLS = 3, 93 BeamformerAcquisitionKind_RCA_TPW = 4, 94 BeamformerAcquisitionKind_UHERCULES = 5, 95 BeamformerAcquisitionKind_RACES = 6, 96 BeamformerAcquisitionKind_EPIC_FORCES = 7, 97 BeamformerAcquisitionKind_EPIC_UFORCES = 8, 98 BeamformerAcquisitionKind_EPIC_UHERCULES = 9, 99 BeamformerAcquisitionKind_Flash = 10, 100 BeamformerAcquisitionKind_HERO_PA = 11, 101 BeamformerAcquisitionKind_ULM = 12, 102 BeamformerAcquisitionKind_Count, 103 } BeamformerAcquisitionKind; 104 105 typedef enum { 106 BeamformerFilterKind_Kaiser = 0, 107 BeamformerFilterKind_MatchedChirp = 1, 108 BeamformerFilterKind_Count, 109 } BeamformerFilterKind; 110 111 typedef enum { 112 BeamformerLiveFeedbackFlags_ImagePlaneOffsets = 0, 113 BeamformerLiveFeedbackFlags_TransmitPower = 1, 114 BeamformerLiveFeedbackFlags_TGCControlPoints = 2, 115 BeamformerLiveFeedbackFlags_SaveData = 3, 116 BeamformerLiveFeedbackFlags_SaveNameTag = 4, 117 BeamformerLiveFeedbackFlags_StopImaging = 5, 118 BeamformerLiveFeedbackFlags_AcquisitionKind = 6, 119 BeamformerLiveFeedbackFlags_Count, 120 } BeamformerLiveFeedbackFlags; 121 122 typedef enum { 123 BeamformerAcquisitionKindFlags_FixedTransmits = 1 << 0, 124 BeamformerAcquisitionKindFlags_Sparse = 1 << 1, 125 } BeamformerAcquisitionKindFlags; 126 127 typedef enum { 128 BeamformerLiveImagingDirtyFlags_ImagePlaneOffsets = 1 << 0, 129 BeamformerLiveImagingDirtyFlags_TransmitPower = 1 << 1, 130 BeamformerLiveImagingDirtyFlags_TGCControlPoints = 1 << 2, 131 BeamformerLiveImagingDirtyFlags_SaveData = 1 << 3, 132 BeamformerLiveImagingDirtyFlags_SaveNameTag = 1 << 4, 133 BeamformerLiveImagingDirtyFlags_StopImaging = 1 << 5, 134 BeamformerLiveImagingDirtyFlags_AcquisitionKind = 1 << 6, 135 } BeamformerLiveImagingDirtyFlags; 136 137 typedef enum { 138 BeamformerDecodeCompileFlags_CooperativeMatrix = 1 << 0, 139 BeamformerDecodeCompileFlags_UseSharedMemory = 1 << 1, 140 } BeamformerDecodeCompileFlags; 141 142 typedef enum { 143 BeamformerFilterCompileFlags_ComplexFilter = 1 << 0, 144 BeamformerFilterCompileFlags_Demodulate = 1 << 1, 145 } BeamformerFilterCompileFlags; 146 147 typedef enum { 148 BeamformerDASCompileFlags_CoherencyWeighting = 1 << 0, 149 BeamformerDASCompileFlags_Sparse = 1 << 1, 150 } BeamformerDASCompileFlags; 151 152 typedef enum { 153 BeamformerReshapeCompileFlags_Deinterleave = 1 << 0, 154 BeamformerReshapeCompileFlags_Interleave = 1 << 1, 155 } BeamformerReshapeCompileFlags; 156 157 typedef enum { 158 BeamformerShaderKind_Decode = 0, 159 BeamformerShaderKind_Filter = 1, 160 BeamformerShaderKind_Demodulate = 2, 161 BeamformerShaderKind_DAS = 3, 162 BeamformerShaderKind_Hilbert = 4, 163 BeamformerShaderKind_CoherencyWeighting = 5, 164 BeamformerShaderKind_Reshape = 6, 165 BeamformerShaderKind_MinMax = 7, 166 BeamformerShaderKind_Sum = 8, 167 BeamformerShaderKind_RenderBeamformed = 9, 168 BeamformerShaderKind_Count, 169 170 BeamformerShaderKind_ComputeFirst = BeamformerShaderKind_Decode, 171 BeamformerShaderKind_ComputeLast = BeamformerShaderKind_Hilbert, 172 BeamformerShaderKind_ComputeCount = 5, 173 BeamformerShaderKind_ComputeHelpersFirst = BeamformerShaderKind_CoherencyWeighting, 174 BeamformerShaderKind_ComputeHelpersLast = BeamformerShaderKind_Sum, 175 BeamformerShaderKind_ComputeHelpersCount = 4, 176 BeamformerShaderKind_RenderFirst = BeamformerShaderKind_RenderBeamformed, 177 BeamformerShaderKind_RenderLast = BeamformerShaderKind_RenderBeamformed, 178 BeamformerShaderKind_RenderCount = 1, 179 } BeamformerShaderKind; 180 181 typedef struct { 182 u32 Hadamard; 183 u32 DecodeMode; 184 u32 OutputChannelStride; 185 u32 OutputSampleStride; 186 u32 OutputTransmitStride; 187 u32 ToProcess; 188 u32 TransmitCount; 189 u32 ChunkChannelCount; 190 u32 CooperativeMatrixM; 191 u32 CooperativeMatrixN; 192 u32 CooperativeMatrixK; 193 } BeamformerDecodeBakeParameters; 194 195 typedef struct { 196 u32 FilterCoefficients; 197 u32 FilterLength; 198 f32 SamplingFrequency; 199 f32 DemodulationFrequency; 200 u32 DecimationRate; 201 u32 SampleCount; 202 u32 BatchSampleCount; 203 u32 InputChannelStride; 204 u32 InputSampleStride; 205 u32 InputTransmitStride; 206 u32 OutputChannelStride; 207 u32 OutputSampleStride; 208 u32 OutputTransmitStride; 209 } BeamformerFilterBakeParameters; 210 211 typedef struct { 212 u32 FocalVectors; 213 u32 Hadamard; 214 u32 IncoherentFrame; 215 u32 SparseElements; 216 u32 TransducerTransforms; 217 u32 TransmitReceiveOrientations; 218 u32 AcquisitionKind; 219 i32 AcquisitionCount; 220 i32 SampleCount; 221 u32 AcquisitionByteStride; 222 u32 ChannelByteStride; 223 u16 ReceiveChannelCount; 224 u16 TransmitChannelCount; 225 u16 ReceiveTileCount; 226 u16 TransmitTileCount; 227 u16 ChunkChannelCount; 228 u16 TransmitReceiveOrientation; 229 u16 InterpolationMode; 230 u16 ReadiGroupCount; 231 f32 SamplingFrequency; 232 f32 DemodulationFrequency; 233 f32 SpeedOfSound; 234 f32 TimeOffset; 235 f32 FNumber; 236 u32 OutputSizeX; 237 u32 OutputSizeY; 238 u32 OutputSizeZ; 239 } BeamformerDASBakeParameters; 240 241 typedef struct { 242 u32 IncoherentSum; 243 f32 Scale; 244 u32 OutputVoxels; 245 } BeamformerCoherencyWeightingBakeParameters; 246 247 typedef struct { 248 u32 SizeX; 249 u32 SizeY; 250 u32 SizeZ; 251 u32 InputStrideX; 252 u32 InputStrideY; 253 u32 InputStrideZ; 254 u32 OutputStrideX; 255 u32 OutputStrideY; 256 u32 OutputStrideZ; 257 } BeamformerReshapeBakeParameters; 258 259 typedef struct { 260 u64 rf_buffer; 261 u64 output_buffer; 262 } BeamformerDecodePushConstants; 263 264 typedef struct { 265 u64 input_buffer; 266 u64 output_buffer; 267 } BeamformerFilterPushConstants; 268 269 typedef struct { 270 m4 voxel_transform; 271 v2 xdc_element_pitch; 272 u64 rf_data; 273 u64 output_frame; 274 u32 channel_offset; 275 f32 focus_depth; 276 f32 steering_angle; 277 u16 tx_rx_orientation; 278 u16 readi_group; 279 } BeamformerDASPushConstants; 280 281 typedef struct { 282 u64 coherent_sum; 283 } BeamformerCoherencyWeightingPushConstants; 284 285 typedef struct { 286 u64 output_buffer; 287 u64 left_input_buffer; 288 u64 right_input_buffer; 289 } BeamformerReshapePushConstants; 290 291 typedef struct { 292 u64 output_data; 293 u64 input_data; 294 u32 image_elements; 295 f32 scale; 296 } BeamformerSumPushConstants; 297 298 typedef struct { 299 m4 mvp_matrix; 300 u64 positions; 301 u64 normals; 302 v4 bounding_box_colour; 303 f32 bounding_box_fraction; 304 f32 db_cutoff; 305 f32 threshold; 306 f32 gamma; 307 u64 input_data; 308 u32 input_size_x; 309 u32 input_size_y; 310 u32 input_size_z; 311 u32 data_kind; 312 } BeamformerRenderBeamformedPushConstants; 313 314 typedef struct { 315 f32 cycles; 316 f32 frequency; 317 } BeamformerSineParameters; 318 319 typedef struct { 320 f32 duration; 321 f32 min_frequency; 322 f32 max_frequency; 323 } BeamformerChirpParameters; 324 325 typedef struct { 326 BeamformerEmissionKind kind; 327 union { 328 BeamformerSineParameters sine; 329 BeamformerChirpParameters chirp; 330 }; 331 } BeamformerEmissionParameters; 332 333 typedef struct { 334 f32 cutoff_frequency; 335 f32 beta; 336 u32 length; 337 } BeamformerKaiserFilterParameters; 338 339 typedef struct { 340 f32 duration; 341 f32 min_frequency; 342 f32 max_frequency; 343 } BeamformerMatchedChirpFilterParameters; 344 345 typedef struct { 346 BeamformerFilterKind kind; 347 f32 sampling_frequency; 348 b32 complex; 349 union { 350 BeamformerKaiserFilterParameters kaiser; 351 BeamformerMatchedChirpFilterParameters matched_chirp; 352 }; 353 } BeamformerFilterParameters; 354 355 typedef struct { 356 m4 das_voxel_transform; 357 m4 xdc_transform; 358 v2 xdc_element_pitch; 359 uv2 raw_data_dimensions; 360 v2 focal_vector; 361 u32 transmit_receive_orientation; 362 u32 sample_count; 363 u32 channel_count; 364 u32 acquisition_count; 365 BeamformerAcquisitionKind acquisition_kind; 366 BeamformerDecodeMode decode_mode; 367 BeamformerSamplingMode sampling_mode; 368 f32 time_offset; 369 b32 single_focus; 370 b32 single_orientation; 371 iv4 output_points; 372 f32 sampling_frequency; 373 f32 demodulation_frequency; 374 f32 speed_of_sound; 375 f32 f_number; 376 BeamformerInterpolationMode interpolation_mode; 377 b32 coherency_weighting; 378 u32 decimation_rate; 379 BeamformerContrastMode contrast_mode; 380 BeamformerEmissionParameters emission_parameters; 381 u32 readi_group_count; 382 u32 readi_group; 383 } BeamformerParameters; 384 385 typedef struct { 386 m4 das_voxel_transform; 387 m4 xdc_transform; 388 v2 xdc_element_pitch; 389 uv2 raw_data_dimensions; 390 v2 focal_vector; 391 u32 transmit_receive_orientation; 392 u32 sample_count; 393 u32 channel_count; 394 u32 acquisition_count; 395 BeamformerAcquisitionKind acquisition_kind; 396 BeamformerDecodeMode decode_mode; 397 BeamformerSamplingMode sampling_mode; 398 f32 time_offset; 399 b32 single_focus; 400 b32 single_orientation; 401 iv4 output_points; 402 f32 sampling_frequency; 403 f32 demodulation_frequency; 404 f32 speed_of_sound; 405 f32 f_number; 406 BeamformerInterpolationMode interpolation_mode; 407 b32 coherency_weighting; 408 u32 decimation_rate; 409 BeamformerContrastMode contrast_mode; 410 BeamformerEmissionParameters emission_parameters; 411 u32 readi_group_count; 412 u32 readi_group; 413 i16 channel_mapping[BeamformerMaxChannelCount]; 414 i16 sparse_elements[BeamformerMaxEmissionsCount]; 415 u8 transmit_receive_orientations[BeamformerMaxEmissionsCount]; 416 f32 steering_angles[BeamformerMaxEmissionsCount]; 417 f32 focal_depths[BeamformerMaxEmissionsCount]; 418 i32 compute_stages[BeamformerMaxComputeShaderStages]; 419 i32 compute_stage_parameters[BeamformerMaxComputeShaderStages]; 420 u32 compute_stages_count; 421 BeamformerDataKind data_kind; 422 } BeamformerSimpleParameters; 423 424 typedef struct { 425 u32 active; 426 u32 save_enabled; 427 u32 save_active; 428 u32 acquisition_kind; 429 u64 acquisition_kind_enabled_flags; 430 f32 transmit_power; 431 f32 image_plane_offsets[BeamformerViewPlaneTag_Count]; 432 f32 tgc_control_points[8]; 433 i32 save_name_tag_length; 434 u8 save_name_tag[128]; 435 } BeamformerLiveImagingParameters; 436 437 typedef union { 438 BeamformerDecodeBakeParameters Decode; 439 BeamformerFilterBakeParameters Filter; 440 BeamformerDASBakeParameters DAS; 441 BeamformerCoherencyWeightingBakeParameters CoherencyWeighting; 442 BeamformerReshapeBakeParameters Reshape; 443 } BeamformerShaderBakeParameters; 444 445 typedef enum { 446 BeamformerStructKind_DecodeBakeParameters = 0, 447 BeamformerStructKind_FilterBakeParameters = 1, 448 BeamformerStructKind_DASBakeParameters = 2, 449 BeamformerStructKind_CoherencyWeightingBakeParameters = 3, 450 BeamformerStructKind_ReshapeBakeParameters = 4, 451 BeamformerStructKind_Count, 452 } BeamformerStructKind; 453 454 read_only MetaStructMember *meta_struct_members_by_id[] = { 455 (MetaStructMember []){ 456 {18, 0, 1, 0}, 457 {18, 4, 1, 0}, 458 {18, 8, 1, 0}, 459 {18, 12, 1, 0}, 460 {18, 16, 1, 0}, 461 {18, 20, 1, 0}, 462 {18, 24, 1, 0}, 463 {18, 28, 1, 0}, 464 {18, 32, 1, 0}, 465 {18, 36, 1, 0}, 466 {18, 40, 1, 0}, 467 }, 468 (MetaStructMember []){ 469 {18, 0, 1, 0}, 470 {18, 4, 1, 0}, 471 {8, 8, 1, 0}, 472 {8, 12, 1, 0}, 473 {18, 16, 1, 0}, 474 {18, 20, 1, 0}, 475 {18, 24, 1, 0}, 476 {18, 28, 1, 0}, 477 {18, 32, 1, 0}, 478 {18, 36, 1, 0}, 479 {18, 40, 1, 0}, 480 {18, 44, 1, 0}, 481 {18, 48, 1, 0}, 482 }, 483 (MetaStructMember []){ 484 {18, 0, 1, 0}, 485 {18, 4, 1, 0}, 486 {18, 8, 1, 0}, 487 {18, 12, 1, 0}, 488 {18, 16, 1, 0}, 489 {18, 20, 1, 0}, 490 {18, 24, 1, 0}, 491 {10, 28, 1, 0}, 492 {10, 32, 1, 0}, 493 {18, 36, 1, 0}, 494 {18, 40, 1, 0}, 495 {19, 44, 1, 0}, 496 {19, 46, 1, 0}, 497 {19, 48, 1, 0}, 498 {19, 50, 1, 0}, 499 {19, 52, 1, 0}, 500 {19, 54, 1, 0}, 501 {19, 56, 1, 0}, 502 {19, 58, 1, 0}, 503 {8, 60, 1, 0}, 504 {8, 64, 1, 0}, 505 {8, 68, 1, 0}, 506 {8, 72, 1, 0}, 507 {8, 76, 1, 0}, 508 {18, 80, 1, 0}, 509 {18, 84, 1, 0}, 510 {18, 88, 1, 0}, 511 }, 512 (MetaStructMember []){ 513 {18, 0, 1, 0}, 514 {8, 4, 1, 0}, 515 {18, 8, 1, 0}, 516 }, 517 (MetaStructMember []){ 518 {18, 0, 1, 0}, 519 {18, 4, 1, 0}, 520 {18, 8, 1, 0}, 521 {18, 12, 1, 0}, 522 {18, 16, 1, 0}, 523 {18, 20, 1, 0}, 524 {18, 24, 1, 0}, 525 {18, 28, 1, 0}, 526 {18, 32, 1, 0}, 527 }, 528 }; 529 530 read_only str8 *meta_struct_member_names_by_id[] = { 531 (str8 []){ 532 str8_comp("Hadamard"), 533 str8_comp("DecodeMode"), 534 str8_comp("OutputChannelStride"), 535 str8_comp("OutputSampleStride"), 536 str8_comp("OutputTransmitStride"), 537 str8_comp("ToProcess"), 538 str8_comp("TransmitCount"), 539 str8_comp("ChunkChannelCount"), 540 str8_comp("CooperativeMatrixM"), 541 str8_comp("CooperativeMatrixN"), 542 str8_comp("CooperativeMatrixK"), 543 }, 544 (str8 []){ 545 str8_comp("FilterCoefficients"), 546 str8_comp("FilterLength"), 547 str8_comp("SamplingFrequency"), 548 str8_comp("DemodulationFrequency"), 549 str8_comp("DecimationRate"), 550 str8_comp("SampleCount"), 551 str8_comp("BatchSampleCount"), 552 str8_comp("InputChannelStride"), 553 str8_comp("InputSampleStride"), 554 str8_comp("InputTransmitStride"), 555 str8_comp("OutputChannelStride"), 556 str8_comp("OutputSampleStride"), 557 str8_comp("OutputTransmitStride"), 558 }, 559 (str8 []){ 560 str8_comp("FocalVectors"), 561 str8_comp("Hadamard"), 562 str8_comp("IncoherentFrame"), 563 str8_comp("SparseElements"), 564 str8_comp("TransducerTransforms"), 565 str8_comp("TransmitReceiveOrientations"), 566 str8_comp("AcquisitionKind"), 567 str8_comp("AcquisitionCount"), 568 str8_comp("SampleCount"), 569 str8_comp("AcquisitionByteStride"), 570 str8_comp("ChannelByteStride"), 571 str8_comp("ReceiveChannelCount"), 572 str8_comp("TransmitChannelCount"), 573 str8_comp("ReceiveTileCount"), 574 str8_comp("TransmitTileCount"), 575 str8_comp("ChunkChannelCount"), 576 str8_comp("TransmitReceiveOrientation"), 577 str8_comp("InterpolationMode"), 578 str8_comp("ReadiGroupCount"), 579 str8_comp("SamplingFrequency"), 580 str8_comp("DemodulationFrequency"), 581 str8_comp("SpeedOfSound"), 582 str8_comp("TimeOffset"), 583 str8_comp("FNumber"), 584 str8_comp("OutputSizeX"), 585 str8_comp("OutputSizeY"), 586 str8_comp("OutputSizeZ"), 587 }, 588 (str8 []){ 589 str8_comp("IncoherentSum"), 590 str8_comp("Scale"), 591 str8_comp("OutputVoxels"), 592 }, 593 (str8 []){ 594 str8_comp("SizeX"), 595 str8_comp("SizeY"), 596 str8_comp("SizeZ"), 597 str8_comp("InputStrideX"), 598 str8_comp("InputStrideY"), 599 str8_comp("InputStrideZ"), 600 str8_comp("OutputStrideX"), 601 str8_comp("OutputStrideY"), 602 str8_comp("OutputStrideZ"), 603 }, 604 }; 605 606 read_only MetaStructInfo meta_struct_info_by_id[] = { 607 {str8_comp("DecodeBakeParameters"), 11, 44, 0}, 608 {str8_comp("FilterBakeParameters"), 13, 52, 0}, 609 {str8_comp("DASBakeParameters"), 27, 92, 0}, 610 {str8_comp("CoherencyWeightingBakeParameters"), 3, 12, 0}, 611 {str8_comp("ReshapeBakeParameters"), 9, 36, 0}, 612 }; 613 614 read_only str8 beamformer_shader_names[] = { 615 str8_comp("Decode"), 616 str8_comp("Filter"), 617 str8_comp("Demodulate"), 618 str8_comp("DAS"), 619 str8_comp("Hilbert"), 620 str8_comp("CoherencyWeighting"), 621 str8_comp("Reshape"), 622 str8_comp("MinMax"), 623 str8_comp("Sum"), 624 str8_comp("RenderBeamformed"), 625 }; 626 627 read_only BeamformerShaderKind beamformer_reloadable_shader_kinds[] = { 628 BeamformerShaderKind_Decode, 629 BeamformerShaderKind_Filter, 630 BeamformerShaderKind_DAS, 631 BeamformerShaderKind_CoherencyWeighting, 632 BeamformerShaderKind_Reshape, 633 BeamformerShaderKind_MinMax, 634 BeamformerShaderKind_Sum, 635 BeamformerShaderKind_RenderBeamformed, 636 }; 637 638 read_only str8 *beamformer_reloadable_shader_files[] = { 639 (str8 []){str8_comp("decode.glsl")}, 640 (str8 []){str8_comp("filter.glsl")}, 641 (str8 []){str8_comp("das.glsl")}, 642 (str8 []){str8_comp("coherency_weighting.glsl")}, 643 (str8 []){str8_comp("reshape.glsl")}, 644 (str8 []){str8_comp("min_max.glsl")}, 645 (str8 []){str8_comp("sum.glsl")}, 646 (str8 []){str8_comp("render_3d.vert.glsl"), str8_comp("render_3d.frag.glsl")}, 647 }; 648 649 read_only i32 beamformer_shader_reloadable_index_by_shader[] = { 650 0, 651 1, 652 1, 653 2, 654 -1, 655 3, 656 4, 657 5, 658 6, 659 7, 660 }; 661 662 read_only i32 beamformer_reloadable_compute_shader_info_indices[] = { 663 0, 664 1, 665 2, 666 }; 667 668 read_only i32 beamformer_reloadable_compute_helpers_shader_info_indices[] = { 669 3, 670 4, 671 5, 672 6, 673 }; 674 675 read_only i32 beamformer_reloadable_render_shader_info_indices[] = { 676 7, 677 }; 678 679 read_only str8 beamformer_shader_global_header_strings[] = { 680 str8_comp("" 681 "#define DecodeMode_None 0\n" 682 "#define DecodeMode_Hadamard 1\n" 683 "\n"), 684 str8_comp("" 685 "#define CooperativeMatrix ((CompileFlags & (1 << 0)) != 0)\n" 686 "#define UseSharedMemory ((CompileFlags & (1 << 1)) != 0)\n" 687 "\n"), 688 str8_comp("" 689 "layout(push_constant, std430) uniform PushConstants {\n" 690 " uint64_t rf_buffer;\n" 691 " uint64_t output_buffer;\n" 692 "};\n" 693 "\n"), 694 str8_comp("" 695 "#define ComplexFilter ((CompileFlags & (1 << 0)) != 0)\n" 696 "#define Demodulate ((CompileFlags & (1 << 1)) != 0)\n" 697 "\n"), 698 str8_comp("" 699 "layout(push_constant, std430) uniform PushConstants {\n" 700 " uint64_t input_buffer;\n" 701 " uint64_t output_buffer;\n" 702 "};\n" 703 "\n"), 704 str8_comp("" 705 "#define AcquisitionKind_FORCES 0\n" 706 "#define AcquisitionKind_UFORCES 1\n" 707 "#define AcquisitionKind_HERCULES 2\n" 708 "#define AcquisitionKind_RCA_VLS 3\n" 709 "#define AcquisitionKind_RCA_TPW 4\n" 710 "#define AcquisitionKind_UHERCULES 5\n" 711 "#define AcquisitionKind_RACES 6\n" 712 "#define AcquisitionKind_EPIC_FORCES 7\n" 713 "#define AcquisitionKind_EPIC_UFORCES 8\n" 714 "#define AcquisitionKind_EPIC_UHERCULES 9\n" 715 "#define AcquisitionKind_Flash 10\n" 716 "#define AcquisitionKind_HERO_PA 11\n" 717 "#define AcquisitionKind_ULM 12\n" 718 "\n"), 719 str8_comp("" 720 "#define InterpolationMode_Nearest 0\n" 721 "#define InterpolationMode_Linear 1\n" 722 "#define InterpolationMode_Cubic 2\n" 723 "\n"), 724 str8_comp("" 725 "#define RCAOrientation_None 0\n" 726 "#define RCAOrientation_Rows 1\n" 727 "#define RCAOrientation_Columns 2\n" 728 "\n"), 729 str8_comp("" 730 "#define CoherencyWeighting ((CompileFlags & (1 << 0)) != 0)\n" 731 "#define Sparse ((CompileFlags & (1 << 1)) != 0)\n" 732 "\n"), 733 str8_comp("" 734 "layout(push_constant, std430) uniform PushConstants {\n" 735 " f32mat4 voxel_transform;\n" 736 " f32vec2 xdc_element_pitch;\n" 737 " uint64_t rf_data;\n" 738 " uint64_t output_frame;\n" 739 " uint32_t channel_offset;\n" 740 " float32_t focus_depth;\n" 741 " float32_t steering_angle;\n" 742 " uint16_t tx_rx_orientation;\n" 743 " uint16_t readi_group;\n" 744 "};\n" 745 "\n"), 746 str8_comp("" 747 "layout(push_constant, std430) uniform PushConstants {\n" 748 " uint64_t coherent_sum;\n" 749 "};\n" 750 "\n"), 751 str8_comp("" 752 "#define Deinterleave ((CompileFlags & (1 << 0)) != 0)\n" 753 "#define Interleave ((CompileFlags & (1 << 1)) != 0)\n" 754 "\n"), 755 str8_comp("" 756 "layout(push_constant, std430) uniform PushConstants {\n" 757 " uint64_t output_buffer;\n" 758 " uint64_t left_input_buffer;\n" 759 " uint64_t right_input_buffer;\n" 760 "};\n" 761 "\n"), 762 str8_comp("" 763 "layout(push_constant, std430) uniform PushConstants {\n" 764 " uint64_t output_data;\n" 765 " uint64_t input_data;\n" 766 " uint32_t image_elements;\n" 767 " float32_t scale;\n" 768 "};\n" 769 "\n"), 770 str8_comp("" 771 "layout(push_constant, std430) uniform PushConstants {\n" 772 " f32mat4 mvp_matrix;\n" 773 " uint64_t positions;\n" 774 " uint64_t normals;\n" 775 " f32vec4 bounding_box_colour;\n" 776 " float32_t bounding_box_fraction;\n" 777 " float32_t db_cutoff;\n" 778 " float32_t threshold;\n" 779 " float32_t gamma;\n" 780 " uint64_t input_data;\n" 781 " uint32_t input_size_x;\n" 782 " uint32_t input_size_y;\n" 783 " uint32_t input_size_z;\n" 784 " uint32_t data_kind;\n" 785 "};\n" 786 "\n"), 787 }; 788 789 read_only b8 beamformer_shader_has_primitive[] = { 790 0, 791 0, 792 0, 793 0, 794 0, 795 0, 796 0, 797 1, 798 }; 799 800 read_only b8 beamformer_shader_primitive_is_vertex[] = { 801 0, 802 0, 803 0, 804 0, 805 0, 806 0, 807 0, 808 1, 809 }; 810 811 read_only i32 *beamformer_shader_header_vectors[] = { 812 (i32 []){0, 1, 2}, 813 (i32 []){3, 4}, 814 (i32 []){5, 6, 7, 8, 9}, 815 (i32 []){10}, 816 (i32 []){11, 12}, 817 0, 818 (i32 []){13}, 819 (i32 []){14}, 820 }; 821 822 read_only i32 beamformer_shader_header_vector_lengths[] = { 823 3, 824 2, 825 5, 826 1, 827 2, 828 0, 829 1, 830 1, 831 }; 832 833 read_only str8 *beamformer_shader_compile_flag_names[] = { 834 (str8 []){ 835 str8_comp("CooperativeMatrix"), 836 str8_comp("UseSharedMemory"), 837 }, 838 (str8 []){ 839 str8_comp("ComplexFilter"), 840 str8_comp("Demodulate"), 841 }, 842 (str8 []){ 843 str8_comp("CoherencyWeighting"), 844 str8_comp("Sparse"), 845 }, 846 0, 847 (str8 []){ 848 str8_comp("Deinterleave"), 849 str8_comp("Interleave"), 850 }, 851 0, 852 0, 853 0, 854 }; 855 856 read_only u8 beamformer_shader_compile_flag_counts[] = { 857 2, 858 2, 859 2, 860 0, 861 2, 862 0, 863 0, 864 0, 865 }; 866 867 read_only i32 beamformer_base_shader_to_bake_struct_id[] = { 868 0, 869 1, 870 2, 871 3, 872 4, 873 -1, 874 -1, 875 -1, 876 }; 877 878 read_only u8 beamformer_shader_push_constant_sizes[] = { 879 sizeof(BeamformerDecodePushConstants), 880 sizeof(BeamformerFilterPushConstants), 881 sizeof(BeamformerDASPushConstants), 882 sizeof(BeamformerCoherencyWeightingPushConstants), 883 sizeof(BeamformerReshapePushConstants), 884 0, 885 sizeof(BeamformerSumPushConstants), 886 sizeof(BeamformerRenderBeamformedPushConstants), 887 }; 888 889 read_only u8 beamformer_data_kind_element_size[] = { 890 2, 891 2, 892 4, 893 4, 894 2, 895 2, 896 }; 897 898 read_only u8 beamformer_data_kind_element_count[] = { 899 1, 900 2, 901 1, 902 2, 903 1, 904 2, 905 }; 906 907 read_only u8 beamformer_data_kind_byte_size[] = { 908 2 * 1, 909 2 * 2, 910 4 * 1, 911 4 * 2, 912 2 * 1, 913 2 * 2, 914 }; 915 916 read_only b8 beamformer_data_kind_complex[] = { 917 0, 918 1, 919 0, 920 1, 921 0, 922 1, 923 }; 924 925 read_only str8 beamformer_data_kind_glsl_type[] = { 926 str8_comp("int16_t"), 927 str8_comp("i16vec2"), 928 str8_comp("float32_t"), 929 str8_comp("f32vec2"), 930 str8_comp("float16_t"), 931 str8_comp("f16vec2"), 932 }; 933 934 read_only str8 beamformer_data_kind_str8[] = { 935 str8_comp("Int16"), 936 str8_comp("Int16Complex"), 937 str8_comp("Float32"), 938 str8_comp("Float32Complex"), 939 str8_comp("Float16"), 940 str8_comp("Float16Complex"), 941 }; 942 943 read_only u32 beamformer_acquisition_kind_flags[] = { 944 (1*BeamformerAcquisitionKindFlags_FixedTransmits)|(0*BeamformerAcquisitionKindFlags_Sparse), 945 (0*BeamformerAcquisitionKindFlags_FixedTransmits)|(1*BeamformerAcquisitionKindFlags_Sparse), 946 (1*BeamformerAcquisitionKindFlags_FixedTransmits)|(0*BeamformerAcquisitionKindFlags_Sparse), 947 (0*BeamformerAcquisitionKindFlags_FixedTransmits)|(0*BeamformerAcquisitionKindFlags_Sparse), 948 (0*BeamformerAcquisitionKindFlags_FixedTransmits)|(0*BeamformerAcquisitionKindFlags_Sparse), 949 (0*BeamformerAcquisitionKindFlags_FixedTransmits)|(1*BeamformerAcquisitionKindFlags_Sparse), 950 (1*BeamformerAcquisitionKindFlags_FixedTransmits)|(0*BeamformerAcquisitionKindFlags_Sparse), 951 (1*BeamformerAcquisitionKindFlags_FixedTransmits)|(0*BeamformerAcquisitionKindFlags_Sparse), 952 (0*BeamformerAcquisitionKindFlags_FixedTransmits)|(1*BeamformerAcquisitionKindFlags_Sparse), 953 (0*BeamformerAcquisitionKindFlags_FixedTransmits)|(1*BeamformerAcquisitionKindFlags_Sparse), 954 (0*BeamformerAcquisitionKindFlags_FixedTransmits)|(0*BeamformerAcquisitionKindFlags_Sparse), 955 (0*BeamformerAcquisitionKindFlags_FixedTransmits)|(0*BeamformerAcquisitionKindFlags_Sparse), 956 (0*BeamformerAcquisitionKindFlags_FixedTransmits)|(0*BeamformerAcquisitionKindFlags_Sparse), 957 }; 958 959 read_only str8 beamformer_acquisition_kind_strings[] = { 960 str8_comp("FORCES"), 961 str8_comp("UFORCES"), 962 str8_comp("HERCULES"), 963 str8_comp("VLS"), 964 str8_comp("TPW"), 965 str8_comp("UHERCULES"), 966 str8_comp("RACES"), 967 str8_comp("EPIC-FORCES"), 968 str8_comp("EPIC-UFORCES"), 969 str8_comp("EPIC-UHERCULES"), 970 str8_comp("Flash"), 971 str8_comp("HERO-PA"), 972 str8_comp("ULM"), 973 }; 974 975 read_only u8 beamformer_contrast_mode_samples[] = { 976 1, 977 3, 978 }; 979 980 read_only str8 beamformer_contrast_mode_strings[] = { 981 str8_comp("None"), 982 str8_comp("A1S2"), 983 }; 984 985 read_only str8 beamformer_view_plane_tag_strings[] = { 986 str8_comp("XZ"), 987 str8_comp("YZ"), 988 str8_comp("XY"), 989 str8_comp("Arbitrary"), 990 }; 991 992 read_only str8 beamformer_emission_kind_strings[] = { 993 str8_comp("Sine"), 994 str8_comp("Chirp"), 995 }; 996 997 read_only str8 beamformer_interpolation_mode_strings[] = { 998 str8_comp("Nearest"), 999 str8_comp("Linear"), 1000 str8_comp("Cubic"), 1001 }; 1002 1003 read_only u8 beamformer_data_stride_indices[BeamformerDataLayout_Count][3] = { 1004 [BeamformerDataLayout_ChannelEventSample] = {BeamformerRFDimension_Channels, BeamformerRFDimension_Events, BeamformerRFDimension_Samples}, 1005 [BeamformerDataLayout_ChannelSampleEvent] = {BeamformerRFDimension_Channels, BeamformerRFDimension_Samples, BeamformerRFDimension_Events}, 1006 [BeamformerDataLayout_EventChannelSample] = {BeamformerRFDimension_Events, BeamformerRFDimension_Channels, BeamformerRFDimension_Samples}, 1007 [BeamformerDataLayout_SampleChannelEvent] = {BeamformerRFDimension_Samples, BeamformerRFDimension_Channels, BeamformerRFDimension_Events}, 1008 }; 1009