Changeset 78375 in vbox for trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h
- Timestamp:
- May 3, 2019 9:51:02 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h
r78341 r78375 192 192 #endif 193 193 194 /** The state tracker the context is attached to. */ 195 PCRStateTracker pStateTracker; 196 194 197 /** For buffering vertices for selection/feedback */ 195 198 /*@{*/ … … 202 205 203 206 204 DECLEXPORT(void) crStateInit(void); 205 DECLEXPORT(void) crStateDestroy(void); 206 DECLEXPORT(void) crStateVBoxDetachThread(void); 207 DECLEXPORT(void) crStateVBoxAttachThread(void); 208 DECLEXPORT(CRContext *) crStateCreateContext(const CRLimitsState *limits, GLint visBits, CRContext *share); 209 DECLEXPORT(CRContext *) crStateCreateContextEx(const CRLimitsState *limits, GLint visBits, CRContext *share, GLint presetID); 210 DECLEXPORT(void) crStateMakeCurrent(CRContext *ctx); 211 DECLEXPORT(void) crStateSetCurrent(CRContext *ctx); 212 DECLEXPORT(void) crStateCleanupCurrent(void); 213 DECLEXPORT(CRContext *) crStateGetCurrent(void); 214 DECLEXPORT(void) crStateDestroyContext(CRContext *ctx); 215 DECLEXPORT(GLboolean) crStateEnableDiffOnMakeCurrent(GLboolean fEnable); 207 /** 208 * CR state tracker. 209 */ 210 typedef struct CRStateTracker 211 { 212 bool fContextTLSInit; 213 CRtsd contextTSD; 214 CRStateBits *pCurrentBits; 215 CRContext *apAvailableContexts[CR_MAX_CONTEXTS]; 216 uint32_t cContexts; 217 CRSharedState *pSharedState; 218 CRContext *pDefaultContext; 219 GLboolean fVBoxEnableDiffOnMakeCurrent; 220 SPUDispatchTable diff_api; 221 } CRStateTracker; 222 /** Pointer to a state tracker state. */ 223 typedef CRStateTracker *PCRStateTracker; 224 225 DECLEXPORT(void) crStateInit(PCRStateTracker pState); 226 DECLEXPORT(void) crStateDestroy(PCRStateTracker pState); 227 DECLEXPORT(void) crStateVBoxDetachThread(PCRStateTracker pState); 228 DECLEXPORT(void) crStateVBoxAttachThread(PCRStateTracker pState); 229 DECLEXPORT(CRContext *) crStateCreateContext(PCRStateTracker pState, const CRLimitsState *limits, GLint visBits, CRContext *share); 230 DECLEXPORT(CRContext *) crStateCreateContextEx(PCRStateTracker pState, const CRLimitsState *limits, GLint visBits, CRContext *share, GLint presetID); 231 DECLEXPORT(void) crStateMakeCurrent(PCRStateTracker pState, CRContext *ctx); 232 DECLEXPORT(void) crStateSetCurrent(PCRStateTracker pState, CRContext *ctx); 233 DECLEXPORT(void) crStateCleanupCurrent(PCRStateTracker pState); 234 DECLEXPORT(CRContext *) crStateGetCurrent(PCRStateTracker pState); 235 DECLEXPORT(void) crStateDestroyContext(PCRStateTracker pState, CRContext *ctx); 236 DECLEXPORT(GLboolean) crStateEnableDiffOnMakeCurrent(PCRStateTracker pState, GLboolean fEnable); 216 237 217 238 void crStateSwitchPrepare(CRContext *toCtx, CRContext *fromCtx, GLuint idDrawFBO, GLuint idReadFBO); … … 219 240 220 241 void crStateSyncHWErrorState(CRContext *ctx); 221 GLenum crStateCleanHWErrorState( void);222 223 #define CR_STATE_CLEAN_HW_ERR_WARN( _s) do {\224 GLenum _err = crStateCleanHWErrorState( ); \242 GLenum crStateCleanHWErrorState(PCRStateTracker pState); 243 244 #define CR_STATE_CLEAN_HW_ERR_WARN(a_pState, _s) do {\ 245 GLenum _err = crStateCleanHWErrorState((a_pState)); \ 225 246 if (_err != GL_NO_ERROR) { \ 226 247 static int _cErrPrints = 0; \ … … 232 253 } while (0) 233 254 234 DECLEXPORT(void) crStateFlushFunc( CRStateFlushFunc ff);235 DECLEXPORT(void) crStateFlushArg( void *arg );236 DECLEXPORT(void) crStateDiffAPI( SPUDispatchTable *api);237 DECLEXPORT(void) crStateUpdateColorBits( void);238 239 DECLEXPORT(void) crStateSetCurrentPointers( CRContext *ctx, CRCurrentStatePointers *current);240 DECLEXPORT(void) crStateResetCurrentPointers( CRCurrentStatePointers *current);241 242 DECLEXPORT(void) crStateSetExtensionString( CRContext *ctx, const GLubyte *extensions);243 244 DECLEXPORT(void) crStateDiffContext( CRContext *from, CRContext *to);245 DECLEXPORT(void) crStateSwitchContext( CRContext *from, CRContext *to);246 247 DECLEXPORT(unsigned int) crStateHlpComponentsCount( GLenum pname);255 DECLEXPORT(void) crStateFlushFunc(PCRStateTracker pState, CRStateFlushFunc ff); 256 DECLEXPORT(void) crStateFlushArg(PCRStateTracker pState, void *arg ); 257 DECLEXPORT(void) crStateDiffAPI(PCRStateTracker pState, SPUDispatchTable *api); 258 DECLEXPORT(void) crStateUpdateColorBits(PCRStateTracker pState); 259 260 DECLEXPORT(void) crStateSetCurrentPointers(CRContext *ctx, CRCurrentStatePointers *current); 261 DECLEXPORT(void) crStateResetCurrentPointers(CRCurrentStatePointers *current); 262 263 DECLEXPORT(void) crStateSetExtensionString(CRContext *ctx, const GLubyte *extensions); 264 265 DECLEXPORT(void) crStateDiffContext(CRContext *from, CRContext *to); 266 DECLEXPORT(void) crStateSwitchContext(CRContext *from, CRContext *to); 267 268 DECLEXPORT(unsigned int) crStateHlpComponentsCount(GLenum pname); 248 269 249 270 typedef struct CRFBDataElement … … 277 298 278 299 DECLEXPORT(void) crStateGetTextureObjectAndImage(CRContext *g, GLenum texTarget, GLint level, 279 CRTextureObj **obj, CRTextureLevel **img);300 CRTextureObj **obj, CRTextureLevel **img); 280 301 281 302 … … 287 308 typedef FNCRSTATE_CONTEXT_GET *PFNCRSTATE_CONTEXT_GET; 288 309 DECLEXPORT(int32_t) crStateLoadContext(CRContext *pContext, CRHashTable * pCtxTable, PFNCRSTATE_CONTEXT_GET pfnCtxGet, PSSMHANDLE pSSM, uint32_t u32Version); 289 DECLEXPORT(void) crStateFreeShared( CRContext *pContext, CRSharedState *s);290 291 DECLEXPORT(int32_t) crStateLoadGlobals(P SSMHANDLE pSSM, uint32_t u32Version);292 DECLEXPORT(int32_t) crStateSaveGlobals(P SSMHANDLE pSSM);293 294 DECLEXPORT(CRSharedState *) crStateGlobalSharedAcquire( void);295 DECLEXPORT(void) crStateGlobalSharedRelease( void);296 #endif 297 298 DECLEXPORT(void) crStateSetTextureUsed( GLuint texture, GLboolean used);299 DECLEXPORT(void) crStatePinTexture( GLuint texture, GLboolean pin);300 DECLEXPORT(void) crStateDeleteTextureCallback(void *texObj );310 DECLEXPORT(void) crStateFreeShared(PCRStateTracker pState, CRContext *pContext, CRSharedState *s); 311 312 DECLEXPORT(int32_t) crStateLoadGlobals(PCRStateTracker pState, PSSMHANDLE pSSM, uint32_t u32Version); 313 DECLEXPORT(int32_t) crStateSaveGlobals(PCRStateTracker pState, PSSMHANDLE pSSM); 314 315 DECLEXPORT(CRSharedState *) crStateGlobalSharedAcquire(PCRStateTracker pState); 316 DECLEXPORT(void) crStateGlobalSharedRelease(PCRStateTracker pState); 317 #endif 318 319 DECLEXPORT(void) crStateSetTextureUsed(PCRStateTracker pState, GLuint texture, GLboolean used); 320 DECLEXPORT(void) crStatePinTexture(PCRStateTracker pState, GLuint texture, GLboolean pin); 321 DECLEXPORT(void) crStateDeleteTextureCallback(void *texObj, void *pvUser); 301 322 302 323 /* XXX move these! */ 303 324 304 DECLEXPORT(void) STATE_APIENTRY 305 crStateChromiumParameteriCR( GLenum target, GLint value ); 306 307 DECLEXPORT(void) STATE_APIENTRY 308 crStateChromiumParameterfCR( GLenum target, GLfloat value ); 309 310 DECLEXPORT(void) STATE_APIENTRY 311 crStateChromiumParametervCR( GLenum target, GLenum type, GLsizei count, const GLvoid *values ); 312 313 DECLEXPORT(void) STATE_APIENTRY 314 crStateGetChromiumParametervCR( GLenum target, GLuint index, GLenum type, 315 GLsizei count, GLvoid *values ); 316 317 DECLEXPORT(void) STATE_APIENTRY 318 crStateReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, 319 GLenum format, GLenum type, GLvoid *pixels ); 320 321 DECLEXPORT(void) STATE_APIENTRY crStateShareContext(GLboolean value); 325 DECLEXPORT(void) STATE_APIENTRY crStateChromiumParameteriCR(PCRStateTracker pState, GLenum target, GLint value ); 326 DECLEXPORT(void) STATE_APIENTRY crStateChromiumParameterfCR(PCRStateTracker pState, GLenum target, GLfloat value ); 327 DECLEXPORT(void) STATE_APIENTRY crStateChromiumParametervCR(PCRStateTracker pState, GLenum target, GLenum type, GLsizei count, const GLvoid *values ); 328 DECLEXPORT(void) STATE_APIENTRY crStateGetChromiumParametervCR(PCRStateTracker pState, GLenum target, GLuint index, GLenum type, 329 GLsizei count, GLvoid *values ); 330 DECLEXPORT(void) STATE_APIENTRY crStateReadPixels(PCRStateTracker pState, GLint x, GLint y, GLsizei width, GLsizei height, 331 GLenum format, GLenum type, GLvoid *pixels ); 332 DECLEXPORT(void) STATE_APIENTRY crStateShareContext(PCRStateTracker pState, GLboolean value); 322 333 DECLEXPORT(void) STATE_APIENTRY crStateShareLists(CRContext *pContext1, CRContext *pContext2); 323 334 DECLEXPORT(void) STATE_APIENTRY crStateSetSharedContext(CRContext *pCtx); 324 335 DECLEXPORT(GLboolean) STATE_APIENTRY crStateContextIsShared(CRContext *pCtx); 325 326 DECLEXPORT(void) STATE_APIENTRY crStateQueryHWState(GLuint fbFbo, GLuint bbFbo); 336 DECLEXPORT(void) STATE_APIENTRY crStateQueryHWState(PCRStateTracker pState, GLuint fbFbo, GLuint bbFbo); 327 337 #ifdef __cplusplus 328 338 }
Note:
See TracChangeset
for help on using the changeset viewer.