summaryrefslogtreecommitdiff
path: root/src/renderer/ral.h
diff options
context:
space:
mode:
authorOmniscient <omniscient.oce@gmail.com>2024-06-09 11:42:17 +1000
committerOmniscient <omniscient.oce@gmail.com>2024-06-09 11:42:17 +1000
commit64830ce51a185091f54c2b42b365110d89d44f1b (patch)
tree644c4a4425c2003a649cf02af33af488cb56a148 /src/renderer/ral.h
parent859ea7e23d2bbbc4b32b43727ae50aebe399e720 (diff)
triangle on opengl works again. happy days
Diffstat (limited to 'src/renderer/ral.h')
-rw-r--r--src/renderer/ral.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/renderer/ral.h b/src/renderer/ral.h
index 3415b04..067847b 100644
--- a/src/renderer/ral.h
+++ b/src/renderer/ral.h
@@ -44,6 +44,10 @@ TYPED_POOL(gpu_pipeline_layout, pipeline_layout);
TYPED_POOL(gpu_pipeline, pipeline);
TYPED_POOL(gpu_renderpass, renderpass);
+// --- Handy macros
+#define BUFFER_GET(h) (buffer_pool_get(&context.resource_pools->buffers, h))
+#define TEXTURE_GET(h) (texture_pool_get(&context.resource_pools->textures, h))
+
// --- Pools
typedef struct gpu_backend_pools {
pipeline_pool pipelines;
@@ -69,7 +73,7 @@ typedef struct shader_desc {
str8 filepath; // Where it came from
str8 code; // Either GLSL or SPIRV bytecode
bool is_spirv;
- bool is_combined_vert_frag; // Contains both vertex and fragment stages
+ bool is_combined_vert_frag; // Contains both vertex and fragment stages
} shader_desc;
struct graphics_pipeline_desc {
@@ -149,7 +153,7 @@ void encode_set_default_settings(gpu_cmd_encoder* encoder);
void encode_set_vertex_buffer(gpu_cmd_encoder* encoder, buffer_handle buf);
void encode_set_index_buffer(gpu_cmd_encoder* encoder, buffer_handle buf);
void encode_set_bind_group(); // TODO
-void encode_draw(gpu_cmd_encoder* encoder);
+void encode_draw(gpu_cmd_encoder* encoder, u64 count);
void encode_draw_indexed(gpu_cmd_encoder* encoder, u64 index_count);
void encode_clear_buffer(gpu_cmd_encoder* encoder, buffer_handle buf);
@@ -182,3 +186,4 @@ void gpu_temp_draw(size_t n_verts);
// --- Helpers
vertex_description static_3d_vertex_description();
+size_t vertex_attrib_size(vertex_attrib_type attr);