summaryrefslogtreecommitdiffstats
path: root/src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 03:01:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 03:01:46 +0000
commitf8fe689a81f906d1b91bb3220acde2a4ecb14c5b (patch)
tree26484e9d7e2c67806c2d1760196ff01aaa858e8c /src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h
parentInitial commit. (diff)
downloadvirtualbox-f8fe689a81f906d1b91bb3220acde2a4ecb14c5b.tar.xz
virtualbox-f8fe689a81f906d1b91bb3220acde2a4ecb14c5b.zip
Adding upstream version 6.0.4-dfsg.upstream/6.0.4-dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h')
-rw-r--r--src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h b/src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h
new file mode 100644
index 00000000..8584adc0
--- /dev/null
+++ b/src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h
@@ -0,0 +1,71 @@
+/* Copyright (c) 2001, Stanford University
+ * All rights reserved.
+ *
+ * See the file LICENSE.txt for information on redistributing this software.
+ */
+
+#ifndef CR_STATE_BUFFEROBJECT_H
+#define CR_STATE_BUFFEROBJECT_H
+
+#include "cr_hash.h"
+#include "state/cr_statetypes.h"
+#include "state/cr_statefuncs.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ CRbitvalue dirty[CR_MAX_BITARRAY];
+ CRbitvalue arrayBinding[CR_MAX_BITARRAY];
+ CRbitvalue elementsBinding[CR_MAX_BITARRAY];
+ CRbitvalue packBinding[CR_MAX_BITARRAY];
+ CRbitvalue unpackBinding[CR_MAX_BITARRAY];
+} CRBufferObjectBits;
+
+
+/*
+ * Buffer object, like a texture object, but encapsulates arbitrary
+ * data (vertex, image, etc).
+ */
+typedef struct {
+ GLuint refCount;
+ GLuint id;
+ GLuint hwid;
+ GLenum usage;
+ GLenum access;
+ GLuint size; /* buffer size in bytes */
+ GLvoid *pointer; /* only valid while buffer is mapped */
+ GLvoid *data; /* the buffer data, if retainBufferData is true */
+ GLboolean bResyncOnRead; /* buffer data could be changed on server side,
+ so we need to resync every time guest wants to read from it*/
+ CRbitvalue dirty[CR_MAX_BITARRAY]; /* dirty data or state */
+ GLintptrARB dirtyStart, dirtyLength; /* dirty region */
+ /* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */
+ CRbitvalue ctxUsage[CR_MAX_BITARRAY];
+} CRBufferObject;
+
+typedef struct {
+ GLboolean retainBufferData; /* should state tracker retain buffer data? */
+ CRBufferObject *arrayBuffer;
+ CRBufferObject *elementsBuffer;
+ CRBufferObject *packBuffer;
+ CRBufferObject *unpackBuffer;
+
+ CRBufferObject *nullBuffer; /* name = 0 */
+} CRBufferObjectState;
+
+DECLEXPORT(CRBufferObject *) crStateGetBoundBufferObject(GLenum target, CRBufferObjectState *b);
+DECLEXPORT(GLboolean) crStateIsBufferBound(GLenum target);
+struct CRContext;
+DECLEXPORT(GLboolean) crStateIsBufferBoundForCtx(struct CRContext *g, GLenum target);
+
+DECLEXPORT(GLuint) STATE_APIENTRY crStateBufferHWIDtoID(GLuint hwid);
+DECLEXPORT(GLuint) STATE_APIENTRY crStateGetBufferHWID(GLuint id);
+
+DECLEXPORT(void) crStateRegBuffers(GLsizei n, GLuint *buffers);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CR_STATE_BUFFEROBJECT_H */