ogl_beamforming

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

beamformer.meta.c (22634B)


      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 // NOTE: Constants (Float)
     16 
     17 typedef enum {
     18 	BeamformerShaderResourceKind_Buffer = 0,
     19 	BeamformerShaderResourceKind_Count,
     20 } BeamformerShaderResourceKind;
     21 
     22 typedef enum {
     23 	BeamformerShaderBufferSlot_BeamformedData = 0,
     24 	BeamformerShaderBufferSlot_PingPong       = 1,
     25 	BeamformerShaderBufferSlot_Count,
     26 } BeamformerShaderBufferSlot;
     27 
     28 typedef enum {
     29 	BeamformerDecodeMode_None     = 0,
     30 	BeamformerDecodeMode_Hadamard = 1,
     31 	BeamformerDecodeMode_Count,
     32 } BeamformerDecodeMode;
     33 
     34 typedef enum {
     35 	BeamformerRCAOrientation_None    = 0,
     36 	BeamformerRCAOrientation_Rows    = 1,
     37 	BeamformerRCAOrientation_Columns = 2,
     38 	BeamformerRCAOrientation_Count,
     39 } BeamformerRCAOrientation;
     40 
     41 typedef enum {
     42 	BeamformerSamplingMode_2X = 0,
     43 	BeamformerSamplingMode_4X = 1,
     44 	BeamformerSamplingMode_Count,
     45 } BeamformerSamplingMode;
     46 
     47 typedef enum {
     48 	BeamformerDataKind_Int16          = 0,
     49 	BeamformerDataKind_Int16Complex   = 1,
     50 	BeamformerDataKind_Float32        = 2,
     51 	BeamformerDataKind_Float32Complex = 3,
     52 	BeamformerDataKind_Float16        = 4,
     53 	BeamformerDataKind_Float16Complex = 5,
     54 	BeamformerDataKind_Count,
     55 } BeamformerDataKind;
     56 
     57 typedef enum {
     58 	BeamformerContrastMode_None = 0,
     59 	BeamformerContrastMode_A1S2 = 1,
     60 	BeamformerContrastMode_Count,
     61 } BeamformerContrastMode;
     62 
     63 typedef enum {
     64 	BeamformerEmissionKind_Sine  = 0,
     65 	BeamformerEmissionKind_Chirp = 1,
     66 	BeamformerEmissionKind_Count,
     67 } BeamformerEmissionKind;
     68 
     69 typedef enum {
     70 	BeamformerInterpolationMode_Nearest = 0,
     71 	BeamformerInterpolationMode_Linear  = 1,
     72 	BeamformerInterpolationMode_Cubic   = 2,
     73 	BeamformerInterpolationMode_Count,
     74 } BeamformerInterpolationMode;
     75 
     76 typedef enum {
     77 	BeamformerFilterKind_Kaiser       = 0,
     78 	BeamformerFilterKind_MatchedChirp = 1,
     79 	BeamformerFilterKind_Count,
     80 } BeamformerFilterKind;
     81 
     82 typedef enum {
     83 	BeamformerAcquisitionKind_FORCES         = 0,
     84 	BeamformerAcquisitionKind_UFORCES        = 1,
     85 	BeamformerAcquisitionKind_HERCULES       = 2,
     86 	BeamformerAcquisitionKind_RCA_VLS        = 3,
     87 	BeamformerAcquisitionKind_RCA_TPW        = 4,
     88 	BeamformerAcquisitionKind_UHERCULES      = 5,
     89 	BeamformerAcquisitionKind_RACES          = 6,
     90 	BeamformerAcquisitionKind_EPIC_FORCES    = 7,
     91 	BeamformerAcquisitionKind_EPIC_UFORCES   = 8,
     92 	BeamformerAcquisitionKind_EPIC_UHERCULES = 9,
     93 	BeamformerAcquisitionKind_Flash          = 10,
     94 	BeamformerAcquisitionKind_HERO_PA        = 11,
     95 	BeamformerAcquisitionKind_Count,
     96 } BeamformerAcquisitionKind;
     97 
     98 typedef enum {
     99 	BeamformerShaderKind_Decode             = 0,
    100 	BeamformerShaderKind_Filter             = 1,
    101 	BeamformerShaderKind_Demodulate         = 2,
    102 	BeamformerShaderKind_DAS                = 3,
    103 	BeamformerShaderKind_Sum                = 4,
    104 	BeamformerShaderKind_MinMax             = 5,
    105 	BeamformerShaderKind_Hilbert            = 6,
    106 	BeamformerShaderKind_CoherencyWeighting = 7,
    107 	BeamformerShaderKind_Reshape            = 8,
    108 	BeamformerShaderKind_BufferClear        = 9,
    109 	BeamformerShaderKind_RenderBeamformed   = 10,
    110 	BeamformerShaderKind_Count,
    111 
    112 	BeamformerShaderKind_ComputeFirst         = BeamformerShaderKind_Decode,
    113 	BeamformerShaderKind_ComputeLast          = BeamformerShaderKind_Hilbert,
    114 	BeamformerShaderKind_ComputeCount         = 7,
    115 	BeamformerShaderKind_ComputeHelpersFirst  = BeamformerShaderKind_CoherencyWeighting,
    116 	BeamformerShaderKind_ComputeHelpersLast   = BeamformerShaderKind_Reshape,
    117 	BeamformerShaderKind_ComputeHelpersCount  = 2,
    118 	BeamformerShaderKind_ComputeInternalFirst = BeamformerShaderKind_BufferClear,
    119 	BeamformerShaderKind_ComputeInternalLast  = BeamformerShaderKind_BufferClear,
    120 	BeamformerShaderKind_ComputeInternalCount = 1,
    121 	BeamformerShaderKind_RenderFirst          = BeamformerShaderKind_RenderBeamformed,
    122 	BeamformerShaderKind_RenderLast           = BeamformerShaderKind_RenderBeamformed,
    123 	BeamformerShaderKind_RenderCount          = 1,
    124 } BeamformerShaderKind;
    125 
    126 typedef struct {
    127 	b32 use_shared_memory;
    128 	u32 decode_mode;
    129 	u32 output_channel_stride;
    130 	u32 output_sample_stride;
    131 	u32 output_transmit_stride;
    132 	u32 to_process;
    133 	u32 transmit_count;
    134 	u32 chunk_channel_count;
    135 	b32 cooperative_matrix;
    136 	u32 cooperative_matrix_m;
    137 	u32 cooperative_matrix_n;
    138 	u32 cooperative_matrix_k;
    139 } BeamformerDecodeBakeParameters;
    140 
    141 typedef struct {
    142 	u32 demodulate;
    143 	u32 complex_filter;
    144 	u32 decimation_rate;
    145 	u32 filter_length;
    146 	u32 input_channel_stride;
    147 	u32 input_sample_stride;
    148 	u32 input_transmit_stride;
    149 	u32 output_channel_stride;
    150 	u32 output_sample_stride;
    151 	u32 output_transmit_stride;
    152 	u32 sample_count;
    153 	u32 batch_sample_count;
    154 	f32 demodulation_frequency;
    155 	f32 sampling_frequency;
    156 } BeamformerFilterBakeParameters;
    157 
    158 typedef struct {
    159 	u32 coherency_weighting;
    160 	u32 single_focus;
    161 	u32 single_orientation;
    162 	u32 sparse;
    163 	u32 acquisition_count;
    164 	u32 acquisition_kind;
    165 	u32 channel_count;
    166 	u32 chunk_channel_count;
    167 	u32 interpolation_mode;
    168 	u32 sample_count;
    169 	u32 transmit_receive_orientation;
    170 	f32 demodulation_frequency;
    171 	f32 f_number;
    172 	f32 focus_depth;
    173 	f32 sampling_frequency;
    174 	f32 speed_of_sound;
    175 	f32 time_offset;
    176 	f32 transmit_angle;
    177 } BeamformerDASBakeParameters;
    178 
    179 typedef struct {
    180 	u32 size_x;
    181 	u32 size_y;
    182 	u32 size_z;
    183 	u32 input_stride_x;
    184 	u32 input_stride_y;
    185 	u32 input_stride_z;
    186 	u32 output_stride_x;
    187 	u32 output_stride_y;
    188 	u32 output_stride_z;
    189 	b32 interleave;
    190 	b32 deinterleave;
    191 } BeamformerReshapeBakeParameters;
    192 
    193 typedef struct {
    194 	u64 hadamard_buffer;
    195 	u64 rf_buffer;
    196 	u64 output_buffer;
    197 } BeamformerDecodePushConstants;
    198 
    199 typedef struct {
    200 	u64 input_data;
    201 	u64 filter_coefficients;
    202 	u32 output_element_offset;
    203 } BeamformerFilterPushConstants;
    204 
    205 typedef struct {
    206 	m4  xdc_transform;
    207 	m4  voxel_transform;
    208 	v2  xdc_element_pitch;
    209 	u64 array_parameters;
    210 	u64 output_frame;
    211 	u64 incoherent_frame;
    212 	u32 rf_element_offset;
    213 	u32 output_size_x;
    214 	u32 output_size_y;
    215 	u32 output_size_z;
    216 	u32 cycle_t;
    217 	i32 channel_offset;
    218 } BeamformerDASPushConstants;
    219 
    220 typedef struct {
    221 	u64 output_data;
    222 	u64 input_data;
    223 	u32 image_elements;
    224 	f32 scale;
    225 } BeamformerSumPushConstants;
    226 
    227 typedef struct {
    228 	u64 left_side_buffer;
    229 	u64 right_side_buffer;
    230 	f32 scale;
    231 	u32 output_size_x;
    232 	u32 output_size_y;
    233 	u32 output_size_z;
    234 } BeamformerCoherencyWeightingPushConstants;
    235 
    236 typedef struct {
    237 	u64 output_buffer;
    238 	u64 left_input_buffer;
    239 	u64 right_input_buffer;
    240 } BeamformerReshapePushConstants;
    241 
    242 typedef struct {
    243 	uv4 clear_v4;
    244 	u64 data;
    245 	u32 bins;
    246 } BeamformerBufferClearPushConstants;
    247 
    248 typedef struct {
    249 	m4  mvp_matrix;
    250 	u64 positions;
    251 	u64 normals;
    252 	v4  bounding_box_colour;
    253 	f32 bounding_box_fraction;
    254 	f32 db_cutoff;
    255 	f32 threshold;
    256 	f32 gamma;
    257 	u64 input_data;
    258 	u32 input_size_x;
    259 	u32 input_size_y;
    260 	u32 input_size_z;
    261 	u32 data_kind;
    262 } BeamformerRenderBeamformedPushConstants;
    263 
    264 typedef struct {
    265 	f32 cycles;
    266 	f32 frequency;
    267 } BeamformerSineParameters;
    268 
    269 typedef struct {
    270 	f32 duration;
    271 	f32 min_frequency;
    272 	f32 max_frequency;
    273 } BeamformerChirpParameters;
    274 
    275 typedef struct {
    276 	BeamformerEmissionKind kind;
    277 	union {
    278 		BeamformerSineParameters  sine;
    279 		BeamformerChirpParameters chirp;
    280 	};
    281 } BeamformerEmissionParameters;
    282 
    283 typedef struct {
    284 	f32 cutoff_frequency;
    285 	f32 beta;
    286 	u32 length;
    287 } BeamformerKaiserFilterParameters;
    288 
    289 typedef struct {
    290 	f32 duration;
    291 	f32 min_frequency;
    292 	f32 max_frequency;
    293 } BeamformerMatchedChirpFilterParameters;
    294 
    295 typedef struct {
    296 	BeamformerFilterKind kind;
    297 	f32                  sampling_frequency;
    298 	b32                  complex;
    299 	union {
    300 		BeamformerKaiserFilterParameters       kaiser;
    301 		BeamformerMatchedChirpFilterParameters matched_chirp;
    302 	};
    303 } BeamformerFilterParameters;
    304 
    305 typedef struct {
    306 	m4                        das_voxel_transform;
    307 	m4                        xdc_transform;
    308 	v2                        xdc_element_pitch;
    309 	uv2                       raw_data_dimensions;
    310 	v2                        focal_vector;
    311 	u32                       transmit_receive_orientation;
    312 	u32                       sample_count;
    313 	u32                       channel_count;
    314 	u32                       acquisition_count;
    315 	BeamformerAcquisitionKind acquisition_kind;
    316 	BeamformerDecodeMode      decode_mode;
    317 	BeamformerSamplingMode    sampling_mode;
    318 	f32                       time_offset;
    319 	b32                       single_focus;
    320 	b32                       single_orientation;
    321 } BeamformerParametersHead;
    322 
    323 typedef struct {
    324 	iv4                         output_points;
    325 	f32                         sampling_frequency;
    326 	f32                         demodulation_frequency;
    327 	f32                         speed_of_sound;
    328 	f32                         f_number;
    329 	BeamformerInterpolationMode interpolation_mode;
    330 	b32                         coherency_weighting;
    331 	u32                         decimation_rate;
    332 } BeamformerUIParameters;
    333 
    334 typedef struct {
    335 	BeamformerContrastMode       contrast_mode;
    336 	BeamformerEmissionParameters emission_parameters;
    337 } BeamformerExtraParameters;
    338 
    339 typedef struct {
    340 	m4                           das_voxel_transform;
    341 	m4                           xdc_transform;
    342 	v2                           xdc_element_pitch;
    343 	uv2                          raw_data_dimensions;
    344 	v2                           focal_vector;
    345 	u32                          transmit_receive_orientation;
    346 	u32                          sample_count;
    347 	u32                          channel_count;
    348 	u32                          acquisition_count;
    349 	BeamformerAcquisitionKind    acquisition_kind;
    350 	BeamformerDecodeMode         decode_mode;
    351 	BeamformerSamplingMode       sampling_mode;
    352 	f32                          time_offset;
    353 	b32                          single_focus;
    354 	b32                          single_orientation;
    355 	iv4                          output_points;
    356 	f32                          sampling_frequency;
    357 	f32                          demodulation_frequency;
    358 	f32                          speed_of_sound;
    359 	f32                          f_number;
    360 	BeamformerInterpolationMode  interpolation_mode;
    361 	b32                          coherency_weighting;
    362 	u32                          decimation_rate;
    363 	BeamformerContrastMode       contrast_mode;
    364 	BeamformerEmissionParameters emission_parameters;
    365 } BeamformerParameters;
    366 
    367 typedef struct {
    368 	m4                           das_voxel_transform;
    369 	m4                           xdc_transform;
    370 	v2                           xdc_element_pitch;
    371 	uv2                          raw_data_dimensions;
    372 	v2                           focal_vector;
    373 	u32                          transmit_receive_orientation;
    374 	u32                          sample_count;
    375 	u32                          channel_count;
    376 	u32                          acquisition_count;
    377 	BeamformerAcquisitionKind    acquisition_kind;
    378 	BeamformerDecodeMode         decode_mode;
    379 	BeamformerSamplingMode       sampling_mode;
    380 	f32                          time_offset;
    381 	b32                          single_focus;
    382 	b32                          single_orientation;
    383 	iv4                          output_points;
    384 	f32                          sampling_frequency;
    385 	f32                          demodulation_frequency;
    386 	f32                          speed_of_sound;
    387 	f32                          f_number;
    388 	BeamformerInterpolationMode  interpolation_mode;
    389 	b32                          coherency_weighting;
    390 	u32                          decimation_rate;
    391 	BeamformerContrastMode       contrast_mode;
    392 	BeamformerEmissionParameters emission_parameters;
    393 	i16                          channel_mapping[BeamformerMaxChannelCount];
    394 	i16                          sparse_elements[BeamformerMaxEmissionsCount];
    395 	u8                           transmit_receive_orientations[BeamformerMaxEmissionsCount];
    396 	f32                          steering_angles[BeamformerMaxEmissionsCount];
    397 	f32                          focal_depths[BeamformerMaxEmissionsCount];
    398 	i32                          compute_stages[BeamformerMaxComputeShaderStages];
    399 	i32                          compute_stage_parameters[BeamformerMaxComputeShaderStages];
    400 	u32                          compute_stages_count;
    401 	BeamformerDataKind           data_kind;
    402 } BeamformerSimpleParameters;
    403 
    404 typedef struct {
    405 	v2  focal_vectors[BeamformerMaxChannelCount];
    406 	i16 sparse_elements[BeamformerMaxChannelCount];
    407 	u16 transmit_receive_orientations[BeamformerMaxChannelCount];
    408 } BeamformerDASArrayParameters;
    409 
    410 typedef union {
    411 	BeamformerDecodeBakeParameters  Decode;
    412 	BeamformerFilterBakeParameters  Filter;
    413 	BeamformerDASBakeParameters     DAS;
    414 	BeamformerReshapeBakeParameters Reshape;
    415 } BeamformerShaderBakeParameters;
    416 
    417 read_only global u8 beamformer_data_kind_element_size[] = {
    418 	2,
    419 	2,
    420 	4,
    421 	4,
    422 	2,
    423 	2,
    424 };
    425 
    426 read_only global u8 beamformer_data_kind_element_count[] = {
    427 	1,
    428 	2,
    429 	1,
    430 	2,
    431 	1,
    432 	2,
    433 };
    434 
    435 read_only global u8 beamformer_data_kind_byte_size[] = {
    436 	2 * 1,
    437 	2 * 2,
    438 	4 * 1,
    439 	4 * 2,
    440 	2 * 1,
    441 	2 * 2,
    442 };
    443 
    444 read_only global b8 beamformer_data_kind_complex[] = {
    445 	0,
    446 	1,
    447 	0,
    448 	1,
    449 	0,
    450 	1,
    451 };
    452 
    453 read_only global s8 beamformer_data_kind_glsl_type[] = {
    454 	s8_comp("int16_t"),
    455 	s8_comp("i16vec2"),
    456 	s8_comp("float32_t"),
    457 	s8_comp("f32vec2"),
    458 	s8_comp("float16_t"),
    459 	s8_comp("f16vec2"),
    460 };
    461 
    462 read_only global s8 beamformer_data_kind_s8[] = {
    463 	s8_comp("Int16"),
    464 	s8_comp("Int16Complex"),
    465 	s8_comp("Float32"),
    466 	s8_comp("Float32Complex"),
    467 	s8_comp("Float16"),
    468 	s8_comp("Float16Complex"),
    469 };
    470 
    471 read_only global u8 beamformer_contrast_mode_samples[] = {
    472 	1,
    473 	3,
    474 };
    475 
    476 read_only global u8 beamformer_acquisition_kind_has_fixed_transmits[] = {
    477 	1,
    478 	0,
    479 	1,
    480 	0,
    481 	0,
    482 	0,
    483 	1,
    484 	1,
    485 	0,
    486 	0,
    487 	0,
    488 	0,
    489 };
    490 
    491 read_only global s8 beamformer_acquisition_kind_strings[] = {
    492 	s8_comp("FORCES"),
    493 	s8_comp("UFORCES"),
    494 	s8_comp("HERCULES"),
    495 	s8_comp("VLS"),
    496 	s8_comp("TPW"),
    497 	s8_comp("UHERCULES"),
    498 	s8_comp("RACES"),
    499 	s8_comp("EPIC-FORCES"),
    500 	s8_comp("EPIC-UFORCES"),
    501 	s8_comp("EPIC-UHERCULES"),
    502 	s8_comp("Flash"),
    503 	s8_comp("HERO-PA"),
    504 };
    505 
    506 read_only global s8 beamformer_filter_kind_strings[] = {
    507 	s8_comp("Kaiser"),
    508 	s8_comp("MatchedChirp"),
    509 };
    510 
    511 read_only global s8 beamformer_interpolation_mode_strings[] = {
    512 	s8_comp("Nearest"),
    513 	s8_comp("Linear"),
    514 	s8_comp("Cubic"),
    515 };
    516 
    517 read_only global s8 beamformer_shader_resource_kind_strings[] = {
    518 	s8_comp("Buffer"),
    519 };
    520 
    521 read_only global s8 game_shader_buffer_slot_strings[] = {
    522 	s8_comp("BeamformedData"),
    523 	s8_comp("PingPong"),
    524 };
    525 
    526 read_only global s8 beamformer_shader_names[] = {
    527 	s8_comp("Decode"),
    528 	s8_comp("Filter"),
    529 	s8_comp("Demodulate"),
    530 	s8_comp("DAS"),
    531 	s8_comp("Sum"),
    532 	s8_comp("MinMax"),
    533 	s8_comp("Hilbert"),
    534 	s8_comp("CoherencyWeighting"),
    535 	s8_comp("Reshape"),
    536 	s8_comp("BufferClear"),
    537 	s8_comp("RenderBeamformed"),
    538 };
    539 
    540 read_only global BeamformerShaderKind beamformer_reloadable_shader_kinds[] = {
    541 	BeamformerShaderKind_Decode,
    542 	BeamformerShaderKind_Filter,
    543 	BeamformerShaderKind_DAS,
    544 	BeamformerShaderKind_Sum,
    545 	BeamformerShaderKind_MinMax,
    546 	BeamformerShaderKind_CoherencyWeighting,
    547 	BeamformerShaderKind_Reshape,
    548 	BeamformerShaderKind_BufferClear,
    549 	BeamformerShaderKind_RenderBeamformed,
    550 };
    551 
    552 read_only global s8 *beamformer_reloadable_shader_files[] = {
    553 	(s8 []){s8_comp("decode.glsl")},
    554 	(s8 []){s8_comp("filter.glsl")},
    555 	(s8 []){s8_comp("das.glsl")},
    556 	(s8 []){s8_comp("sum.glsl")},
    557 	(s8 []){s8_comp("min_max.glsl")},
    558 	(s8 []){s8_comp("coherency_weighting.glsl")},
    559 	(s8 []){s8_comp("reshape.glsl")},
    560 	(s8 []){s8_comp("buffer_clear.glsl")},
    561 	(s8 []){s8_comp("render_3d.vert.glsl"), s8_comp("render_3d.frag.glsl")},
    562 };
    563 
    564 read_only global i32 beamformer_shader_reloadable_index_by_shader[] = {
    565 	0,
    566 	1,
    567 	1,
    568 	2,
    569 	3,
    570 	4,
    571 	-1,
    572 	5,
    573 	6,
    574 	7,
    575 	8,
    576 };
    577 
    578 read_only global i32 beamformer_reloadable_compute_shader_info_indices[] = {
    579 	0,
    580 	1,
    581 	2,
    582 	3,
    583 	4,
    584 };
    585 
    586 read_only global i32 beamformer_reloadable_compute_helpers_shader_info_indices[] = {
    587 	5,
    588 	6,
    589 };
    590 
    591 read_only global i32 beamformer_reloadable_compute_internal_shader_info_indices[] = {
    592 	7,
    593 };
    594 
    595 read_only global i32 beamformer_reloadable_render_shader_info_indices[] = {
    596 	8,
    597 };
    598 
    599 read_only global s8 beamformer_shader_global_header_strings[] = {
    600 	s8_comp(""
    601 	"#define DecodeMode_None     0\n"
    602 	"#define DecodeMode_Hadamard 1\n"
    603 	"\n"),
    604 	s8_comp(""
    605 	"layout(push_constant, std430) uniform PushConstants {\n"
    606 	"  uint64_t hadamard_buffer;\n"
    607 	"  uint64_t rf_buffer;\n"
    608 	"  uint64_t output_buffer;\n"
    609 	"};\n"
    610 	"\n"),
    611 	s8_comp(""
    612 	"#define ShaderBufferSlot_BeamformedData 0\n"
    613 	"#define ShaderBufferSlot_PingPong       1\n"
    614 	"\n"),
    615 	s8_comp(""
    616 	"#define ShaderResourceKind_Buffer 0\n"
    617 	"\n"),
    618 	s8_comp(""
    619 	"layout(push_constant, std430) uniform PushConstants {\n"
    620 	"  uint64_t input_data;\n"
    621 	"  uint64_t filter_coefficients;\n"
    622 	"  uint32_t output_element_offset;\n"
    623 	"};\n"
    624 	"\n"),
    625 	s8_comp("#define MaxChannelCount (256)\n\n"),
    626 	s8_comp(""
    627 	"#define AcquisitionKind_FORCES         0\n"
    628 	"#define AcquisitionKind_UFORCES        1\n"
    629 	"#define AcquisitionKind_HERCULES       2\n"
    630 	"#define AcquisitionKind_RCA_VLS        3\n"
    631 	"#define AcquisitionKind_RCA_TPW        4\n"
    632 	"#define AcquisitionKind_UHERCULES      5\n"
    633 	"#define AcquisitionKind_RACES          6\n"
    634 	"#define AcquisitionKind_EPIC_FORCES    7\n"
    635 	"#define AcquisitionKind_EPIC_UFORCES   8\n"
    636 	"#define AcquisitionKind_EPIC_UHERCULES 9\n"
    637 	"#define AcquisitionKind_Flash          10\n"
    638 	"#define AcquisitionKind_HERO_PA        11\n"
    639 	"\n"),
    640 	s8_comp(""
    641 	"#define InterpolationMode_Nearest 0\n"
    642 	"#define InterpolationMode_Linear  1\n"
    643 	"#define InterpolationMode_Cubic   2\n"
    644 	"\n"),
    645 	s8_comp(""
    646 	"#define RCAOrientation_None    0\n"
    647 	"#define RCAOrientation_Rows    1\n"
    648 	"#define RCAOrientation_Columns 2\n"
    649 	"\n"),
    650 	s8_comp(""
    651 	"struct DASArrayParameters {\n"
    652 	"  f32vec2  focal_vectors[MaxChannelCount];\n"
    653 	"  int16_t  sparse_elements[MaxChannelCount];\n"
    654 	"  uint16_t transmit_receive_orientations[MaxChannelCount];\n"
    655 	"};\n"
    656 	"\n"),
    657 	s8_comp(""
    658 	"layout(push_constant, std430) uniform PushConstants {\n"
    659 	"  f32mat4  xdc_transform;\n"
    660 	"  f32mat4  voxel_transform;\n"
    661 	"  f32vec2  xdc_element_pitch;\n"
    662 	"  uint64_t array_parameters;\n"
    663 	"  uint64_t output_frame;\n"
    664 	"  uint64_t incoherent_frame;\n"
    665 	"  uint32_t rf_element_offset;\n"
    666 	"  uint32_t output_size_x;\n"
    667 	"  uint32_t output_size_y;\n"
    668 	"  uint32_t output_size_z;\n"
    669 	"  uint32_t cycle_t;\n"
    670 	"  int32_t  channel_offset;\n"
    671 	"};\n"
    672 	"\n"),
    673 	s8_comp(""
    674 	"layout(push_constant, std430) uniform PushConstants {\n"
    675 	"  uint64_t  output_data;\n"
    676 	"  uint64_t  input_data;\n"
    677 	"  uint32_t  image_elements;\n"
    678 	"  float32_t scale;\n"
    679 	"};\n"
    680 	"\n"),
    681 	s8_comp(""
    682 	"layout(push_constant, std430) uniform PushConstants {\n"
    683 	"  uint64_t  left_side_buffer;\n"
    684 	"  uint64_t  right_side_buffer;\n"
    685 	"  float32_t scale;\n"
    686 	"  uint32_t  output_size_x;\n"
    687 	"  uint32_t  output_size_y;\n"
    688 	"  uint32_t  output_size_z;\n"
    689 	"};\n"
    690 	"\n"),
    691 	s8_comp(""
    692 	"layout(push_constant, std430) uniform PushConstants {\n"
    693 	"  uint64_t output_buffer;\n"
    694 	"  uint64_t left_input_buffer;\n"
    695 	"  uint64_t right_input_buffer;\n"
    696 	"};\n"
    697 	"\n"),
    698 	s8_comp(""
    699 	"layout(push_constant, std430) uniform PushConstants {\n"
    700 	"  u32vec4  clear_v4;\n"
    701 	"  uint64_t data;\n"
    702 	"  uint32_t bins;\n"
    703 	"};\n"
    704 	"\n"),
    705 	s8_comp(""
    706 	"layout(push_constant, std430) uniform PushConstants {\n"
    707 	"  f32mat4   mvp_matrix;\n"
    708 	"  uint64_t  positions;\n"
    709 	"  uint64_t  normals;\n"
    710 	"  f32vec4   bounding_box_colour;\n"
    711 	"  float32_t bounding_box_fraction;\n"
    712 	"  float32_t db_cutoff;\n"
    713 	"  float32_t threshold;\n"
    714 	"  float32_t gamma;\n"
    715 	"  uint64_t  input_data;\n"
    716 	"  uint32_t  input_size_x;\n"
    717 	"  uint32_t  input_size_y;\n"
    718 	"  uint32_t  input_size_z;\n"
    719 	"  uint32_t  data_kind;\n"
    720 	"};\n"
    721 	"\n"),
    722 };
    723 
    724 read_only global b8 beamformer_shader_has_primitive[] = {
    725 	0,
    726 	0,
    727 	0,
    728 	0,
    729 	0,
    730 	0,
    731 	0,
    732 	0,
    733 	1,
    734 };
    735 
    736 read_only global b8 beamformer_shader_primitive_is_vertex[] = {
    737 	0,
    738 	0,
    739 	0,
    740 	0,
    741 	0,
    742 	0,
    743 	0,
    744 	0,
    745 	1,
    746 };
    747 
    748 read_only global i32 *beamformer_shader_header_vectors[] = {
    749 	(i32 []){0, 1},
    750 	(i32 []){2, 3, 4},
    751 	(i32 []){5, 6, 7, 8, 2, 3, 9, 10},
    752 	(i32 []){11},
    753 	0,
    754 	(i32 []){12},
    755 	(i32 []){13},
    756 	(i32 []){14},
    757 	(i32 []){15},
    758 };
    759 
    760 read_only global i32 beamformer_shader_header_vector_lengths[] = {
    761 	2,
    762 	3,
    763 	8,
    764 	1,
    765 	0,
    766 	1,
    767 	1,
    768 	1,
    769 	1,
    770 };
    771 
    772 read_only global s8 *beamformer_shader_bake_parameter_names[] = {
    773 	(s8 []){
    774 		s8_comp("UseSharedMemory"),
    775 		s8_comp("DecodeMode"),
    776 		s8_comp("OutputChannelStride"),
    777 		s8_comp("OutputSampleStride"),
    778 		s8_comp("OutputTransmitStride"),
    779 		s8_comp("ToProcess"),
    780 		s8_comp("TransmitCount"),
    781 		s8_comp("ChunkChannelCount"),
    782 		s8_comp("CooperativeMatrix"),
    783 		s8_comp("CooperativeMatrixM"),
    784 		s8_comp("CooperativeMatrixN"),
    785 		s8_comp("CooperativeMatrixK"),
    786 	},
    787 	(s8 []){
    788 		s8_comp("Demodulate"),
    789 		s8_comp("ComplexFilter"),
    790 		s8_comp("DecimationRate"),
    791 		s8_comp("FilterLength"),
    792 		s8_comp("InputChannelStride"),
    793 		s8_comp("InputSampleStride"),
    794 		s8_comp("InputTransmitStride"),
    795 		s8_comp("OutputChannelStride"),
    796 		s8_comp("OutputSampleStride"),
    797 		s8_comp("OutputTransmitStride"),
    798 		s8_comp("SampleCount"),
    799 		s8_comp("BatchSampleCount"),
    800 		s8_comp("DemodulationFrequency"),
    801 		s8_comp("SamplingFrequency"),
    802 	},
    803 	(s8 []){
    804 		s8_comp("CoherencyWeighting"),
    805 		s8_comp("SingleFocus"),
    806 		s8_comp("SingleOrientation"),
    807 		s8_comp("Sparse"),
    808 		s8_comp("AcquisitionCount"),
    809 		s8_comp("AcquisitionKind"),
    810 		s8_comp("ChannelCount"),
    811 		s8_comp("ChunkChannelCount"),
    812 		s8_comp("InterpolationMode"),
    813 		s8_comp("SampleCount"),
    814 		s8_comp("TransmitReceiveOrientation"),
    815 		s8_comp("DemodulationFrequency"),
    816 		s8_comp("FNumber"),
    817 		s8_comp("FocusDepth"),
    818 		s8_comp("SamplingFrequency"),
    819 		s8_comp("SpeedOfSound"),
    820 		s8_comp("TimeOffset"),
    821 		s8_comp("TransmitAngle"),
    822 	},
    823 	0,
    824 	0,
    825 	0,
    826 	(s8 []){
    827 		s8_comp("SizeX"),
    828 		s8_comp("SizeY"),
    829 		s8_comp("SizeZ"),
    830 		s8_comp("InputStrideX"),
    831 		s8_comp("InputStrideY"),
    832 		s8_comp("InputStrideZ"),
    833 		s8_comp("OutputStrideX"),
    834 		s8_comp("OutputStrideY"),
    835 		s8_comp("OutputStrideZ"),
    836 		s8_comp("Interleave"),
    837 		s8_comp("Deinterleave"),
    838 	},
    839 	0,
    840 	0,
    841 };
    842 
    843 read_only global u32 beamformer_shader_bake_parameter_float_bits[] = {
    844 	0x00000000UL,
    845 	0x00003000UL,
    846 	0x0003f800UL,
    847 	0x00000000UL,
    848 	0x00000000UL,
    849 	0x00000000UL,
    850 	0x00000000UL,
    851 	0x00000000UL,
    852 	0x00000000UL,
    853 };
    854 
    855 read_only global u8 beamformer_shader_bake_parameter_counts[] = {
    856 	12,
    857 	14,
    858 	18,
    859 	0,
    860 	0,
    861 	0,
    862 	11,
    863 	0,
    864 	0,
    865 };
    866 
    867 read_only global u8 beamformer_shader_push_constant_sizes[] = {
    868 	sizeof(BeamformerDecodePushConstants),
    869 	sizeof(BeamformerFilterPushConstants),
    870 	sizeof(BeamformerDASPushConstants),
    871 	sizeof(BeamformerSumPushConstants),
    872 	0,
    873 	sizeof(BeamformerCoherencyWeightingPushConstants),
    874 	sizeof(BeamformerReshapePushConstants),
    875 	sizeof(BeamformerBufferClearPushConstants),
    876 	sizeof(BeamformerRenderBeamformedPushConstants),
    877 };
    878