From f8fe689a81f906d1b91bb3220acde2a4ecb14c5b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 05:01:46 +0200 Subject: Adding upstream version 6.0.4-dfsg. Signed-off-by: Daniel Baumann --- .../OpenGL/include/state/cr_bufferobject.h | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h (limited to 'src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h') 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 */ -- cgit v1.2.3