aboutsummaryrefslogtreecommitdiffstats
path: root/api-proto.txt
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2023-01-12 00:47:59 +0100
committerladevieq <ladevie.quentin@gmail.com>2023-01-12 00:47:59 +0100
commit5e3bb454d50091e581d5d1d03af34e38277694b3 (patch)
tree06eada2111afb56a24d0ced89685587400041c8d /api-proto.txt
parentb47e177898657e435cb5bc913a4a783fddbe1f3d (diff)
WIP new rendering api
Diffstat (limited to 'api-proto.txt')
-rw-r--r--api-proto.txt29
1 files changed, 13 insertions, 16 deletions
diff --git a/api-proto.txt b/api-proto.txt
index 751f390..a8ca1ff 100644
--- a/api-proto.txt
+++ b/api-proto.txt
@@ -4,19 +4,18 @@ enum CMD_BUF_TYPE {
ASYNC_COMPUTE,
}
-class command_buffer {
+class device_command_buffer {
void start();
void stop();
VkCommandBuffer handle;
- queue owner;
}
-class graphics_command_buffer : command_buffer {
+class graphics_device_command_buffer : device_command_buffer {
void image_barrier(handle tex, State new_state) {
texture = rm::get_texture(tex);
- cmd.barrier(texture.img.device_image, texture.current_state, new_state);
+ vkCmdBarrier(texture.img.device_image, texture.current_state, new_state, handle);
texture.current_state = new_state;
}
@@ -35,7 +34,7 @@ class device_buffer {
VkDeviceAddr gpu_address;
}
-class device_image {
+class device_texture {
VkImage handle;
VmaAllocation allocation;
array<uint, max_usage> bindless_id; // TODO: Handle this in a higher level ?
@@ -46,27 +45,25 @@ class device_image {
const uint invalid_id = -1;
}
-class device_command_buffer {
- CMD_BUF_TYPE buf_type = CMD_BUF_TYPE::MAX;
- VkCommandBuffer handle;
-}
-
class global_descriptor_set {
VkDescritptorSetLayout layout;
VkDescriptorSet set;
};
class device {
- device_image create_image(TextureDesc desc) {
- img {};
- img.handle = vmaCreateImage(&img.alloc);
+ device_image create_texture(TextureDesc desc) {
+ auto tex {};
+ tex.handle = vmaCreateImage(&tex.alloc);
}
device_buffer create_buffer(BufferDesc desc);
- device_command_buffer allocate_command_buffer(uint32_t count);
+ template<typename command_buffer_type>
+ void allocate_command_buffers(command_buffer_type ptr, uint32_t count, CMD_BUF_TYPE type) {
+ vkAllocate(ptr, count, queue[type]);
+ }
- submit(span<device_command_buffer> cmd_buffers, semaphore)
+ fence submit(span<device_command_buffer> cmd_buffers, CMD_BUF_TYPE type);
wait(fence);
wait_idle();
@@ -78,7 +75,7 @@ class device {
device_swapchain sc;
- array<device_image> sc_images;
+ array<device_texture> sc_textures;
array<queue, CMD_BUF_TYPE::MAX> queues;
global_descriptor_set global_set;