]> git.cworth.org Git - vogl/blobdiff - src/voglcommon/vogl_buffer_state.h
- Features for 10ft: PBO's, snapshotting/restoring mapped buffers during replaying
[vogl] / src / voglcommon / vogl_buffer_state.h
index c018bbb60af475a5bd5da77fe6bce8a31a1d8496..ca79ba3ab3e62535fb48c6762a29ebb7bf817847 100644 (file)
@@ -34,6 +34,8 @@
 #include "vogl_blob_manager.h"
 #include "vogl_vec.h"
 
+struct vogl_mapped_buffer_desc;
+
 class vogl_buffer_state : public vogl_gl_object_state
 {
 public:
@@ -51,6 +53,8 @@ public:
 
     virtual bool snapshot(const vogl_context_info &context_info, vogl_handle_remapper &remapper, GLuint64 handle, GLenum target);
 
+    void set_mapped_buffer_snapshot_state(const vogl_mapped_buffer_desc &map_desc);
+
     virtual bool restore(const vogl_context_info &context_info, vogl_handle_remapper &remapper, GLuint64 &handle) const;
 
     virtual bool remap_handles(vogl_handle_remapper &remapper);
@@ -86,6 +90,14 @@ public:
         return m_params;
     }
 
+    // Whether or not the buffer was currently mapped when it was snapshotted. Note we don't actually support snapshotting the buffer
+    // while it's mapped (we unmap it first), this data comes from the replayer's shadow. We also don't restore it in a mapped state, that's up to the caller.
+    bool get_is_map_range() const { return m_map_range; }
+    bool get_is_mapped() const { return m_is_mapped; }
+    uint64_t get_map_ofs() const { return m_map_ofs; }
+    uint64_t get_map_size() const { return m_map_size; }
+    uint get_map_access() const { return m_map_access; }
+
 private:
     GLuint m_snapshot_handle;
     GLenum m_target;
@@ -94,6 +106,12 @@ private:
 
     vogl_state_vector m_params;
 
+    uint64_t m_map_ofs;
+    uint64_t m_map_size;
+    uint m_map_access;
+    bool m_map_range;
+    bool m_is_mapped;
+
     bool m_is_valid;
 };