Changeset 81618 in vbox
- Timestamp:
- Nov 1, 2019 12:54:34 AM (5 years ago)
- Location:
- trunk/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/gallium
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/gallium/drivers/svga/svga_pipe_blit.c
r79768 r81618 609 609 svga_toggle_render_condition(svga, blit.render_condition_enable, FALSE); 610 610 611 #ifdef VBOX_WITH_MESA3D_NINE_SVGA 612 /* Flip Y. 613 * 614 * util_blitter draws a textured quad using the source as the texture and sets 615 * the texcoords for the destination quad vertices using OpenGL texture coordinates: 616 * bottom,left = 0,0; top,right = 1,1. 617 * 618 * But the VMSVGA device uses the uses D3D texture coords: 619 * top,left=0,0; bottom,right = 1,1. 620 */ 621 blit.dst.box.y = u_minify(dst->height0, blit.dst.level) - blit.dst.box.y - blit.dst.box.height; 622 623 blit.src.box.y = u_minify(src->height0, blit.src.level) - blit.src.box.y; 624 blit.src.box.height = -blit.src.box.height; 625 #endif 611 626 util_blitter_blit(svga->blitter, &blit); 612 627 -
trunk/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/gallium/drivers/svga/svga_pipe_clear.c
r75443 r81618 352 352 &svga->curr.framebuffer); 353 353 begin_blit(svga); 354 #ifdef VBOX_WITH_MESA3D_NINE_SVGA 355 /* Flip Y. 356 * 357 * util_blitter draws a quad using OpenGL coordinates: y up. 358 * 359 * But the VMSVGA device uses the D3D coords: y down. 360 */ 361 unsigned dsty = dsv->height - box->y - box->height; 362 util_blitter_clear_depth_stencil(svga->blitter, 363 dsv, clear_flags, 364 depth,stencil, 365 box->x, dsty, 366 box->width, box->height); 367 #else 354 368 util_blitter_clear_depth_stencil(svga->blitter, 355 369 dsv, clear_flags, … … 357 371 box->x, box->y, 358 372 box->width, box->height); 373 #endif 359 374 } 360 375 } … … 428 443 &svga->curr.framebuffer); 429 444 begin_blit(svga); 445 #ifdef VBOX_WITH_MESA3D_NINE_SVGA 446 /* Flip Y. See comment in svga_clear_texture */ 447 unsigned dsty = rtv->height - box->y - box->height; 448 util_blitter_clear_render_target(svga->blitter, 449 rtv, 450 &color, 451 box->x, dsty, 452 box->width, box->height); 453 #else 430 454 util_blitter_clear_render_target(svga->blitter, 431 455 rtv, … … 433 457 box->x, box->y, 434 458 box->width, box->height); 459 #endif 435 460 } 436 461 else { … … 501 526 util_blitter_save_framebuffer(svga->blitter, &svga->curr.framebuffer); 502 527 528 #ifdef VBOX_WITH_MESA3D_NINE_SVGA 529 /* Flip Y. See comment in svga_clear_texture */ 530 dsty = dst->height - dsty - height; 531 #endif 503 532 util_blitter_clear_render_target(svga->blitter, dst, color, 504 533 dstx, dsty, width, height); … … 566 595 begin_blit(svga); 567 596 util_blitter_save_framebuffer(svga->blitter, &svga->curr.framebuffer); 597 598 #ifdef VBOX_WITH_MESA3D_NINE_SVGA 599 /* Flip Y. See comment in svga_clear_texture */ 600 dsty = dst->height - dsty - height; 601 #endif 568 602 util_blitter_clear_depth_stencil(svga->blitter, 569 603 dst, clear_flags, -
trunk/src/VBox/Additions/3D/mesa/mesa-17.3.9/src/gallium/state_trackers/nine/nine_state.c
r81576 r81618 1351 1351 blit.scissor_enable = FALSE; 1352 1352 1353 #ifdef VBOX_WITH_MESA3D_NINE_SVGA1354 /* Flip Y because the state tracker uses the D3D texture coords:1355 * top,left=0,0; bottom,right = 1,1.1356 * While the blit draws a quad using the source as texture and sets1357 * the texcoords for destination vertices using the OpenGL coordinates:1358 * bottom,left = 0,0; top,right = 1,1.1359 */1360 {1361 struct pipe_blit_info b = blit;1362 1363 b.dst.box.y = b.dst.resource->height0 - b.dst.box.y - b.dst.box.height;1364 1365 b.src.box.y = b.src.resource->height0 - b.src.box.y;1366 b.src.box.height = -b.src.box.height;1367 1368 context->pipe->blit(context->pipe, &b);1369 }1370 #else1371 1353 context->pipe->blit(context->pipe, &blit); 1372 #endif1373 1354 } 1374 1355 … … 2518 2499 2519 2500 DBG("Clearing (%u..%u)x(%u..%u)\n", x1, x2, y1, y2); 2520 #ifdef VBOX_WITH_MESA3D_NINE_SVGA2521 /* Flip Y because the nine state tracker uses the D3D coords:2522 * top,left=0,0; bottom,right = 1,1.2523 * While the clear_render_target draws a quad and sets the texcoords2524 * for the destination vertices using the OpenGL coordinates:2525 * bottom,left = 0,0; top,right = 1,1.2526 */2527 unsigned const height = y2 - y1;2528 y1 = cbuf->height - y1 - height;2529 pipe->clear_render_target(pipe, cbuf, &rgba,2530 x1, y1, x2 - x1, height, false);2531 #else2532 2501 pipe->clear_render_target(pipe, cbuf, &rgba, 2533 2502 x1, y1, x2 - x1, y2 - y1, false); 2534 #endif2535 2503 } 2536 2504 } … … 2559 2527 assert(zsbuf); 2560 2528 2561 #ifdef VBOX_WITH_MESA3D_NINE_SVGA2562 /* Flip Y because the nine state tracker uses the D3D coords:2563 * top,left=0,0; bottom,right = 1,1.2564 * While the clear_depth_stencil draws a quad and sets the texcoords2565 * for the destination vertices using the OpenGL coordinates:2566 * bottom,left = 0,0; top,right = 1,1.2567 */2568 unsigned const height = y2 - y1;2569 y1 = zsbuf->height - y1 - height;2570 pipe->clear_depth_stencil(pipe, zsbuf, bufs, Z, Stencil,2571 x1, y1, x2 - x1, height, false);2572 #else2573 2529 pipe->clear_depth_stencil(pipe, zsbuf, bufs, Z, Stencil, 2574 2530 x1, y1, x2 - x1, y2 - y1, false); 2575 #endif2576 2531 } 2577 2532 return; … … 2713 2668 (void) src; 2714 2669 2715 #ifdef VBOX_WITH_MESA3D_NINE_SVGA2716 /* This seems to work correctly and does not require Y flip. */2717 #endif2718 2670 context->pipe->resource_copy_region(context->pipe, 2719 2671 dst_res, dst_level, … … 2733 2685 (void) src; 2734 2686 2735 #ifdef VBOX_WITH_MESA3D_NINE_SVGA2736 /* Flip Y because the state tracker uses D3D texture coords:2737 * top,left=0,0; bottom,right = 1,1.2738 * While the blit draws a quad using the source as texture and sets2739 * texcoords for destination vertices using OpenGL coordinates:2740 * bottom,left = 0,0; top,right = 1,1.2741 */2742 {2743 struct pipe_blit_info b = *blit;2744 2745 b.dst.box.y = b.dst.resource->height0 - b.dst.box.y - b.dst.box.height;2746 2747 b.src.box.y = b.src.resource->height0 - b.src.box.y;2748 b.src.box.height = -b.src.box.height;2749 2750 context->pipe->blit(context->pipe, &b);2751 }2752 #else2753 2687 context->pipe->blit(context->pipe, blit); 2754 #endif2755 2688 } 2756 2689 … … 2769 2702 d3dcolor_to_pipe_color_union(&rgba, color); 2770 2703 surf = NineSurface9_GetSurface(surface, 0); 2771 #ifdef VBOX_WITH_MESA3D_NINE_SVGA2772 /* Flip Y because the nine state tracker uses D3D coords:2773 * top,left=0,0; bottom,right = 1,1.2774 * While the clear_render_target draws a quad sets texcoords2775 * for destination vertices using OpenGL coordinates:2776 * bottom,left = 0,0; top,right = 1,1.2777 */2778 /** @todo Figure out how to avoid such mismatches in a generic way. */2779 y = surf->height - y - height;2780 #endif2781 2704 context->pipe->clear_render_target(context->pipe, surf, &rgba, x, y, width, height, false); 2782 2705 }
Note:
See TracChangeset
for help on using the changeset viewer.