| … | 23 unchanged lines hidden |
| 24 |
24 |
|
Bind_Index_Buffer, |
| 25 |
25 |
|
Draw, |
| 26 |
26 |
|
Draw_Indexed, |
|
27 |
+ |
Create_Compute_Pipeline, |
|
28 |
+ |
Destroy_Compute_Pipeline, |
|
29 |
+ |
Bind_Compute_Pipeline, |
|
30 |
+ |
Dispatch_Compute, |
|
31 |
+ |
Compute_Barrier, |
| 27 |
32 |
|
Create_Shader, |
| 28 |
33 |
|
Destroy_Shader, |
| 29 |
34 |
|
} |
| … | 144 unchanged lines hidden |
| 174 |
179 |
|
bind_index_buffer = recording_bind_index_buffer, |
| 175 |
180 |
|
draw = recording_draw, |
| 176 |
181 |
|
draw_indexed = recording_draw_indexed, |
|
182 |
+ |
create_compute_pipeline = recording_create_compute_pipeline, |
|
183 |
+ |
destroy_compute_pipeline = recording_destroy_compute_pipeline, |
|
184 |
+ |
bind_compute_pipeline = recording_bind_compute_pipeline, |
|
185 |
+ |
dispatch_compute = recording_dispatch_compute, |
|
186 |
+ |
compute_barrier = recording_compute_barrier, |
| 177 |
187 |
|
|
| 178 |
188 |
|
create_shader_module = recording_create_shader_module, |
| 179 |
189 |
|
destroy_shader = recording_destroy_shader, |
| … | 309 unchanged lines hidden |
| 489 |
499 |
|
}) |
| 490 |
500 |
|
} |
| 491 |
501 |
|
|
|
502 |
+ |
recording_create_compute_pipeline :: proc( |
|
503 |
+ |
shader: bk.Shader_Handle, |
|
504 |
+ |
num_buffers: u32, |
|
505 |
+ |
push_constant_size: u32, |
|
506 |
+ |
) -> ( |
|
507 |
+ |
bk.Pipeline_Handle, |
|
508 |
+ |
bool, |
|
509 |
+ |
) { |
|
510 |
+ |
_ = shader |
|
511 |
+ |
_ = num_buffers |
|
512 |
+ |
_ = push_constant_size |
|
513 |
+ |
rec := recording_active |
|
514 |
+ |
if rec == nil { |
|
515 |
+ |
return bk.NULL_PIPELINE, false |
|
516 |
+ |
} |
|
517 |
+ |
handle := bk.Pipeline_Handle(rec.next_pipeline) |
|
518 |
+ |
rec.next_pipeline += 1 |
|
519 |
+ |
recording_record({kind = .Create_Compute_Pipeline, pipeline = handle}) |
|
520 |
+ |
return handle, true |
|
521 |
+ |
} |
|
522 |
+ |
|
|
523 |
+ |
recording_destroy_compute_pipeline :: proc(handle: bk.Pipeline_Handle) { |
|
524 |
+ |
recording_record({kind = .Destroy_Compute_Pipeline, pipeline = handle}) |
|
525 |
+ |
} |
|
526 |
+ |
|
|
527 |
+ |
recording_bind_compute_pipeline :: proc(ctx: bk.Frame_Context, handle: bk.Pipeline_Handle) { |
|
528 |
+ |
if recording_active != nil { |
|
529 |
+ |
recording_active.bound_pipeline = handle |
|
530 |
+ |
} |
|
531 |
+ |
recording_record({kind = .Bind_Compute_Pipeline, frame_index = ctx.frame_index, pipeline = handle}) |
|
532 |
+ |
} |
|
533 |
+ |
|
|
534 |
+ |
recording_dispatch_compute :: proc(ctx: bk.Frame_Context, groups_x, groups_y, groups_z: u32) { |
|
535 |
+ |
recording_record({ |
|
536 |
+ |
kind = .Dispatch_Compute, |
|
537 |
+ |
frame_index = ctx.frame_index, |
|
538 |
+ |
width_u = groups_x, |
|
539 |
+ |
height_u = groups_y, |
|
540 |
+ |
vertex_count = groups_z, |
|
541 |
+ |
}) |
|
542 |
+ |
} |
|
543 |
+ |
|
|
544 |
+ |
recording_compute_barrier :: proc(ctx: bk.Frame_Context) { |
|
545 |
+ |
recording_record({kind = .Compute_Barrier, frame_index = ctx.frame_index}) |
|
546 |
+ |
} |
|
547 |
+ |
|
| 492 |
548 |
|
recording_create_shader_module :: proc(desc: bk.Shader_Module_Desc) -> (bk.Shader_Handle, bool) { |
| 493 |
549 |
|
rec := recording_active |
| 494 |
550 |
|
if rec == nil { |
| … | 21 unchanged lines hidden |