Added A2R10G10B10 and D3DFMT_D24FS8 modes to all other functions.

This commit is contained in:
Karsten Elfenbein 2005-09-07 09:25:26 +00:00 committed by Alexandre Julliard
parent d15d1c4cea
commit 13fc2f88d6
3 changed files with 43 additions and 0 deletions

View File

@ -993,6 +993,9 @@ static BOOL IWineD3DImpl_IsGLXFBConfigCompatibleWithRenderFmt(WineD3D_Context* c
case WINED3DFMT_A8R8G8B8: case WINED3DFMT_A8R8G8B8:
if (8 == rb && 8 == gb && 8 == bb && 8 == ab) return TRUE; if (8 == rb && 8 == gb && 8 == bb && 8 == ab) return TRUE;
break; break;
case WINED3DFMT_A2R10G10B10:
if (10 == rb && 10 == gb && 10 == bb && 2 == ab) return TRUE;
break;
case WINED3DFMT_X1R5G5B5: case WINED3DFMT_X1R5G5B5:
if (5 == rb && 5 == gb && 5 == bb) return TRUE; if (5 == rb && 5 == gb && 5 == bb) return TRUE;
break; break;
@ -1039,6 +1042,9 @@ static BOOL IWineD3DImpl_IsGLXFBConfigCompatibleWithDepthFmt(WineD3D_Context* ct
case WINED3DFMT_D24S8: case WINED3DFMT_D24S8:
if (24 == db && 8 == sb) return TRUE; if (24 == db && 8 == sb) return TRUE;
break; break;
case WINED3DFMT_D24FS8:
if (24 == db && 8 == sb) return TRUE;
break;
case WINED3DFMT_D24X8: case WINED3DFMT_D24X8:
if (24 == db) return TRUE; if (24 == db) return TRUE;
break; break;

View File

@ -724,6 +724,17 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
vcheckGLcall("glPixelStorei"); vcheckGLcall("glPixelStorei");
} }
break; break;
case WINED3DFMT_A2R10G10B10:
{
glPixelStorei(GL_PACK_SWAP_BYTES, TRUE);
vcheckGLcall("glPixelStorei");
glDrawPixels(This->lockedRect.right - This->lockedRect.left, (This->lockedRect.bottom - This->lockedRect.top)-1,
GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV, This->resource.allocatedMemory);
vcheckGLcall("glDrawPixels");
glPixelStorei(GL_PACK_SWAP_BYTES, prev_store);
vcheckGLcall("glPixelStorei");
}
break;
default: default:
FIXME("Unsupported Format %u in locking func\n", This->resource.format); FIXME("Unsupported Format %u in locking func\n", This->resource.format);
} }

View File

