From b293168cc158d65f1a5146f155921ff82119d1bc Mon Sep 17 00:00:00 2001 From: quou Date: Mon, 23 Dec 2024 14:41:01 +1100 Subject: Texture conversion and loading --- video.hpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'video.hpp') diff --git a/video.hpp b/video.hpp index 786d013..f05af57 100644 --- a/video.hpp +++ b/video.hpp @@ -96,7 +96,15 @@ struct Pipeline_Builder { void validate(); }; -struct Texture { +enum Resource_State { + undefined, + copy_dst, + copy_src, + shader_read +}; + +struct Texture : public Asset { + Texture_Id id; int w, h; bool alias; }; @@ -114,7 +122,9 @@ namespace Buffer_Flags { }; }; -struct Buffer {}; +struct Buffer { + Buffer_Id id; +}; struct Context; struct Shader; @@ -149,21 +159,22 @@ struct Device { }; struct Context { - void wait(Device& d); + void wait(); void submit( - Device& d, const Draw& draw, const Pipeline& p, const Render_Pass& rp ); void submit( - Device& d, const Draw* draws, int count, const Pipeline& p, const Render_Pass& rp ); - void submit(Device& d, const Render_Pass& rp); + void submit(const Render_Pass& rp); + void copy(Buffer_Id dst, Buffer_Id src); + void copy(Texture_Id dst, Buffer_Id src); + void transition(Texture_Id id, Resource_State state); }; struct Shader : public Asset { @@ -175,13 +186,6 @@ struct Shader : public Asset { int binding_index(const char* name); int attribute_index(const char* name); int target_index(const char* name); - - bool load( - Asset_Loader* loader, - Arena* a, - Pack_File* f - ) override; - void unload(Asset_Loader* loader) override; }; #endif -- cgit v1.2.3-54-g00ecf