Changeset 41071 in vbox
- Timestamp:
- Apr 26, 2012 12:17:23 PM (13 years ago)
- Location:
- trunk/src/VBox/GuestHost/OpenGL/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_bits.h
r41057 r41071 65 65 } 66 66 67 static INLINE int CHECKBIT( const unsigned int *b, const unsigned int bit )68 {69 unsigned int node32 = bit >> 5;70 unsigned int node = bit & 0x1f;71 72 return !!(b[node32] & (1 < node));73 }74 75 static INLINE void CLEARBIT( unsigned int *b, const unsigned int bit )76 {77 unsigned int node32 = bit >> 5;78 unsigned int node = bit & 0x1f;79 80 b[node32] &= ~(1 << node);81 }82 83 static INLINE void SETBIT( unsigned int *b, const unsigned int bit )84 {85 unsigned int node32 = bit >> 5;86 unsigned int node = bit & 0x1f;87 88 b[node32] |= (1 << node);89 }90 91 static INLINE int HASBITS( const unsigned int *b )92 {93 int j;94 95 for (j=0;j<CR_MAX_BITARRAY;j++)96 if (b[j])97 return 1;98 99 return 0;100 }101 102 static INLINE void CLEARBITS( unsigned int *b )103 {104 int j;105 106 for (j=0;j<CR_MAX_BITARRAY;j++)107 b[j] = 0;108 }109 110 111 67 #ifdef __cplusplus 112 68 } -
trunk/src/VBox/GuestHost/OpenGL/include/cr_glstate.h
r41057 r41071 54 54 #ifndef IN_GUEST 55 55 # include <VBox/vmm/ssm.h> 56 # include <iprt/asm.h> 57 58 # define CR_STATE_SHAREDOBJ_USAGE_INIT(_pObj) (crMemset((_pObj)->ctxUsage, 0, sizeof ((_pObj)->ctxUsage))) 59 # define CR_STATE_SHAREDOBJ_USAGE_SET(_pObj, _pCtx) (ASMBitSet((_pObj)->ctxUsage, (_pCtx)->id)) 60 # define CR_STATE_SHAREDOBJ_USAGE_CLEAR(_pObj, _pCtx) (ASMBitClear((_pObj)->ctxUsage, (_pCtx)->id)) 61 # define CR_STATE_SHAREDOBJ_USAGE_IS_USED(_pObj) (ASMBitFirstSet((_pObj)->ctxUsage, sizeof ((_pObj)->ctxUsage)<<3) >= 0) 56 62 #endif 57 63 … … 115 121 GLboolean bFBOResyncNeeded; 116 122 } CRSharedState; 117 118 #define CR_STATE_SHAREDOBJ_USAGE_INIT(_pObj) (CLEARBITS((_pObj)->ctxUsage))119 #define CR_STATE_SHAREDOBJ_USAGE_SET(_pObj, _pCtx) (SETBIT((_pObj)->ctxUsage, (_pCtx)->id))120 #define CR_STATE_SHAREDOBJ_USAGE_CLEAR(_pObj, _pCtx) (CLEARBIT((_pObj)->ctxUsage, (_pCtx)->id))121 #define CR_STATE_SHAREDOBJ_USAGE_IS_USED(_pObj) (HASBITS((_pObj)->ctxUsage))122 123 123 124 /**
Note:
See TracChangeset
for help on using the changeset viewer.