summaryrefslogtreecommitdiff
path: root/video.hpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-12-26 17:54:40 +1100
committerquou <quou@disroot.org>2024-12-26 17:54:40 +1100
commit55b21ca1537a0459f5ed11ad92077bfa2a76fbaa (patch)
tree2022a1ce62fad8e4ea21f1835de4fb77d7895453 /video.hpp
parentb2ece42822225fd67a1286a2ef51f7b76c634255 (diff)
allow manually creating vertex formats
Diffstat (limited to 'video.hpp')
-rw-r--r--video.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/video.hpp b/video.hpp
index 658e37a..3e01ab9 100644
--- a/video.hpp
+++ b/video.hpp
@@ -5,6 +5,7 @@
#include <stdint.h>
extern "C" {
+#include "sc/sh_enums.h"
#include "vid_enums.h"
}
@@ -214,6 +215,24 @@ struct Sampler_State {
bool aniso;
};
+struct Vertex_Format_Desc {
+ struct Binding {
+ int binding;
+ int stride;
+ SBinding_Rate rate;
+ };
+ struct Attribute {
+ int binding;
+ int index;
+ int offset;
+ SVariable_Type type;
+ };
+ Binding* bindings;
+ Attribute* attributes;
+ int binding_count;
+ int attribute_count;
+};
+
struct Context;
struct Shader;
struct Device {
@@ -243,6 +262,11 @@ struct Device {
Buffer& get_buffer(Buffer_Id id);
void destroy_buffer(Buffer_Id id);
+ Vertex_Format_Id create_vertex_format(
+ const Vertex_Format_Desc& desc
+ );
+ void destroy_vertex_format(Vertex_Format_Id fmt);
+
Shader& get_shader(Shader_Id id);
Sampler_Id create_sampler(const Sampler_State& state);