summaryrefslogtreecommitdiff
path: root/video.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'video.hpp')
-rw-r--r--video.hpp30
1 files changed, 17 insertions, 13 deletions
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