kiba-engine
device.h
1 #pragma once
2 
3 #include <kiba/gpu/types.h>
4 
5 // TODO introduce device descriptor containing requirements
6 KB_API b8 gpu_device_create(gpu_device *device);
7 KB_API void gpu_device_update(gpu_device device);
8 KB_API void gpu_device_destroy(gpu_device *device);
9 
10 KB_LOCAL b8 gpu_device_resource_texture_create(gpu_device device, gpu_texture *texture);
11 KB_LOCAL void gpu_device_resource_texture_enqueue_destroy(gpu_texture texture);
12 KB_LOCAL void gpu_device_resource_texture_destroy(gpu_texture texture);
13 KB_LOCAL void gpu_device_resource_texture_release(gpu_texture texture);
14 
15 KB_LOCAL b8 gpu_device_resource_texture_view_create(gpu_device device, gpu_texture_view *view);
16 KB_LOCAL void gpu_device_resource_texture_view_enqueue_destroy(gpu_texture_view view);
17 KB_LOCAL void gpu_device_resource_texture_view_destroy(gpu_texture_view view);
18 
19 KB_LOCAL b8 gpu_device_resource_pipeline_create(gpu_device device, gpu_pipeline *pipeline);
20 KB_LOCAL void gpu_device_resource_pipeline_enqueue_destroy(gpu_pipeline pipeline);
21 KB_LOCAL void gpu_device_resource_pipeline_destroy(gpu_pipeline pipeline);
22 
23 KB_LOCAL b8 gpu_device_resource_pipeline_layout_create(gpu_device device, gpu_pipeline_layout *layout);
24 KB_LOCAL void gpu_device_resource_pipeline_layout_enqueue_destroy(gpu_pipeline_layout layout);
25 KB_LOCAL void gpu_device_resource_pipeline_layout_destroy(gpu_pipeline_layout layout);
26 
27 KB_LOCAL b8 gpu_device_resource_shader_module_create(gpu_device device, gpu_shader_module *shader);
28 KB_LOCAL void gpu_device_resource_shader_module_enqueue_destroy(gpu_shader_module shader);
29 KB_LOCAL void gpu_device_resource_shader_module_destroy(gpu_shader_module shader);
30 
31 KB_LOCAL b8 gpu_device_resource_buffer_create(gpu_device device, gpu_buffer *buffer);
32 KB_LOCAL void gpu_device_resource_buffer_enqueue_destroy(gpu_buffer buffer);
33 KB_LOCAL void gpu_device_resource_buffer_destroy(gpu_buffer buffer);
34 KB_LOCAL void gpu_device_resource_buffer_release(gpu_buffer buffer);
35 
36 KB_LOCAL b8 gpu_device_resource_command_encoder_create(gpu_device device, gpu_command_encoder *encoder);
37 KB_LOCAL void gpu_device_resource_command_encoder_enqueue_destroy(gpu_command_encoder encoder);
38 KB_LOCAL void gpu_device_resource_command_encoder_destroy(gpu_command_encoder encoder);
39 
40 KB_LOCAL b8 gpu_backend_device_create(struct gpu_backend_device *device);
41 KB_LOCAL void gpu_backend_device_finish_running_tasks(struct gpu_backend_device *device);
42 KB_LOCAL void gpu_backend_device_destroy(struct gpu_backend_device *device);