Changeset 50041 in vbox for trunk/src/VBox/GuestHost/OpenGL/state_tracker
- Timestamp:
- Jan 9, 2014 4:13:28 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 91522
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/VBox-4.2 merged: 91503-91504,91506-91508,91510,91514-91515,91521
- Property svn:mergeinfo changed
-
trunk/src/VBox
- Property svn:mergeinfo changed
/branches/VBox-4.2/src/VBox merged: 91503-91504,91506-91508,91510,91514-91515,91521
- Property svn:mergeinfo changed
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/dump.cpp
r49261 r50041 730 730 crRecDumpLog(pRec, hwid); 731 731 732 GLhandleARB *pShaders = (GLhandleARB*)crCalloc(cShaders * sizeof (*pShaders));732 VBoxGLhandleARB *pShaders = (VBoxGLhandleARB*)crCalloc(cShaders * sizeof (*pShaders)); 733 733 if (!pShaders) 734 734 { … … 741 741 for (GLint i = 0; i < cShaders; ++i) 742 742 { 743 crRecDumpShader(pRec, ctx, 0, pShaders[i]); 743 if (pShaders[i]) 744 crRecDumpShader(pRec, ctx, 0, pShaders[i]); 745 else 746 crDmpStrF(pRec->pDumper, "WARNING: Shader[%d] is null", i); 744 747 } 745 748 … … 848 851 crDmpStrF(pRec->pDumper, "==RECOMPILE PROGRAM ctx(%d) id(%d) hwid(%d) status(%d) shaders(%d)==", ctx->id, id, hwid, linkStatus, cShaders); 849 852 850 GLhandleARB *pShaders = (GLhandleARB*)crCalloc(cShaders * sizeof (*pShaders));853 VBoxGLhandleARB *pShaders = (VBoxGLhandleARB*)crCalloc(cShaders * sizeof (*pShaders)); 851 854 if (!pShaders) 852 855 { … … 1665 1668 } 1666 1669 1670 DECLEXPORT(bool) crDmpHtmlIsInited(struct CR_HTML_DUMPER * pDumper) 1671 { 1672 return !!pDumper->pFile; 1673 } 1674 1675 DECLEXPORT(void) crDmpHtmlTerm(struct CR_HTML_DUMPER * pDumper) 1676 { 1677 crDmpHtmlPrintFooter(pDumper); 1678 fclose (pDumper->pFile); 1679 pDumper->pFile = NULL; 1680 } 1681 1667 1682 DECLEXPORT(int) crDmpHtmlInit(struct CR_HTML_DUMPER * pDumper, const char *pszDir, const char *pszFile) 1668 1683 { … … 1707 1722 } 1708 1723 1724 DECLEXPORT(int) crDmpHtmlInitV(struct CR_HTML_DUMPER * pDumper, const char *pszDir, const char *pszFile, va_list pArgList) 1725 { 1726 char szBuffer[4096] = {0}; 1727 vsprintf_s(szBuffer, sizeof (szBuffer), pszFile, pArgList); 1728 return crDmpHtmlInit(pDumper, pszDir, szBuffer); 1729 } 1730 1731 DECLEXPORT(int) crDmpHtmlInitF(struct CR_HTML_DUMPER * pDumper, const char *pszDir, const char *pszFile, ...) 1732 { 1733 int rc; 1734 va_list pArgList; 1735 va_start(pArgList, pszFile); 1736 rc = crDmpHtmlInitV(pDumper, pszDir, pszFile, pArgList); 1737 va_end(pArgList); 1738 return rc; 1739 } 1740 1709 1741 #endif -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/dump_gen.py
r46515 r50041 128 128 #endif 129 129 """ 130 131 from get_components import *;132 130 133 131 texenv_mappings = { … … 195 193 """ 196 194 for pname in texparam_names: 197 print "\tcComponents = lookupComponents(%s);" % pname195 print "\tcComponents = crStateHlpComponentsCount(%s);" % pname 198 196 print "\tAssert(cComponents <= RT_ELEMENTS(afBuf));" 199 197 print "\tmemset(afBuf, 0, sizeof (afBuf));" … … 222 220 values = texenv_mappings[target] 223 221 for pname in values: 224 print "\tcComponents = lookupComponents(%s);" % pname222 print "\tcComponents = crStateHlpComponentsCount(%s);" % pname 225 223 print "\tAssert(cComponents <= RT_ELEMENTS(afBuf));" 226 224 print "\tmemset(afBuf, 0, sizeof (afBuf));" … … 247 245 print "\tcrDmpStrF(pRec->pDumper, \"===%s===\");" % coord 248 246 for pname in texgen_names: 249 print "\tcComponents = lookupComponents(%s);" % pname247 print "\tcComponents = crStateHlpComponentsCount(%s);" % pname 250 248 print "\tAssert(cComponents <= RT_ELEMENTS(afBuf));" 251 249 print "\tmemset(afBuf, 0, sizeof (afBuf));" -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_get.py
r23694 r50041 234 234 print '\t}' 235 235 print '}' 236 237 from get_components import * -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_glsl.c
r48247 r50041 259 259 } 260 260 261 DECLEXPORT(GLuint) STATE_APIENTRY crStateDeleteObjectARB( GLhandleARB obj )261 DECLEXPORT(GLuint) STATE_APIENTRY crStateDeleteObjectARB( VBoxGLhandleARB obj ) 262 262 { 263 263 GLuint hwId = crStateGetProgramHWID(obj); -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_point.c
r46037 r50041 201 201 crStatePointParameterfvARB( pname, &f_param ); 202 202 } 203 204 void crStatePointDiff(CRPointBits *b, CRbitvalue *bitID, 205 CRContext *fromCtx, CRContext *toCtx) 206 { 207 CRPointState *from = &(fromCtx->point); 208 CRPointState *to = &(toCtx->point); 209 unsigned int j, i; 210 CRbitvalue nbitID[CR_MAX_BITARRAY]; 211 Assert(0); 212 for (j=0;j<CR_MAX_BITARRAY;j++) 213 nbitID[j] = ~bitID[j]; 214 i = 0; /* silence compiler */ 215 if (CHECKDIRTY(b->enableSmooth, bitID)) 216 { 217 glAble able[2]; 218 able[0] = diff_api.Disable; 219 able[1] = diff_api.Enable; 220 if (from->pointSmooth != to->pointSmooth) 221 { 222 able[to->pointSmooth](GL_POINT_SMOOTH); 223 from->pointSmooth = to->pointSmooth; 224 } 225 CLEARDIRTY(b->enableSmooth, nbitID); 226 } 227 if (CHECKDIRTY(b->size, bitID)) 228 { 229 if (from->pointSize != to->pointSize) 230 { 231 diff_api.PointSize (to->pointSize); 232 from->pointSize = to->pointSize; 233 } 234 CLEARDIRTY(b->size, nbitID); 235 } 236 if (CHECKDIRTY(b->minSize, bitID)) 237 { 238 if (from->minSize != to->minSize) 239 { 240 diff_api.PointParameterfARB (GL_POINT_SIZE_MIN_ARB, to->minSize); 241 from->minSize = to->minSize; 242 } 243 CLEARDIRTY(b->minSize, nbitID); 244 } 245 if (CHECKDIRTY(b->maxSize, bitID)) 246 { 247 if (from->maxSize != to->maxSize) 248 { 249 diff_api.PointParameterfARB (GL_POINT_SIZE_MAX_ARB, to->maxSize); 250 from->maxSize = to->maxSize; 251 } 252 CLEARDIRTY(b->maxSize, nbitID); 253 } 254 if (CHECKDIRTY(b->fadeThresholdSize, bitID)) 255 { 256 if (from->fadeThresholdSize != to->fadeThresholdSize) 257 { 258 diff_api.PointParameterfARB (GL_POINT_FADE_THRESHOLD_SIZE_ARB, to->fadeThresholdSize); 259 from->fadeThresholdSize = to->fadeThresholdSize; 260 } 261 CLEARDIRTY(b->fadeThresholdSize, nbitID); 262 } 263 if (CHECKDIRTY(b->spriteCoordOrigin, bitID)) 264 { 265 if (from->spriteCoordOrigin != to->spriteCoordOrigin) 266 { 267 diff_api.PointParameterfARB (GL_POINT_SPRITE_COORD_ORIGIN, to->spriteCoordOrigin); 268 from->spriteCoordOrigin = to->spriteCoordOrigin; 269 } 270 CLEARDIRTY(b->spriteCoordOrigin, nbitID); 271 } 272 if (CHECKDIRTY(b->distanceAttenuation, bitID)) 273 { 274 if (from->distanceAttenuation[0] != to->distanceAttenuation[0] || from->distanceAttenuation[1] != to->distanceAttenuation[1] || from->distanceAttenuation[2] != to->distanceAttenuation[2]) { 275 diff_api.PointParameterfvARB (GL_POINT_DISTANCE_ATTENUATION_ARB, to->distanceAttenuation); 276 from->distanceAttenuation[0] = to->distanceAttenuation[0]; 277 from->distanceAttenuation[1] = to->distanceAttenuation[1]; 278 from->distanceAttenuation[2] = to->distanceAttenuation[2]; 279 } 280 CLEARDIRTY(b->distanceAttenuation, nbitID); 281 } 282 if (CHECKDIRTY(b->enableSprite, bitID)) 283 { 284 glAble able[2]; 285 able[0] = diff_api.Disable; 286 able[1] = diff_api.Enable; 287 if (from->pointSprite != to->pointSprite) 288 { 289 able[to->pointSprite](GL_POINT_SPRITE_ARB); 290 from->pointSprite = to->pointSprite; 291 } 292 CLEARDIRTY(b->enableSprite, nbitID); 293 } 294 { 295 unsigned int activeUnit = (unsigned int) -1; 296 for (i = 0; i < CR_MAX_TEXTURE_UNITS; i++) { 297 if (CHECKDIRTY(b->coordReplacement[i], bitID)) 298 { 299 GLint replacement = to->coordReplacement[i]; 300 if (activeUnit != i) { 301 diff_api.ActiveTextureARB(i + GL_TEXTURE0_ARB ); 302 activeUnit = i; 303 } 304 diff_api.TexEnviv(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, &replacement); 305 from->coordReplacement[i] = to->coordReplacement[i]; 306 CLEARDIRTY(b->coordReplacement[i], nbitID); 307 } 308 } 309 if (activeUnit != toCtx->texture.curTextureUnit) 310 diff_api.ActiveTextureARB(GL_TEXTURE0 + toCtx->texture.curTextureUnit); 311 } 312 CLEARDIRTY(b->dirty, nbitID); 313 } 314 315 void crStatePointSwitch(CRPointBits *b, CRbitvalue *bitID, 316 CRContext *fromCtx, CRContext *toCtx) 317 { 318 CRPointState *from = &(fromCtx->point); 319 CRPointState *to = &(toCtx->point); 320 unsigned int j, i; 321 GLboolean fEnabled; 322 CRbitvalue nbitID[CR_MAX_BITARRAY]; 323 for (j=0;j<CR_MAX_BITARRAY;j++) 324 nbitID[j] = ~bitID[j]; 325 i = 0; /* silence compiler */ 326 if (CHECKDIRTY(b->enableSmooth, bitID)) 327 { 328 glAble able[2]; 329 able[0] = diff_api.Disable; 330 able[1] = diff_api.Enable; 331 if (from->pointSmooth != to->pointSmooth) 332 { 333 able[to->pointSmooth](GL_POINT_SMOOTH); 334 FILLDIRTY(b->enableSmooth); 335 FILLDIRTY(b->dirty); 336 } 337 CLEARDIRTY(b->enableSmooth, nbitID); 338 } 339 if (CHECKDIRTY(b->size, bitID)) 340 { 341 if (from->pointSize != to->pointSize) 342 { 343 diff_api.PointSize (to->pointSize); 344 FILLDIRTY(b->size); 345 FILLDIRTY(b->dirty); 346 } 347 CLEARDIRTY(b->size, nbitID); 348 } 349 if (CHECKDIRTY(b->minSize, bitID)) 350 { 351 if (from->minSize != to->minSize) 352 { 353 diff_api.PointParameterfARB (GL_POINT_SIZE_MIN_ARB, to->minSize); 354 FILLDIRTY(b->minSize); 355 FILLDIRTY(b->dirty); 356 } 357 CLEARDIRTY(b->minSize, nbitID); 358 } 359 if (CHECKDIRTY(b->maxSize, bitID)) 360 { 361 if (from->maxSize != to->maxSize) 362 { 363 diff_api.PointParameterfARB (GL_POINT_SIZE_MAX_ARB, to->maxSize); 364 FILLDIRTY(b->maxSize); 365 FILLDIRTY(b->dirty); 366 } 367 CLEARDIRTY(b->maxSize, nbitID); 368 } 369 if (CHECKDIRTY(b->fadeThresholdSize, bitID)) 370 { 371 if (from->fadeThresholdSize != to->fadeThresholdSize) 372 { 373 diff_api.PointParameterfARB (GL_POINT_FADE_THRESHOLD_SIZE_ARB, to->fadeThresholdSize); 374 FILLDIRTY(b->fadeThresholdSize); 375 FILLDIRTY(b->dirty); 376 } 377 CLEARDIRTY(b->fadeThresholdSize, nbitID); 378 } 379 if (CHECKDIRTY(b->spriteCoordOrigin, bitID)) 380 { 381 if (from->spriteCoordOrigin != to->spriteCoordOrigin) 382 { 383 diff_api.PointParameterfARB (GL_POINT_SPRITE_COORD_ORIGIN, to->spriteCoordOrigin); 384 FILLDIRTY(b->spriteCoordOrigin); 385 FILLDIRTY(b->dirty); 386 } 387 CLEARDIRTY(b->spriteCoordOrigin, nbitID); 388 } 389 if (CHECKDIRTY(b->distanceAttenuation, bitID)) 390 { 391 if (from->distanceAttenuation[0] != to->distanceAttenuation[0] || from->distanceAttenuation[1] != to->distanceAttenuation[1] || from->distanceAttenuation[2] != to->distanceAttenuation[2]) { 392 diff_api.PointParameterfvARB (GL_POINT_DISTANCE_ATTENUATION_ARB, to->distanceAttenuation); 393 FILLDIRTY(b->distanceAttenuation); 394 FILLDIRTY(b->dirty); 395 } 396 CLEARDIRTY(b->distanceAttenuation, nbitID); 397 } 398 fEnabled = from->pointSprite; 399 { 400 unsigned int activeUnit = (unsigned int) -1; 401 for (i = 0; i < CR_MAX_TEXTURE_UNITS; i++) { 402 if (CHECKDIRTY(b->coordReplacement[i], bitID)) 403 { 404 if (!fEnabled) 405 { 406 diff_api.Enable(GL_POINT_SPRITE_ARB); 407 fEnabled = GL_TRUE; 408 } 409 #if 0 410 /*don't set coord replacement, it will be set just before drawing points when necessary, 411 * to work around gpu driver bugs 412 * See crServerDispatch[Begin|End|Draw*] */ 413 GLint replacement = to->coordReplacement[i]; 414 if (activeUnit != i) { 415 diff_api.ActiveTextureARB(i + GL_TEXTURE0_ARB ); 416 activeUnit = i; 417 } 418 diff_api.TexEnviv(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, &replacement); 419 #endif 420 CLEARDIRTY(b->coordReplacement[i], nbitID); 421 } 422 } 423 if (activeUnit != toCtx->texture.curTextureUnit) 424 diff_api.ActiveTextureARB(GL_TEXTURE0 + toCtx->texture.curTextureUnit); 425 } 426 if (CHECKDIRTY(b->enableSprite, bitID)) 427 { 428 glAble able[2]; 429 able[0] = diff_api.Disable; 430 able[1] = diff_api.Enable; 431 if (fEnabled != to->pointSprite) 432 { 433 able[to->pointSprite](GL_POINT_SPRITE_ARB); 434 FILLDIRTY(b->enableSprite); 435 FILLDIRTY(b->dirty); 436 } 437 CLEARDIRTY(b->enableSprite, nbitID); 438 } 439 else if (fEnabled != to->pointSprite) 440 { 441 glAble able[2]; 442 able[0] = diff_api.Disable; 443 able[1] = diff_api.Enable; 444 able[to->pointSprite](GL_POINT_SPRITE_ARB); 445 } 446 CLEARDIRTY(b->dirty, nbitID); 447 } -
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_texture.c
r48491 r50041 3260 3260 const GLclampf *priorities) 3261 3261 { 3262 UNUSED(n); 3263 UNUSED(textures); 3262 CRContext *g = GetCurrentContext(); 3263 CRTextureObj *tobj; 3264 GLsizei i; 3264 3265 UNUSED(priorities); 3265 /* TODO: */ 3266 3267 for (i = 0; i < n; ++i) 3268 { 3269 GLuint tex = textures[i]; 3270 GET_TOBJ(tobj, g, tex); 3271 if (!tobj) 3272 { 3273 Assert(crHashtableIsKeyUsed(g->shared->textureTable, tex)); 3274 tobj = crStateTextureAllocate_t(g, tex); 3275 } 3276 3277 /* so far the code just ensures the tex object is created to make 3278 * the crserverlib code be able to pass it to host ogl */ 3279 3280 /* TODO: store texture priorities in the state data to be able to restore it properly 3281 * on save state load */ 3282 } 3283 3266 3284 return; 3267 3285 }
Note:
See TracChangeset
for help on using the changeset viewer.