From 55b21ca1537a0459f5ed11ad92077bfa2a76fbaa Mon Sep 17 00:00:00 2001 From: quou Date: Thu, 26 Dec 2024 17:54:40 +1100 Subject: allow manually creating vertex formats --- video.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'video.hpp') diff --git a/video.hpp b/video.hpp index 658e37a..3e01ab9 100644 --- a/video.hpp +++ b/video.hpp @@ -5,6 +5,7 @@ #include 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); -- cgit v1.2.3-54-g00ecf