Changeset 75752 in vbox for trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
- Timestamp:
- Nov 26, 2018 8:05:57 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
r75715 r75752 667 667 GLGETPROC_(PFNGLCOMPRESSEDTEXIMAGE2DPROC , glCompressedTexImage2D, ""); 668 668 GLGETPROC_(PFNGLCOMPRESSEDTEXIMAGE3DPROC , glCompressedTexImage3D, ""); 669 GLGETPROC_(PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC , glCompressedTexSubImage2D, ""); 669 670 GLGETPROC_(PFNGLPOINTPARAMETERFPROC , glPointParameterf, ""); 670 671 GLGETPROC_(PFNGLBLENDEQUATIONSEPARATEPROC , glBlendEquationSeparate, ""); … … 1226 1227 case SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8: 1227 1228 case SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8: 1228 //case SVGA3D_DEVCAP_SURFACEFMT_Z_DF16:1229 case SVGA3D_DEVCAP_SURFACEFMT_Z_DF16: 1229 1230 case SVGA3D_DEVCAP_SURFACEFMT_Z_DF24: 1230 1231 case SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT: … … 1572 1573 void vmsvga3dSurfaceFormat2OGL(PVMSVGA3DSURFACE pSurface, SVGA3dSurfaceFormat format) 1573 1574 { 1575 #if 0 1576 #define AssertTestFmt(f) AssertMsgFailed(("Test me - " #f "\n")) 1577 #else 1578 #define AssertTestFmt(f) do {} while(0) 1579 #endif 1574 1580 switch (format) 1575 1581 { … … 1588 1594 pSurface->formatGL = GL_RGB; 1589 1595 pSurface->typeGL = GL_UNSIGNED_SHORT_5_6_5; 1590 Assert MsgFailed(("Test me - SVGA3D_R5G6B5\n"));1596 AssertTestFmt(SVGA3D_R5G6B5); 1591 1597 break; 1592 1598 case SVGA3D_X1R5G5B5: /* D3DFMT_X1R5G5B5 - WINED3DFMT_B5G5R5X1_UNORM */ … … 1594 1600 pSurface->formatGL = GL_BGRA; 1595 1601 pSurface->typeGL = GL_UNSIGNED_SHORT_1_5_5_5_REV; 1596 Assert MsgFailed(("Test me - SVGA3D_X1R5G5B5\n"));1602 AssertTestFmt(SVGA3D_X1R5G5B5); 1597 1603 break; 1598 1604 case SVGA3D_A1R5G5B5: /* D3DFMT_A1R5G5B5 - WINED3DFMT_B5G5R5A1_UNORM */ … … 1600 1606 pSurface->formatGL = GL_BGRA; 1601 1607 pSurface->typeGL = GL_UNSIGNED_SHORT_1_5_5_5_REV; 1602 Assert MsgFailed(("Test me - SVGA3D_A1R5G5B5\n"));1608 AssertTestFmt(SVGA3D_A1R5G5B5); 1603 1609 break; 1604 1610 case SVGA3D_A4R4G4B4: /* D3DFMT_A4R4G4B4 - WINED3DFMT_B4G4R4A4_UNORM */ … … 1606 1612 pSurface->formatGL = GL_BGRA; 1607 1613 pSurface->typeGL = GL_UNSIGNED_SHORT_4_4_4_4_REV; 1608 Assert MsgFailed(("Test me - SVGA3D_A4R4G4B4\n"));1614 AssertTestFmt(SVGA3D_A4R4G4B4); 1609 1615 break; 1610 1616 … … 1624 1630 pSurface->formatGL = GL_DEPTH_COMPONENT; 1625 1631 pSurface->typeGL = GL_UNSIGNED_SHORT; 1626 //AssertMsgFailed(("Test me - SVGA3D_Z_D16\n"));1632 AssertTestFmt(SVGA3D_Z_D16); 1627 1633 break; 1628 1634 case SVGA3D_Z_D24S8: /* D3DFMT_D24S8 - WINED3DFMT_D24_UNORM_S8_UINT */ 1629 1635 pSurface->internalFormatGL = GL_DEPTH24_STENCIL8; 1630 1636 pSurface->formatGL = GL_DEPTH_STENCIL; 1631 pSurface->typeGL = GL_UNSIGNED_INT ;1637 pSurface->typeGL = GL_UNSIGNED_INT_24_8; 1632 1638 break; 1633 1639 case SVGA3D_Z_D15S1: /* D3DFMT_D15S1 - WINED3DFMT_S1_UINT_D15_UNORM */ … … 1636 1642 pSurface->typeGL = GL_UNSIGNED_SHORT; 1637 1643 /** @todo Wine sources hints at no hw support for this, so test this one! */ 1638 Assert MsgFailed(("Test me - SVGA3D_Z_D15S1\n"));1644 AssertTestFmt(SVGA3D_Z_D15S1); 1639 1645 break; 1640 1646 case SVGA3D_Z_D24X8: /* D3DFMT_D24X8 - WINED3DFMT_X8D24_UNORM */ … … 1642 1648 pSurface->formatGL = GL_DEPTH_COMPONENT; 1643 1649 pSurface->typeGL = GL_UNSIGNED_INT; 1650 AssertTestFmt(SVGA3D_Z_D24X8); 1644 1651 break; 1645 1652 … … 1648 1655 pSurface->internalFormatGL = GL_DEPTH_COMPONENT16; 1649 1656 pSurface->formatGL = GL_DEPTH_COMPONENT; 1650 pSurface->typeGL = GL_ FLOAT;1657 pSurface->typeGL = GL_HALF_FLOAT; 1651 1658 break; 1652 1659 … … 1657 1664 break; 1658 1665 1659 case SVGA3D_Z_D24S8_INT: /* D3DFMT_ ??? - not supported*/1666 case SVGA3D_Z_D24S8_INT: /* D3DFMT_D24S8 */ 1660 1667 pSurface->internalFormatGL = GL_DEPTH24_STENCIL8; 1661 1668 pSurface->formatGL = GL_DEPTH_STENCIL; 1662 pSurface->typeGL = GL_ INT; /* ??? */1669 pSurface->typeGL = GL_UNSIGNED_INT_24_8; 1663 1670 break; 1664 1671 … … 1750 1757 #else 1751 1758 pSurface->typeGL = GL_HALF_FLOAT; 1752 Assert MsgFailed(("Test me - SVGA3D_ARGB_S10E5\n"));1759 AssertTestFmt(SVGA3D_ARGB_S10E5); 1753 1760 #endif 1754 1761 break; … … 1768 1775 #endif 1769 1776 pSurface->typeGL = GL_UNSIGNED_INT; 1770 Assert MsgFailed(("Test me - SVGA3D_A2R10G10B10\n"));1777 AssertTestFmt(SVGA3D_A2R10G10B10); 1771 1778 break; 1772 1779 … … 1780 1787 #else 1781 1788 pSurface->typeGL = GL_HALF_FLOAT; 1782 Assert MsgFailed(("Test me - SVGA3D_R_S10E5\n"));1789 AssertTestFmt(SVGA3D_R_S10E5); 1783 1790 #endif 1784 1791 break; … … 1795 1802 #else 1796 1803 pSurface->typeGL = GL_HALF_FLOAT; 1797 Assert MsgFailed(("Test me - SVGA3D_RG_S10E5\n"));1804 AssertTestFmt(SVGA3D_RG_S10E5); 1798 1805 #endif 1799 1806 break; … … 1829 1836 #else 1830 1837 pSurface->typeGL = GL_UNSIGNED_SHORT; 1831 Assert MsgFailed(("test me - SVGA3D_G16R16\n"));1838 AssertTestFmt(SVGA3D_G16R16); 1832 1839 #endif 1833 1840 break; … … 1840 1847 #else 1841 1848 pSurface->typeGL = GL_UNSIGNED_SHORT; 1842 Assert MsgFailed(("Test me - SVGA3D_A16B16G16R16\n"));1849 AssertTestFmt(SVGA3D_A16B16G16R16); 1843 1850 #endif 1844 1851 break; … … 1848 1855 pSurface->formatGL = GL_BGRA; 1849 1856 pSurface->typeGL = GL_UNSIGNED_INT_8_8_8_8_REV; 1850 Assert MsgFailed(("test me - SVGA3D_R8G8B8A8_SNORM\n"));1857 AssertTestFmt(SVGA3D_R8G8B8A8_SNORM); 1851 1858 break; 1852 1859 case SVGA3D_R16G16_UNORM: … … 1854 1861 pSurface->formatGL = GL_RG; 1855 1862 pSurface->typeGL = GL_UNSIGNED_SHORT; 1856 Assert MsgFailed(("test me - SVGA3D_R16G16_UNORM\n"));1863 AssertTestFmt(SVGA3D_R16G16_UNORM); 1857 1864 break; 1858 1865 … … 1881 1888 break; 1882 1889 } 1890 #undef AssertTestFmt 1883 1891 } 1884 1892 … … 2644 2652 vmsvga3dOglSetUnpackParams(pState, pContext, pSurface, &SavedParams); /** @todo do we need to set ROW_LENGTH to w here? */ 2645 2653 2646 glTexSubImage2D(texImageTarget, 2647 uHostMipmap, 2648 u32HostBlockX, 2649 u32HostBlockY, 2650 cBlocksX, 2651 cBlocksY, 2652 pSurface->formatGL, 2653 pSurface->typeGL, 2654 pDoubleBuffer); 2654 if ( pSurface->internalFormatGL == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 2655 || pSurface->internalFormatGL == GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 2656 || pSurface->internalFormatGL == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) 2657 { 2658 pState->ext.glCompressedTexSubImage2D(texImageTarget, 2659 uHostMipmap, 2660 pBox->x, 2661 pBox->y, 2662 pBox->w, 2663 pBox->h, 2664 pSurface->internalFormatGL, 2665 cbSurfacePitch * cBlocksY, 2666 pDoubleBuffer); 2667 } 2668 else 2669 { 2670 glTexSubImage2D(texImageTarget, 2671 uHostMipmap, 2672 u32HostBlockX, 2673 u32HostBlockY, 2674 cBlocksX, 2675 cBlocksY, 2676 pSurface->formatGL, 2677 pSurface->typeGL, 2678 pDoubleBuffer); 2679 } 2655 2680 VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext); 2656 2681 … … 4821 4846 currentStage, sid, pContext->aSidActiveTextures[currentStage])); 4822 4847 4823 /* Only i stexture actually changed. */ /// @todo needs testing.4848 /* Only if texture actually changed. */ /// @todo needs testing. 4824 4849 if (pContext->aSidActiveTextures[currentStage] != sid) 4825 4850 { … … 4830 4855 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); 4831 4856 4832 /* Necessary for the fixed pipeline. */ 4833 glDisable(pCurrentTextureSurface->targetGL); 4834 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); 4857 if (currentStage < 8) 4858 { 4859 /* Necessary for the fixed pipeline. */ 4860 glDisable(pCurrentTextureSurface->targetGL); 4861 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); 4862 } 4835 4863 4836 4864 pCurrentTextureSurface = NULL; … … 4862 4890 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); 4863 4891 4864 /* Necessary for the fixed pipeline. */ 4865 glEnable(pSurface->targetGL); 4866 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); 4892 if (currentStage < 8) 4893 { 4894 /* Necessary for the fixed pipeline. */ 4895 glEnable(pSurface->targetGL); 4896 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); 4897 } 4867 4898 4868 4899 /* Remember the currently active texture. */
Note:
See TracChangeset
for help on using the changeset viewer.