Changeset 73297 in vbox for trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
- Timestamp:
- Jul 21, 2018 8:20:44 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
r73296 r73297 1837 1837 break; 1838 1838 1839 case SVGA3D_R8G8B8A8_SNORM: 1840 pSurface->internalFormatGL = GL_RGB8; 1841 pSurface->formatGL = GL_BGRA; 1842 pSurface->typeGL = GL_UNSIGNED_INT_8_8_8_8_REV; 1843 AssertMsgFailed(("test me - SVGA3D_R8G8B8A8_SNORM\n")); 1844 break; 1845 case SVGA3D_R16G16_UNORM: 1846 pSurface->internalFormatGL = GL_RG16; 1847 pSurface->formatGL = GL_RG; 1848 pSurface->typeGL = GL_UNSIGNED_SHORT; 1849 AssertMsgFailed(("test me - SVGA3D_R16G16_UNORM\n")); 1850 break; 1851 1839 1852 #if 0 1840 1853 /* Packed Video formats */ … … 2667 2680 2668 2681 return rc; 2669 }2670 2671 2672 int vmsvga3dSurfaceBlitToScreen(PVGASTATE pThis, uint32_t dest, SVGASignedRect destRect, SVGA3dSurfaceImageId src, SVGASignedRect srcRect, uint32_t cRects, SVGASignedRect *pRect)2673 {2674 /* Requires SVGA_FIFO_CAP_SCREEN_OBJECT support */2675 Log(("vmsvga3dSurfaceBlitToScreen: dest=%d (%d,%d)(%d,%d) surface=%x (face=%d, mipmap=%d) (%d,%d)(%d,%d) cRects=%d\n", dest, destRect.left, destRect.top, destRect.right, destRect.bottom, src.sid, src.face, src.mipmap, srcRect.left, srcRect.top, srcRect.right, srcRect.bottom, cRects));2676 for (uint32_t i = 0; i < cRects; i++)2677 {2678 Log(("vmsvga3dSurfaceBlitToScreen: clipping rect %d (%d,%d)(%d,%d)\n", i, pRect[i].left, pRect[i].top, pRect[i].right, pRect[i].bottom));2679 }2680 2681 /** @todo Only screen 0 for now. */2682 AssertReturn(dest == 0, VERR_INTERNAL_ERROR);2683 AssertReturn(src.mipmap == 0 && src.face == 0, VERR_INVALID_PARAMETER);2684 /** @todo scaling */2685 AssertReturn(destRect.right - destRect.left == srcRect.right - srcRect.left && destRect.bottom - destRect.top == srcRect.bottom - srcRect.top, VERR_INVALID_PARAMETER);2686 2687 if (cRects == 0)2688 {2689 /* easy case; no clipping */2690 SVGA3dCopyBox box;2691 SVGA3dGuestImage dst;2692 2693 box.x = destRect.left;2694 box.y = destRect.top;2695 box.z = 0;2696 box.w = destRect.right - destRect.left;2697 box.h = destRect.bottom - destRect.top;2698 box.d = 1;2699 box.srcx = srcRect.left;2700 box.srcy = srcRect.top;2701 box.srcz = 0;2702 2703 dst.ptr.gmrId = SVGA_GMR_FRAMEBUFFER;2704 dst.ptr.offset = pThis->svga.uScreenOffset;2705 dst.pitch = pThis->svga.cbScanline;2706 2707 int rc = vmsvga3dSurfaceDMA(pThis, dst, src, SVGA3D_READ_HOST_VRAM, 1, &box);2708 AssertRCReturn(rc, rc);2709 2710 vgaR3UpdateDisplay(pThis, box.x, box.y, box.w, box.h);2711 return VINF_SUCCESS;2712 }2713 else2714 {2715 SVGA3dGuestImage dst;2716 SVGA3dCopyBox box;2717 2718 box.srcz = 0;2719 box.z = 0;2720 box.d = 1;2721 2722 dst.ptr.gmrId = SVGA_GMR_FRAMEBUFFER;2723 dst.ptr.offset = pThis->svga.uScreenOffset;2724 dst.pitch = pThis->svga.cbScanline;2725 2726 /** @todo merge into one SurfaceDMA call */2727 for (uint32_t i = 0; i < cRects; i++)2728 {2729 /* The clipping rectangle is relative to the top-left corner of srcRect & destRect. Adjust here. */2730 box.srcx = srcRect.left + pRect[i].left;2731 box.srcy = srcRect.top + pRect[i].top;2732 2733 box.x = pRect[i].left + destRect.left;2734 box.y = pRect[i].top + destRect.top;2735 box.z = 0;2736 box.w = pRect[i].right - pRect[i].left;2737 box.h = pRect[i].bottom - pRect[i].top;2738 2739 int rc = vmsvga3dSurfaceDMA(pThis, dst, src, SVGA3D_READ_HOST_VRAM, 1, &box);2740 AssertRCReturn(rc, rc);2741 2742 vgaR3UpdateDisplay(pThis, box.x, box.y, box.w, box.h);2743 }2744 2745 return VINF_SUCCESS;2746 }2747 2682 } 2748 2683
Note:
See TracChangeset
for help on using the changeset viewer.