Changeset 44812 in vbox for trunk/src/VBox/GuestHost/OpenGL/state_tracker
- Timestamp:
- Feb 25, 2013 6:32:06 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 83932
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_diff.c
r44802 r44812 164 164 CRFBDataElement *el = &data->aElements[i]; 165 165 166 switch (el->enmFormat) 167 { 168 case GL_DEPTH_COMPONENT: 169 if (!to->buffer.depthTest) 170 { 171 diff_api.Enable(GL_DEPTH_TEST); 172 } 173 if (to->pixel.depthScale != 1.0f) 174 { 175 diff_api.PixelTransferf (GL_DEPTH_SCALE, 1.0f); 176 } 177 if (to->pixel.depthBias != 0.0f) 178 { 179 diff_api.PixelTransferf (GL_DEPTH_BIAS, 0.0f); 180 } 181 break; 182 case GL_STENCIL_INDEX: 183 if (!to->stencil.stencilTest) 184 { 185 diff_api.Enable(GL_STENCIL_TEST); 186 } 187 if (to->pixel.mapStencil) 188 { 189 diff_api.PixelTransferi (GL_MAP_STENCIL, GL_FALSE); 190 } 191 if (to->pixel.indexOffset) 192 { 193 diff_api.PixelTransferi (GL_INDEX_OFFSET, 0); 194 } 195 if (to->pixel.indexShift) 196 { 197 diff_api.PixelTransferi (GL_INDEX_SHIFT, 0); 198 } 199 break; 200 default: 201 break; 202 } 203 166 204 diff_api.BindFramebufferEXT(GL_READ_FRAMEBUFFER, el->idFBO); 167 205 … … 171 209 diff_api.ReadPixels(el->posX, el->posY, el->width, el->height, el->enmFormat, el->enmType, el->pvData); 172 210 crDebug("Acquired %d;%d;%d;%d;%d;0x%p fb image", el->enmBuffer, el->width, el->height, el->enmFormat, el->enmType, el->pvData); 211 212 switch (el->enmFormat) 213 { 214 case GL_DEPTH_COMPONENT: 215 if (to->pixel.depthScale != 1.0f) 216 { 217 diff_api.PixelTransferf (GL_DEPTH_SCALE, to->pixel.depthScale); 218 } 219 if (to->pixel.depthBias != 0.0f) 220 { 221 diff_api.PixelTransferf (GL_DEPTH_BIAS, to->pixel.depthBias); 222 } 223 if (!to->buffer.depthTest) 224 { 225 diff_api.Disable(GL_DEPTH_TEST); 226 } 227 break; 228 case GL_STENCIL_INDEX: 229 if (to->pixel.indexOffset) 230 { 231 diff_api.PixelTransferi (GL_INDEX_OFFSET, to->pixel.indexOffset); 232 } 233 if (to->pixel.indexShift) 234 { 235 diff_api.PixelTransferi (GL_INDEX_SHIFT, to->pixel.indexShift); 236 } 237 if (to->pixel.mapStencil) 238 { 239 diff_api.PixelTransferi (GL_MAP_STENCIL, GL_TRUE); 240 } 241 if (!to->stencil.stencilTest) 242 { 243 diff_api.Disable(GL_STENCIL_TEST); 244 } 245 break; 246 default: 247 break; 248 } 173 249 } 174 250 … … 231 307 diff_api.Disable(GL_BLEND); 232 308 diff_api.Disable(GL_COLOR_LOGIC_OP); 309 diff_api.Disable(GL_DEPTH_TEST); 310 diff_api.Disable(GL_STENCIL_TEST); 233 311 234 312 for (i = 0; i < data->cElements; ++i) … … 240 318 case GL_DEPTH_COMPONENT: 241 319 diff_api.Enable(GL_DEPTH_TEST); 320 if (to->pixel.depthScale != 1.0f) 321 { 322 diff_api.PixelTransferf (GL_DEPTH_SCALE, 1.0f); 323 } 324 if (to->pixel.depthBias != 0.0f) 325 { 326 diff_api.PixelTransferf (GL_DEPTH_BIAS, 0.0f); 327 } 242 328 break; 243 329 case GL_STENCIL_INDEX: 244 330 diff_api.Enable(GL_STENCIL_TEST); 331 if (to->pixel.mapStencil) 332 { 333 diff_api.PixelTransferi (GL_MAP_STENCIL, GL_FALSE); 334 } 335 if (to->pixel.indexOffset) 336 { 337 diff_api.PixelTransferi (GL_INDEX_OFFSET, 0); 338 } 339 if (to->pixel.indexShift) 340 { 341 diff_api.PixelTransferi (GL_INDEX_SHIFT, 0); 342 } 245 343 break; 246 344 default: … … 248 346 } 249 347 348 250 349 diff_api.BindFramebufferEXT(GL_DRAW_FRAMEBUFFER, el->idFBO); 251 350 … … 260 359 { 261 360 case GL_DEPTH_COMPONENT: 262 if (!to->buffer.depthTest) 263 { 264 diff_api.Disable(GL_DEPTH_TEST); 265 } 361 if (to->pixel.depthScale != 1.0f) 362 { 363 diff_api.PixelTransferf (GL_DEPTH_SCALE, to->pixel.depthScale); 364 } 365 if (to->pixel.depthBias != 0.0f) 366 { 367 diff_api.PixelTransferf (GL_DEPTH_BIAS, to->pixel.depthBias); 368 } 369 diff_api.Disable(GL_DEPTH_TEST); 266 370 break; 267 371 case GL_STENCIL_INDEX: 268 if (!to->stencil.stencilTest) 269 { 270 diff_api.Disable(GL_STENCIL_TEST); 271 } 372 if (to->pixel.indexOffset) 373 { 374 diff_api.PixelTransferi (GL_INDEX_OFFSET, to->pixel.indexOffset); 375 } 376 if (to->pixel.indexShift) 377 { 378 diff_api.PixelTransferi (GL_INDEX_SHIFT, to->pixel.indexShift); 379 } 380 if (to->pixel.mapStencil) 381 { 382 diff_api.PixelTransferi (GL_MAP_STENCIL, GL_TRUE); 383 } 384 diff_api.Disable(GL_STENCIL_TEST); 272 385 break; 273 386 default: 274 387 break; 275 388 } 276 277 389 } 278 390 … … 313 425 { 314 426 diff_api.Enable(GL_COLOR_LOGIC_OP); 427 } 428 if (to->buffer.depthTest) 429 { 430 diff_api.Enable(GL_DEPTH_TEST); 431 } 432 if (to->stencil.stencilTest) 433 { 434 diff_api.Enable(GL_STENCIL_TEST); 315 435 } 316 436
Note:
See TracChangeset
for help on using the changeset viewer.