@ -73,6 +73,7 @@ const char* debug_d3dformat(WINED3DFORMAT fmt) {
FMT_TO_STR(WINED3DFMT_D32); FMT_TO_STR(WINED3DFMT_D32);
FMT_TO_STR(WINED3DFMT_D15S1); FMT_TO_STR(WINED3DFMT_D15S1);
FMT_TO_STR(WINED3DFMT_D24S8); FMT_TO_STR(WINED3DFMT_D24S8);
FMT_TO_STR(WINED3DFMT_D24FS8);
FMT_TO_STR(WINED3DFMT_D24X8); FMT_TO_STR(WINED3DFMT_D24X8);
FMT_TO_STR(WINED3DFMT_D24X4S4); FMT_TO_STR(WINED3DFMT_D24X4S4);
FMT_TO_STR(WINED3DFMT_D16); FMT_TO_STR(WINED3DFMT_D16);
@ -1610,12 +1611,14 @@ GLint D3DFmt2GLIntFmt(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
case WINED3DFMT_A4R4G4B4: retVal = GL_RGBA4; break; case WINED3DFMT_A4R4G4B4: retVal = GL_RGBA4; break;
case WINED3DFMT_X4R4G4B4: retVal = GL_RGB4; break; case WINED3DFMT_X4R4G4B4: retVal = GL_RGB4; break;
case WINED3DFMT_A8R8G8B8: retVal = GL_RGBA8; break; case WINED3DFMT_A8R8G8B8: retVal = GL_RGBA8; break;
case WINED3DFMT_A2R10G10B10: retVal = GL_RGBA8; break;
case WINED3DFMT_X8R8G8B8: retVal = GL_RGB; break; case WINED3DFMT_X8R8G8B8: retVal = GL_RGB; break;
/* to see */ /* to see */
case WINED3DFMT_A8: retVal = GL_ALPHA8; break; case WINED3DFMT_A8: retVal = GL_ALPHA8; break;
/* Depth + Stencil NOTE: OpenGL doesn't support depth-stencil surfaces so the formats are the closes bits match for the data */ /* Depth + Stencil NOTE: OpenGL doesn't support depth-stencil surfaces so the formats are the closes bits match for the data */
case WINED3DFMT_D24S8: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_D24S8: retVal = GL_COLOR_INDEX; break;
case WINED3DFMT_D24FS8: retVal = GL_COLOR_INDEX; break;
case WINED3DFMT_D24X8: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_D24X8: retVal = GL_COLOR_INDEX; break;
case WINED3DFMT_D24X4S4: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_D24X4S4: retVal = GL_COLOR_INDEX; break;
case WINED3DFMT_D32: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_D32: retVal = GL_COLOR_INDEX; break;
@ -1673,11 +1676,13 @@ GLenum D3DFmt2GLFmt(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
case WINED3DFMT_A4R4G4B4: retVal = GL_BGRA; break; case WINED3DFMT_A4R4G4B4: retVal = GL_BGRA; break;
case WINED3DFMT_X4R4G4B4: retVal = GL_BGRA; break; case WINED3DFMT_X4R4G4B4: retVal = GL_BGRA; break;
case WINED3DFMT_A8R8G8B8: retVal = GL_BGRA; break; case WINED3DFMT_A8R8G8B8: retVal = GL_BGRA; break;
case WINED3DFMT_A2R10G10B10: retVal = GL_BGRA; break;
case WINED3DFMT_X8R8G8B8: retVal = GL_BGRA; break; case WINED3DFMT_X8R8G8B8: retVal = GL_BGRA; break;
/* to see */ /* to see */
case WINED3DFMT_A8: retVal = GL_ALPHA; break; case WINED3DFMT_A8: retVal = GL_ALPHA; break;
/* Depth + Stencil */ /* Depth + Stencil */
case WINED3DFMT_D24S8: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_D24S8: retVal = GL_COLOR_INDEX; break;
case WINED3DFMT_D24FS8: retVal = GL_COLOR_INDEX; break;
case WINED3DFMT_D24X8: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_D24X8: retVal = GL_COLOR_INDEX; break;
case WINED3DFMT_D24X4S4: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_D24X4S4: retVal = GL_COLOR_INDEX; break;
case WINED3DFMT_D32: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_D32: retVal = GL_COLOR_INDEX; break;
@ -1733,11 +1738,13 @@ GLenum D3DFmt2GLType(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
case WINED3DFMT_A4R4G4B4: retVal = GL_UNSIGNED_SHORT_4_4_4_4_REV; break; case WINED3DFMT_A4R4G4B4: retVal = GL_UNSIGNED_SHORT_4_4_4_4_REV; break;
case WINED3DFMT_X4R4G4B4: retVal = GL_UNSIGNED_SHORT_4_4_4_4_REV; break; case WINED3DFMT_X4R4G4B4: retVal = GL_UNSIGNED_SHORT_4_4_4_4_REV; break;
case WINED3DFMT_A8R8G8B8: retVal = GL_UNSIGNED_INT_8_8_8_8_REV; break; case WINED3DFMT_A8R8G8B8: retVal = GL_UNSIGNED_INT_8_8_8_8_REV; break;
case WINED3DFMT_A2R10G10B10: retVal = GL_UNSIGNED_INT_2_10_10_10_REV; break;
case WINED3DFMT_X8R8G8B8: retVal = GL_UNSIGNED_INT_8_8_8_8_REV; break; case WINED3DFMT_X8R8G8B8: retVal = GL_UNSIGNED_INT_8_8_8_8_REV; break;
/* to see */ /* to see */
case WINED3DFMT_A8: retVal = GL_ALPHA; break; case WINED3DFMT_A8: retVal = GL_ALPHA; break;
/* Depth + Stencil */ /* Depth + Stencil */
case WINED3DFMT_D24S8: retVal = GL_UNSIGNED_INT; break; case WINED3DFMT_D24S8: retVal = GL_UNSIGNED_INT; break;
case WINED3DFMT_D24FS8: retVal = GL_UNSIGNED_INT; break;
case WINED3DFMT_D24X8: retVal = GL_UNSIGNED_INT; break; case WINED3DFMT_D24X8: retVal = GL_UNSIGNED_INT; break;
case WINED3DFMT_D24X4S4: retVal = GL_UNSIGNED_INT; break; case WINED3DFMT_D24X4S4: retVal = GL_UNSIGNED_INT; break;
case WINED3DFMT_D32: retVal = GL_UNSIGNED_INT; break; case WINED3DFMT_D32: retVal = GL_UNSIGNED_INT; break;
@ -1774,6 +1781,7 @@ SHORT D3DFmtGetBpp(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
case WINED3DFMT_A4R4G4B4: retVal = 2; break; case WINED3DFMT_A4R4G4B4: retVal = 2; break;
case WINED3DFMT_X4R4G4B4: retVal = 2; break; case WINED3DFMT_X4R4G4B4: retVal = 2; break;
case WINED3DFMT_A8R8G8B8: retVal = 4; break; case WINED3DFMT_A8R8G8B8: retVal = 4; break;
case WINED3DFMT_A2R10G10B10: retVal = 4; break;
case WINED3DFMT_X8R8G8B8: retVal = 4; break; case WINED3DFMT_X8R8G8B8: retVal = 4; break;
/* Paletted */ /* Paletted */
case WINED3DFMT_P8: retVal = 1; break; case WINED3DFMT_P8: retVal = 1; break;
@ -1785,6 +1793,7 @@ SHORT D3DFmtGetBpp(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
case WINED3DFMT_D15S1: retVal = 2; break; case WINED3DFMT_D15S1: retVal = 2; break;
case WINED3DFMT_D24X4S4: retVal = 4; break; case WINED3DFMT_D24X4S4: retVal = 4; break;
case WINED3DFMT_D24S8: retVal = 4; break; case WINED3DFMT_D24S8: retVal = 4; break;
case WINED3DFMT_D24FS8: retVal = 4; break;
case WINED3DFMT_D24X8: retVal = 4; break; case WINED3DFMT_D24X8: retVal = 4; break;
/* Luminance */ /* Luminance */
case WINED3DFMT_L8: retVal = 1; break; case WINED3DFMT_L8: retVal = 1; break;
@ -1874,6 +1883,13 @@ int D3DFmtMakeGlCfg(D3DFORMAT BackBufferFormat, D3DFORMAT StencilBufferFormat, i
PUSH2(GLX_BLUE_SIZE, 8); PUSH2(GLX_BLUE_SIZE, 8);
break; break;
case WINED3DFMT_A2R10G10B10:
PUSH2(GLX_ALPHA_SIZE, 2);
PUSH2(GLX_RED_SIZE, 10);
PUSH2(GLX_GREEN_SIZE, 10);
PUSH2(GLX_BLUE_SIZE, 10);
break;
default: default:
break; break;
} }
@ -1905,6 +1921,11 @@ int D3DFmtMakeGlCfg(D3DFORMAT BackBufferFormat, D3DFORMAT StencilBufferFormat, i
PUSH2(GLX_STENCIL_SIZE, 8); PUSH2(GLX_STENCIL_SIZE, 8);
break; break;
case WINED3DFMT_D24FS8:
PUSH2(GLX_DEPTH_SIZE, 24);
PUSH2(GLX_STENCIL_SIZE, 8);
break;
case WINED3DFMT_D32: case WINED3DFMT_D32:
PUSH2(GLX_DEPTH_SIZE, 32); PUSH2(GLX_DEPTH_SIZE, 32);
break; break;
@ -1941,6 +1962,11 @@ int D3DFmtMakeGlCfg(D3DFORMAT BackBufferFormat, D3DFORMAT StencilBufferFormat, i
PUSH2(GLX_STENCIL_SIZE, 1); PUSH2(GLX_STENCIL_SIZE, 1);
break; break;
case WINED3DFMT_D24FS8:
PUSH2(GLX_DEPTH_SIZE, 1);
PUSH2(GLX_STENCIL_SIZE, 1);
break;
case WINED3DFMT_D32: case WINED3DFMT_D32:
PUSH2(GLX_DEPTH_SIZE, 1); PUSH2(GLX_DEPTH_SIZE, 1);
break; break;