VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/state/cr_stencil.h@ 78375

Last change on this file since 78375 was 69474, checked in by vboxsync, 7 years ago

*: scm updates - header files should have 'svn:keywords=Id Revision' too (doesn't mean they have to use them).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 3.6 KB
Line 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved.
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#ifndef CR_STATE_STENCIL_H
8#define CR_STATE_STENCIL_H
9
10#include "cr_glstate.h"
11#include "state/cr_statetypes.h"
12
13#include <iprt/cdefs.h>
14#include <iprt/assert.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#define CRSTATE_STENCIL_BUFFER_ID_FRONT 0
21#define CRSTATE_STENCIL_BUFFER_ID_BACK 1
22#define CRSTATE_STENCIL_BUFFER_ID_TWO_SIDE_BACK 2
23#define CRSTATE_STENCIL_BUFFER_COUNT 3
24
25/* stencil buffer settings were accessed with StencilXxx with ActiveStencilFaceEXT == GL_FRONT or StencilXxxSeparate(GL_FRONT_AND_BACK) */
26#define CRSTATE_STENCIL_BUFFER_REF_ID_FRONT_AND_BACK 0
27/* stencil buffer settings were accessed with StencilXxxSeparate(GL_FRONT_FRONT) */
28#define CRSTATE_STENCIL_BUFFER_REF_ID_FRONT 1
29/* stencil buffer settings were accessed with StencilXxxSeparate(GL_FRONT_BACK) */
30#define CRSTATE_STENCIL_BUFFER_REF_ID_BACK 2
31/* stencil buffer settings were accessed with StencilXxx with ActiveStencilFaceEXT == GL_BACK */
32#define CRSTATE_STENCIL_BUFFER_REF_ID_TWO_SIDE_BACK 3
33#define CRSTATE_STENCIL_BUFFER_REF_COUNT 4
34
35typedef struct {
36 CRbitvalue dirty[CR_MAX_BITARRAY];
37 CRbitvalue enable[CR_MAX_BITARRAY];
38 CRbitvalue func[CR_MAX_BITARRAY];
39 CRbitvalue op[CR_MAX_BITARRAY];
40 CRbitvalue clearValue[CR_MAX_BITARRAY];
41 CRbitvalue writeMask[CR_MAX_BITARRAY];
42} CRStencilBits_v_33;
43
44typedef struct {
45 CRbitvalue func[CR_MAX_BITARRAY];
46 CRbitvalue op[CR_MAX_BITARRAY];
47} CRStencilBufferRefBits;
48
49typedef struct {
50 CRbitvalue dirty[CR_MAX_BITARRAY];
51 CRbitvalue enable[CR_MAX_BITARRAY];
52 CRbitvalue enableTwoSideEXT[CR_MAX_BITARRAY];
53 CRbitvalue activeStencilFace[CR_MAX_BITARRAY];
54 CRbitvalue clearValue[CR_MAX_BITARRAY];
55 CRbitvalue writeMask[CR_MAX_BITARRAY];
56 /* note: here we use _BUFFER_REF_ rather than _REF_ because we track the way buffers are accessed here,
57 * to ensure the correct function is called on hw->chromium state restoration,
58 * i.e. we want to avoid always calling StencilXxxSeparate, but call StencilXxx when it was actually called */
59 CRStencilBufferRefBits bufferRefs[CRSTATE_STENCIL_BUFFER_REF_COUNT];
60} CRStencilBits;
61
62typedef struct {
63 GLboolean stencilTest;
64 GLenum func;
65 GLint mask;
66 GLint ref;
67 GLenum fail;
68 GLenum passDepthFail;
69 GLenum passDepthPass;
70 GLint clearValue;
71 GLint writeMask;
72} CRStencilState_v_33;
73
74typedef struct {
75 GLenum func;
76 GLint mask;
77 GLint ref;
78 GLenum fail;
79 GLenum passDepthFail;
80 GLenum passDepthPass;
81} CRStencilBufferState;
82
83typedef struct {
84 /* true if stencil test is enabled */
85 GLboolean stencilTest;
86 /* true if GL_EXT_stencil_two_side is enabled (glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT)) */
87 GLboolean stencilTwoSideEXT;
88 /* GL_FRONT or GL_BACK */
89 GLenum activeStencilFace;
90 GLint clearValue;
91 GLint writeMask;
92 CRStencilBufferState buffers[CRSTATE_STENCIL_BUFFER_COUNT];
93} CRStencilState;
94
95DECLEXPORT(void) crStateStencilInit(CRContext *ctx);
96DECLEXPORT(void) crStateStencilBufferInit(CRStencilBufferState *s);
97
98DECLEXPORT(void) crStateStencilDiff(CRStencilBits *bb, CRbitvalue *bitID,
99 CRContext *fromCtx, CRContext *toCtx);
100DECLEXPORT(void) crStateStencilSwitch(CRStencilBits *bb, CRbitvalue *bitID,
101 CRContext *fromCtx, CRContext *toCtx);
102
103#ifdef __cplusplus
104}
105#endif
106
107#endif /* CR_STATE_STENCIL_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette