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