summaryrefslogtreecommitdiff
path: root/src/VBox/GuestHost/OpenGL/include/state
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/include/state')
-rw-r--r--src/VBox/GuestHost/OpenGL/include/state/cr_attrib.h12
-rw-r--r--src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h5
-rw-r--r--src/VBox/GuestHost/OpenGL/include/state/cr_client.h6
-rw-r--r--src/VBox/GuestHost/OpenGL/include/state/cr_framebuffer.h14
-rw-r--r--src/VBox/GuestHost/OpenGL/include/state/cr_glsl.h3
-rw-r--r--src/VBox/GuestHost/OpenGL/include/state/cr_point.h3
-rw-r--r--src/VBox/GuestHost/OpenGL/include/state/cr_stencil.h84
-rw-r--r--src/VBox/GuestHost/OpenGL/include/state/cr_texture.h4
8 files changed, 103 insertions, 28 deletions
diff --git a/src/VBox/GuestHost/OpenGL/include/state/cr_attrib.h b/src/VBox/GuestHost/OpenGL/include/state/cr_attrib.h
index 855f5736..579e71dd 100644
--- a/src/VBox/GuestHost/OpenGL/include/state/cr_attrib.h
+++ b/src/VBox/GuestHost/OpenGL/include/state/cr_attrib.h
@@ -245,6 +245,18 @@ typedef struct {
GLenum passDepthPass;
GLint clearValue;
GLint writeMask;
+} CRStencilBufferStack_v_33;
+
+typedef struct {
+ /* true if stencil test is enabled */
+ GLboolean stencilTest;
+ /* true if GL_EXT_stencil_two_side is enabled (glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT)) */
+ GLboolean stencilTwoSideEXT;
+ /* GL_FRONT or GL_BACK */
+ GLenum activeStencilFace;
+ GLint clearValue;
+ GLint writeMask;
+ CRStencilBufferState buffers[CRSTATE_STENCIL_BUFFER_COUNT];
} CRStencilBufferStack;
typedef struct {
diff --git a/src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h b/src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h
index d83ac973..8584adc0 100644
--- a/src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h
+++ b/src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h
@@ -41,10 +41,8 @@ typedef struct {
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 */
-#ifndef IN_GUEST
/* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */
CRbitvalue ctxUsage[CR_MAX_BITARRAY];
-#endif
} CRBufferObject;
typedef struct {
@@ -59,10 +57,13 @@ typedef struct {
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
diff --git a/src/VBox/GuestHost/OpenGL/include/state/cr_client.h b/src/VBox/GuestHost/OpenGL/include/state/cr_client.h
index e328857a..a727f260 100644
--- a/src/VBox/GuestHost/OpenGL/include/state/cr_client.h
+++ b/src/VBox/GuestHost/OpenGL/include/state/cr_client.h
@@ -125,10 +125,12 @@ typedef struct {
extern const CRPixelPackState crStateNativePixelPacking;
+struct CRContext;
+
DECLEXPORT(void) crStateClientInitBits(CRClientBits *c);
DECLEXPORT(void) crStateClientDestroyBits(CRClientBits *c);
-DECLEXPORT(void) crStateClientInit(CRClientState *c);
-DECLEXPORT(void) crStateClientDestroy(CRClientState *c);
+DECLEXPORT(void) crStateClientInit(struct CRContext *g);
+DECLEXPORT(void) crStateClientDestroy(struct CRContext *g);
DECLEXPORT(GLboolean) crStateUseServerArrays(void);
DECLEXPORT(GLboolean) crStateUseServerArrayElements(void);
diff --git a/src/VBox/GuestHost/OpenGL/include/state/cr_framebuffer.h b/src/VBox/GuestHost/OpenGL/include/state/cr_framebuffer.h
index adc7b3b2..f8da8a7c 100644
--- a/src/VBox/GuestHost/OpenGL/include/state/cr_framebuffer.h
+++ b/src/VBox/GuestHost/OpenGL/include/state/cr_framebuffer.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2009-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -48,10 +48,9 @@ typedef struct {
GLenum drawbuffer[1];
#ifdef IN_GUEST
GLenum status;
-#else
+#endif
/* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */
CRbitvalue ctxUsage[CR_MAX_BITARRAY];
-#endif
} CRFramebufferObject;
typedef struct {
@@ -59,10 +58,8 @@ typedef struct {
GLsizei width, height;
GLenum internalformat;
GLuint redBits, greenBits, blueBits, alphaBits, depthBits, stencilBits;
-#ifndef IN_GUEST
/* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */
CRbitvalue ctxUsage[CR_MAX_BITARRAY];
-#endif
} CRRenderbufferObject;
typedef struct {
@@ -74,8 +71,8 @@ DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectInit(CRContext *ctx);
DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectDestroy(CRContext *ctx);
DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectSwitch(CRContext *from, CRContext *to);
-DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectDisableHW(CRContext *ctx, GLuint idFBO);
-DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectReenableHW(CRContext *fromCtx, CRContext *toCtx, GLuint idFBO);
+DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectDisableHW(CRContext *ctx, GLuint idDrawFBO, GLuint idReadFBO);
+DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectReenableHW(CRContext *fromCtx, CRContext *toCtx, GLuint idDrawFBO, GLuint idReadFBO);
DECLEXPORT(GLuint) STATE_APIENTRY crStateGetFramebufferHWID(GLuint id);
DECLEXPORT(GLuint) STATE_APIENTRY crStateGetRenderbufferHWID(GLuint id);
@@ -96,6 +93,9 @@ DECLEXPORT(void) STATE_APIENTRY crStateGenerateMipmapEXT(GLenum target);
DECLEXPORT(GLuint) STATE_APIENTRY crStateFBOHWIDtoID(GLuint hwid);
DECLEXPORT(GLuint) STATE_APIENTRY crStateRBOHWIDtoID(GLuint hwid);
+DECLEXPORT(void) crStateRegFramebuffers(GLsizei n, GLuint *buffers);
+DECLEXPORT(void) crStateRegRenderbuffers(GLsizei n, GLuint *buffers);
+
#ifdef IN_GUEST
DECLEXPORT(GLenum) STATE_APIENTRY crStateCheckFramebufferStatusEXT(GLenum target);
DECLEXPORT(GLenum) STATE_APIENTRY crStateSetFramebufferStatus(GLenum target, GLenum status);
diff --git a/src/VBox/GuestHost/OpenGL/include/state/cr_glsl.h b/src/VBox/GuestHost/OpenGL/include/state/cr_glsl.h
index 2713c434..81ed568e 100644
--- a/src/VBox/GuestHost/OpenGL/include/state/cr_glsl.h
+++ b/src/VBox/GuestHost/OpenGL/include/state/cr_glsl.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2009-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -99,6 +99,7 @@ DECLEXPORT(GLboolean) STATE_APIENTRY crStateIsIntUniform(GLenum type);
DECLEXPORT(GLuint) STATE_APIENTRY crStateCreateShader(GLuint id, GLenum type);
DECLEXPORT(GLuint) STATE_APIENTRY crStateCreateProgram(GLuint id);
+DECLEXPORT(GLuint) STATE_APIENTRY crStateDeleteObjectARB( VBoxGLhandleARB obj );
DECLEXPORT(GLboolean) STATE_APIENTRY crStateIsProgramUniformsCached(GLuint program);
diff --git a/src/VBox/GuestHost/OpenGL/include/state/cr_point.h b/src/VBox/GuestHost/OpenGL/include/state/cr_point.h
index 4f5987b0..fe3dffe3 100644
--- a/src/VBox/GuestHost/OpenGL/include/state/cr_point.h
+++ b/src/VBox/GuestHost/OpenGL/include/state/cr_point.h
@@ -28,6 +28,7 @@ typedef struct {
CRbitvalue enableSprite[CR_MAX_BITARRAY];
CRbitvalue coordReplacement[CR_MAX_TEXTURE_UNITS][CR_MAX_BITARRAY];
#endif
+ CRbitvalue spriteCoordOrigin[CR_MAX_BITARRAY];
CRbitvalue dirty[CR_MAX_BITARRAY];
} CRPointBits;
@@ -43,6 +44,8 @@ typedef struct {
GLboolean pointSprite;
GLboolean coordReplacement[CR_MAX_TEXTURE_UNITS];
#endif
+ GLfloat spriteCoordOrigin;
+ GLfloat reserved; /* added to make sure alignment of sttructures following CRPointState in CRContext does not change */
} CRPointState;
DECLEXPORT(void) crStatePointInit (CRContext *ctx);
diff --git a/src/VBox/GuestHost/OpenGL/include/state/cr_stencil.h b/src/VBox/GuestHost/OpenGL/include/state/cr_stencil.h
index 1443e951..27823eb2 100644
--- a/src/VBox/GuestHost/OpenGL/include/state/cr_stencil.h
+++ b/src/VBox/GuestHost/OpenGL/include/state/cr_stencil.h
@@ -11,33 +11,89 @@
#include "state/cr_statetypes.h"
#include <iprt/cdefs.h>
+#include <iprt/assert.h>
#ifdef __cplusplus
extern "C" {
#endif
+#define CRSTATE_STENCIL_BUFFER_ID_FRONT 0
+#define CRSTATE_STENCIL_BUFFER_ID_BACK 1
+#define CRSTATE_STENCIL_BUFFER_ID_TWO_SIDE_BACK 2
+#define CRSTATE_STENCIL_BUFFER_COUNT 3
+
+/* stencil buffer settings were accessed with StencilXxx with ActiveStencilFaceEXT == GL_FRONT or StencilXxxSeparate(GL_FRONT_AND_BACK) */
+#define CRSTATE_STENCIL_BUFFER_REF_ID_FRONT_AND_BACK 0
+/* stencil buffer settings were accessed with StencilXxxSeparate(GL_FRONT_FRONT) */
+#define CRSTATE_STENCIL_BUFFER_REF_ID_FRONT 1
+/* stencil buffer settings were accessed with StencilXxxSeparate(GL_FRONT_BACK) */
+#define CRSTATE_STENCIL_BUFFER_REF_ID_BACK 2
+/* stencil buffer settings were accessed with StencilXxx with ActiveStencilFaceEXT == GL_BACK */
+#define CRSTATE_STENCIL_BUFFER_REF_ID_TWO_SIDE_BACK 3
+#define CRSTATE_STENCIL_BUFFER_REF_COUNT 4
+
+typedef struct {
+ CRbitvalue dirty[CR_MAX_BITARRAY];
+ CRbitvalue enable[CR_MAX_BITARRAY];
+ CRbitvalue func[CR_MAX_BITARRAY];
+ CRbitvalue op[CR_MAX_BITARRAY];
+ CRbitvalue clearValue[CR_MAX_BITARRAY];
+ CRbitvalue writeMask[CR_MAX_BITARRAY];
+} CRStencilBits_v_33;
+
+typedef struct {
+ CRbitvalue func[CR_MAX_BITARRAY];
+ CRbitvalue op[CR_MAX_BITARRAY];
+} CRStencilBufferRefBits;
+
typedef struct {
- CRbitvalue dirty[CR_MAX_BITARRAY];
- CRbitvalue enable[CR_MAX_BITARRAY];
- CRbitvalue func[CR_MAX_BITARRAY];
- CRbitvalue op[CR_MAX_BITARRAY];
- CRbitvalue clearValue[CR_MAX_BITARRAY];
- CRbitvalue writeMask[CR_MAX_BITARRAY];
+ CRbitvalue dirty[CR_MAX_BITARRAY];
+ CRbitvalue enable[CR_MAX_BITARRAY];
+ CRbitvalue enableTwoSideEXT[CR_MAX_BITARRAY];
+ CRbitvalue activeStencilFace[CR_MAX_BITARRAY];
+ CRbitvalue clearValue[CR_MAX_BITARRAY];
+ CRbitvalue writeMask[CR_MAX_BITARRAY];
+ /* note: here we use _BUFFER_REF_ rather than _REF_ because we track the way buffers are accessed here,
+ * to ensure the correct function is called on hw->chromium state restoration,
+ * i.e. we want to avoid always calling StencilXxxSeparate, but call StencilXxx when it was actually called */
+ CRStencilBufferRefBits bufferRefs[CRSTATE_STENCIL_BUFFER_REF_COUNT];
} CRStencilBits;
typedef struct {
+ GLboolean stencilTest;
+ GLenum func;
+ GLint mask;
+ GLint ref;
+ GLenum fail;
+ GLenum passDepthFail;
+ GLenum passDepthPass;
+ GLint clearValue;
+ GLint writeMask;
+} CRStencilState_v_33;
+
+typedef struct {
+ GLenum func;
+ GLint mask;
+ GLint ref;
+ GLenum fail;
+ GLenum passDepthFail;
+ GLenum passDepthPass;
+} CRStencilBufferState;
+
+typedef struct {
+ /* true if stencil test is enabled */
GLboolean stencilTest;
- GLenum func;
- GLint mask;
- GLint ref;
- GLenum fail;
- GLenum passDepthFail;
- GLenum passDepthPass;
- GLint clearValue;
- GLint writeMask;
+ /* true if GL_EXT_stencil_two_side is enabled (glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT)) */
+ GLboolean stencilTwoSideEXT;
+ /* GL_FRONT or GL_BACK */
+ GLenum activeStencilFace;
+ GLint clearValue;
+ GLint writeMask;
+ CRStencilBufferState buffers[CRSTATE_STENCIL_BUFFER_COUNT];
} CRStencilState;
DECLEXPORT(void) crStateStencilInit(CRContext *ctx);
+DECLEXPORT(void) crStateStencilBufferInit(CRStencilBufferState *s);
DECLEXPORT(void) crStateStencilDiff(CRStencilBits *bb, CRbitvalue *bitID,
CRContext *fromCtx, CRContext *toCtx);
diff --git a/src/VBox/GuestHost/OpenGL/include/state/cr_texture.h b/src/VBox/GuestHost/OpenGL/include/state/cr_texture.h
index 5d0262d4..c55d0da9 100644
--- a/src/VBox/GuestHost/OpenGL/include/state/cr_texture.h
+++ b/src/VBox/GuestHost/OpenGL/include/state/cr_texture.h
@@ -96,10 +96,8 @@ typedef struct {
CRbitvalue dirty[CR_MAX_BITARRAY];
CRbitvalue imageBit[CR_MAX_BITARRAY];
CRbitvalue paramsBit[CR_MAX_TEXTURE_UNITS][CR_MAX_BITARRAY];
-#ifndef IN_GUEST
/* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */
CRbitvalue ctxUsage[CR_MAX_BITARRAY];
-#endif
} CRTextureObj;
typedef struct {
@@ -242,6 +240,8 @@ DECLEXPORT(GLuint) STATE_APIENTRY crStateTextureHWIDtoID(GLuint hwid);
DECLEXPORT(GLuint) STATE_APIENTRY crStateGetTextureHWID(GLuint id);
DECLEXPORT(GLuint) STATE_APIENTRY crStateGetTextureObjHWID(CRTextureObj *tobj);
+void crStateRegTextures(GLsizei n, GLuint *names);
+
#ifdef __cplusplus
}
#endif