Changeset 73097 in vbox for trunk/src/VBox/GuestHost/OpenGL
- Timestamp:
- Jul 12, 2018 9:06:33 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_snapshot.c
r69500 r73097 63 63 64 64 #define SHCROGL_GET_STRUCT_PART(_pPtr, _type, _from, _to) do { \ 65 rc = SSMR3GetMem(pSSM, &(_pPtr)->_from, RT_ OFFSETOF(_type, _to) - RT_OFFSETOF(_type, _from)); \65 rc = SSMR3GetMem(pSSM, &(_pPtr)->_from, RT_UOFFSETOF(_type, _to) - RT_UOFFSETOF(_type, _from)); \ 66 66 AssertRCReturn(rc, rc); \ 67 67 } while (0) 68 68 69 69 #define SHCROGL_GET_STRUCT_TAIL(_pPtr, _type, _from) do { \ 70 rc = SSMR3GetMem(pSSM, &(_pPtr)->_from, sizeof (_type) - RT_ OFFSETOF(_type, _from)); \70 rc = SSMR3GetMem(pSSM, &(_pPtr)->_from, sizeof (_type) - RT_UOFFSETOF(_type, _from)); \ 71 71 AssertRCReturn(rc, rc); \ 72 72 } while (0) 73 73 74 74 #define SHCROGL_GET_STRUCT_HEAD(_pPtr, _type, _to) do { \ 75 rc = SSMR3GetMem(pSSM, (_pPtr), RT_ OFFSETOF(_type, _to)); \75 rc = SSMR3GetMem(pSSM, (_pPtr), RT_UOFFSETOF(_type, _to)); \ 76 76 AssertRCReturn(rc, rc); \ 77 77 } while (0) 78 78 79 #define SHCROGL_CUT_FIELD_ALIGNMENT_SIZE(_type, _prevField, _field) (RT_ OFFSETOF(_type, _field) - RT_OFFSETOF(_type, _prevField) - RT_SIZEOFMEMB(_type, _prevField))79 #define SHCROGL_CUT_FIELD_ALIGNMENT_SIZE(_type, _prevField, _field) (RT_UOFFSETOF(_type, _field) - RT_UOFFSETOF(_type, _prevField) - RT_SIZEOFMEMB(_type, _prevField)) 80 80 #define SHCROGL_CUT_FIELD_ALIGNMENT(_type, _prevField, _field) do { \ 81 81 const int32_t cbAlignment = SHCROGL_CUT_FIELD_ALIGNMENT_SIZE(_type, _prevField, _field) ; \ … … 88 88 #define SHCROGL_ROUNDBOUND(_v, _b) (((_v) + ((_b) - 1)) & ~((_b) - 1)) 89 89 #define SHCROGL_ALIGNTAILSIZE(_v, _b) (SHCROGL_ROUNDBOUND((_v),(_b)) - (_v)) 90 #define SHCROGL_CUT_FOR_OLD_TYPE_TO_ENSURE_ALIGNMENT_SIZE(_type, _field, _oldFieldType, _nextFieldAllignment) (SHCROGL_ALIGNTAILSIZE(((RT_ OFFSETOF(_type, _field) + sizeof (_oldFieldType))), (_nextFieldAllignment)))90 #define SHCROGL_CUT_FOR_OLD_TYPE_TO_ENSURE_ALIGNMENT_SIZE(_type, _field, _oldFieldType, _nextFieldAllignment) (SHCROGL_ALIGNTAILSIZE(((RT_UOFFSETOF(_type, _field) + sizeof (_oldFieldType))), (_nextFieldAllignment))) 91 91 #define SHCROGL_CUT_FOR_OLD_TYPE_TO_ENSURE_ALIGNMENT(_type, _field, _oldFieldType, _nextFieldAllignment) do { \ 92 92 const int32_t cbAlignment = SHCROGL_CUT_FOR_OLD_TYPE_TO_ENSURE_ALIGNMENT_SIZE(_type, _field, _oldFieldType, _nextFieldAllignment); \ … … 98 98 99 99 100 #define SHCROGL_CUT_TAIL_ALIGNMENT_SIZE(_type, _lastField) (sizeof (_type) - RT_ OFFSETOF(_type, _lastField) - RT_SIZEOFMEMB(_type, _lastField))100 #define SHCROGL_CUT_TAIL_ALIGNMENT_SIZE(_type, _lastField) (sizeof (_type) - RT_UOFFSETOF(_type, _lastField) - RT_SIZEOFMEMB(_type, _lastField)) 101 101 #define SHCROGL_CUT_TAIL_ALIGNMENT(_type, _lastField) do { \ 102 102 const int32_t cbAlignment = SHCROGL_CUT_TAIL_ALIGNMENT_SIZE(_type, _lastField); \ … … 110 110 { 111 111 int32_t rc; 112 uint32_t cbObj = RT_ OFFSETOF(CRTextureObj, ctxUsage);112 uint32_t cbObj = RT_UOFFSETOF(CRTextureObj, ctxUsage); 113 113 cbObj = ((cbObj + sizeof (void*) - 1) & ~(sizeof (void*) - 1)); 114 114 rc = SSMR3GetMem(pSSM, pTexture, cbObj); … … 338 338 if (u32Version == SHCROGL_SSM_VERSION_BEFORE_CTXUSAGE_BITS) 339 339 { 340 uint32_t cbObj = RT_ OFFSETOF(CRBufferObject, ctxUsage);340 uint32_t cbObj = RT_UOFFSETOF(CRBufferObject, ctxUsage); 341 341 cbObj = ((cbObj + sizeof (void*) - 1) & ~(sizeof (void*) - 1)); 342 342 rc = SSMR3GetMem(pSSM, pBufferObj, cbObj); … … 359 359 if (u32Version == SHCROGL_SSM_VERSION_BEFORE_CTXUSAGE_BITS) 360 360 { 361 uint32_t cbObj = RT_ OFFSETOF(CRFramebufferObject, ctxUsage);361 uint32_t cbObj = RT_UOFFSETOF(CRFramebufferObject, ctxUsage); 362 362 cbObj = ((cbObj + sizeof (void*) - 1) & ~(sizeof (void*) - 1)); 363 363 rc = SSMR3GetMem(pSSM, pFBO, cbObj); … … 380 380 if (u32Version == SHCROGL_SSM_VERSION_BEFORE_CTXUSAGE_BITS) 381 381 { 382 uint32_t cbObj = RT_ OFFSETOF(CRRenderbufferObject, ctxUsage);382 uint32_t cbObj = RT_UOFFSETOF(CRRenderbufferObject, ctxUsage); 383 383 cbObj = ((cbObj + sizeof (void*) - 1) & ~(sizeof (void*) - 1)); 384 384 rc = SSMR3GetMem(pSSM, pRBO, cbObj); … … 1912 1912 1913 1913 ui = VBOXTLSREFDATA_OFFSET(CRContext) + VBOXTLSREFDATA_SIZE() + sizeof (pTmpContext->bitid) + sizeof (pTmpContext->neg_bitid); 1914 ui = RT_ OFFSETOF(CRContext, shared) - ui;1914 ui = RT_UOFFSETOF(CRContext, shared) - ui; 1915 1915 } 1916 1916 else
Note:
See TracChangeset
for help on using the changeset viewer.