Changeset 21308 in vbox for trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_client.c
- Timestamp:
- Jul 7, 2009 10:49:52 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_client.c
r15532 r21308 1312 1312 } 1313 1313 1314 /*Returns if the given clientpointer could be used on server side directly*/ 1315 #define CRSTATE_IS_SERVER_CP(cp) (!(cp).enabled || !(cp).p || ((cp).buffer && (cp).buffer->name)) 1316 1317 static crStateDumpClientPointer(CRClientPointer *cp, const char *name, int i) 1318 { 1319 if (i<0 && cp->enabled) 1320 { 1321 crDebug("CP(%s): enabled:%d ptr:%p buffer:%p buffer.name:%i %s", 1322 name, cp->enabled, cp->p, cp->buffer, cp->buffer? cp->buffer->name:-1, 1323 CRSTATE_IS_SERVER_CP(*cp) ? "":"!FAIL!"); 1324 } 1325 else if (0==i || cp->enabled) 1326 { 1327 crDebug("CP(%s%i): enabled:%d ptr:%p buffer:%p buffer.name:%i %s", 1328 name, i, cp->enabled, cp->p, cp->buffer, cp->buffer? cp->buffer->name:-1, 1329 CRSTATE_IS_SERVER_CP(*cp) ? "":"!FAIL!"); 1330 } 1331 } 1314 1332 1315 1333 /* … … 1323 1341 CRClientState *c = &(g->client); 1324 1342 int i; 1325 1326 if (!c->array.v.enabled) 1327 return GL_FALSE; 1328 1329 if (c->array.v.enabled && (!c->array.v.buffer || !c->array.v.buffer->name)) 1330 return GL_FALSE; 1331 1332 if (c->array.n.enabled && (!c->array.n.buffer || !c->array.n.buffer->name)) 1333 return GL_FALSE; 1334 1335 if (c->array.c.enabled && (!c->array.c.buffer || !c->array.c.buffer->name)) 1336 return GL_FALSE; 1337 1338 if (c->array.i.enabled && (!c->array.i.buffer || !c->array.i.buffer->name)) 1339 return GL_FALSE; 1343 GLboolean res; 1344 1345 res = CRSTATE_IS_SERVER_CP(c->array.v) 1346 && CRSTATE_IS_SERVER_CP(c->array.n) 1347 && CRSTATE_IS_SERVER_CP(c->array.c) 1348 && CRSTATE_IS_SERVER_CP(c->array.i) 1349 && CRSTATE_IS_SERVER_CP(c->array.e) 1350 && CRSTATE_IS_SERVER_CP(c->array.s) 1351 && CRSTATE_IS_SERVER_CP(c->array.f); 1340 1352 1341 1353 for (i = 0; (unsigned int)i < g->limits.maxTextureUnits; i++) 1342 if (c->array.t[i].enabled && (!c->array.t[i].buffer || !c->array.t[i].buffer->name)) 1343 return GL_FALSE; 1344 1345 if (c->array.e.enabled && (!c->array.e.buffer || !c->array.e.buffer->name)) 1346 return GL_FALSE; 1347 1348 if (c->array.s.enabled && (!c->array.s.buffer || !c->array.s.buffer->name)) 1349 return GL_FALSE; 1350 1351 if (c->array.f.enabled && (!c->array.f.buffer || !c->array.f.buffer->name)) 1352 return GL_FALSE; 1354 if (!CRSTATE_IS_SERVER_CP(c->array.t[i])) 1355 { 1356 res = GL_FALSE; 1357 break; 1358 } 1353 1359 1354 1360 for (i = 0; (unsigned int)i < g->limits.maxVertexProgramAttribs; i++) 1355 if (c->array.a[i].enabled && (!c->array.a[i].buffer || !c->array.a[i].buffer->name)) 1356 return GL_FALSE; 1357 1358 return GL_TRUE; 1361 if (!CRSTATE_IS_SERVER_CP(c->array.a[i])) 1362 { 1363 res = GL_FALSE; 1364 break; 1365 } 1366 1367 if (!res) 1368 { 1369 crStateDumpClientPointer(&c->array.v, "v", -1); 1370 crStateDumpClientPointer(&c->array.n, "n", -1); 1371 crStateDumpClientPointer(&c->array.c, "c", -1); 1372 crStateDumpClientPointer(&c->array.i, "i", -1); 1373 crStateDumpClientPointer(&c->array.e, "e", -1); 1374 crStateDumpClientPointer(&c->array.s, "s", -1); 1375 crStateDumpClientPointer(&c->array.f, "f", -1); 1376 for (i = 0; (unsigned int)i < g->limits.maxTextureUnits; i++) 1377 crStateDumpClientPointer(&c->array.t[i], "tex", i); 1378 for (i = 0; (unsigned int)i < g->limits.maxVertexProgramAttribs; i++) 1379 crStateDumpClientPointer(&c->array.a[i], "attrib", i); 1380 crDebug("crStateUseServerArrays->%d", res); 1381 } 1382 1383 return res; 1359 1384 #else 1360 1385 return GL_FALSE;
Note:
See TracChangeset
for help on using the changeset viewer.