Commit 47c84f4f authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Use the DXGI naming convention for all formats.

parent a25ac586
......@@ -46,37 +46,37 @@ D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format)
switch(format)
{
case WINED3DFMT_UNKNOWN: return D3DFMT_UNKNOWN;
case WINED3DFMT_R8G8B8: return D3DFMT_R8G8B8;
case WINED3DFMT_A8R8G8B8: return D3DFMT_A8R8G8B8;
case WINED3DFMT_X8R8G8B8: return D3DFMT_X8R8G8B8;
case WINED3DFMT_R5G6B5: return D3DFMT_R5G6B5;
case WINED3DFMT_X1R5G5B5: return D3DFMT_X1R5G5B5;
case WINED3DFMT_A1R5G5B5: return D3DFMT_A1R5G5B5;
case WINED3DFMT_A4R4G4B4: return D3DFMT_A4R4G4B4;
case WINED3DFMT_R3G3B2: return D3DFMT_R3G3B2;
case WINED3DFMT_B8G8R8_UNORM: return D3DFMT_R8G8B8;
case WINED3DFMT_B8G8R8A8_UNORM: return D3DFMT_A8R8G8B8;
case WINED3DFMT_B8G8R8X8_UNORM: return D3DFMT_X8R8G8B8;
case WINED3DFMT_B5G6R5_UNORM: return D3DFMT_R5G6B5;
case WINED3DFMT_B5G5R5X1_UNORM: return D3DFMT_X1R5G5B5;
case WINED3DFMT_B5G5R5A1_UNORM: return D3DFMT_A1R5G5B5;
case WINED3DFMT_B4G4R4A4_UNORM: return D3DFMT_A4R4G4B4;
case WINED3DFMT_B2G3R3_UNORM: return D3DFMT_R3G3B2;
case WINED3DFMT_A8_UNORM: return D3DFMT_A8;
case WINED3DFMT_A8R3G3B2: return D3DFMT_A8R3G3B2;
case WINED3DFMT_X4R4G4B4: return D3DFMT_X4R4G4B4;
case WINED3DFMT_B2G3R3A8_UNORM: return D3DFMT_A8R3G3B2;
case WINED3DFMT_B4G4R4X4_UNORM: return D3DFMT_X4R4G4B4;
case WINED3DFMT_R10G10B10A2_UNORM: return D3DFMT_A2B10G10R10;
case WINED3DFMT_R16G16_UNORM: return D3DFMT_G16R16;
case WINED3DFMT_A8P8: return D3DFMT_A8P8;
case WINED3DFMT_P8: return D3DFMT_P8;
case WINED3DFMT_L8: return D3DFMT_L8;
case WINED3DFMT_A8L8: return D3DFMT_A8L8;
case WINED3DFMT_A4L4: return D3DFMT_A4L4;
case WINED3DFMT_P8_UINT_A8_UNORM: return D3DFMT_A8P8;
case WINED3DFMT_P8_UINT: return D3DFMT_P8;
case WINED3DFMT_L8_UNORM: return D3DFMT_L8;
case WINED3DFMT_L8A8_UNORM: return D3DFMT_A8L8;
case WINED3DFMT_L4A4_UNORM: return D3DFMT_A4L4;
case WINED3DFMT_R8G8_SNORM: return D3DFMT_V8U8;
case WINED3DFMT_L6V5U5: return D3DFMT_L6V5U5;
case WINED3DFMT_X8L8V8U8: return D3DFMT_X8L8V8U8;
case WINED3DFMT_R5G5_SNORM_L6_UNORM: return D3DFMT_L6V5U5;
case WINED3DFMT_R8G8_SNORM_L8X8_UNORM: return D3DFMT_X8L8V8U8;
case WINED3DFMT_R8G8B8A8_SNORM: return D3DFMT_Q8W8V8U8;
case WINED3DFMT_R16G16_SNORM: return D3DFMT_V16U16;
case WINED3DFMT_W11V11U10: return D3DFMT_W11V11U10;
case WINED3DFMT_A2W10V10U10: return D3DFMT_A2W10V10U10;
case WINED3DFMT_R10G11B11_SNORM: return D3DFMT_W11V11U10;
case WINED3DFMT_R10G10B10_SNORM_A2_UNORM: return D3DFMT_A2W10V10U10;
case WINED3DFMT_D16_LOCKABLE: return D3DFMT_D16_LOCKABLE;
case WINED3DFMT_D32: return D3DFMT_D32;
case WINED3DFMT_D15S1: return D3DFMT_D15S1;
case WINED3DFMT_D24S8: return D3DFMT_D24S8;
case WINED3DFMT_D24X8: return D3DFMT_D24X8;
case WINED3DFMT_D24X4S4: return D3DFMT_D24X4S4;
case WINED3DFMT_D32_UNORM: return D3DFMT_D32;
case WINED3DFMT_S1_UINT_D15_UNORM: return D3DFMT_D15S1;
case WINED3DFMT_S8_UINT_D24_UNORM: return D3DFMT_D24S8;
case WINED3DFMT_X8D24_UNORM: return D3DFMT_D24X8;
case WINED3DFMT_S4X4_UINT_D24_UNORM: return D3DFMT_D24X4S4;
case WINED3DFMT_D16_UNORM: return D3DFMT_D16;
case WINED3DFMT_VERTEXDATA: return D3DFMT_VERTEXDATA;
case WINED3DFMT_R16_UINT: return D3DFMT_INDEX16;
......@@ -97,37 +97,37 @@ WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format)
switch(format)
{
case D3DFMT_UNKNOWN: return WINED3DFMT_UNKNOWN;
case D3DFMT_R8G8B8: return WINED3DFMT_R8G8B8;
case D3DFMT_A8R8G8B8: return WINED3DFMT_A8R8G8B8;
case D3DFMT_X8R8G8B8: return WINED3DFMT_X8R8G8B8;
case D3DFMT_R5G6B5: return WINED3DFMT_R5G6B5;
case D3DFMT_X1R5G5B5: return WINED3DFMT_X1R5G5B5;
case D3DFMT_A1R5G5B5: return WINED3DFMT_A1R5G5B5;
case D3DFMT_A4R4G4B4: return WINED3DFMT_A4R4G4B4;
case D3DFMT_R3G3B2: return WINED3DFMT_R3G3B2;
case D3DFMT_R8G8B8: return WINED3DFMT_B8G8R8_UNORM;
case D3DFMT_A8R8G8B8: return WINED3DFMT_B8G8R8A8_UNORM;
case D3DFMT_X8R8G8B8: return WINED3DFMT_B8G8R8X8_UNORM;
case D3DFMT_R5G6B5: return WINED3DFMT_B5G6R5_UNORM;
case D3DFMT_X1R5G5B5: return WINED3DFMT_B5G5R5X1_UNORM;
case D3DFMT_A1R5G5B5: return WINED3DFMT_B5G5R5A1_UNORM;
case D3DFMT_A4R4G4B4: return WINED3DFMT_B4G4R4A4_UNORM;
case D3DFMT_R3G3B2: return WINED3DFMT_B2G3R3_UNORM;
case D3DFMT_A8: return WINED3DFMT_A8_UNORM;
case D3DFMT_A8R3G3B2: return WINED3DFMT_A8R3G3B2;
case D3DFMT_X4R4G4B4: return WINED3DFMT_X4R4G4B4;
case D3DFMT_A8R3G3B2: return WINED3DFMT_B2G3R3A8_UNORM;
case D3DFMT_X4R4G4B4: return WINED3DFMT_B4G4R4X4_UNORM;
case D3DFMT_A2B10G10R10: return WINED3DFMT_R10G10B10A2_UNORM;
case D3DFMT_G16R16: return WINED3DFMT_R16G16_UNORM;
case D3DFMT_A8P8: return WINED3DFMT_A8P8;
case D3DFMT_P8: return WINED3DFMT_P8;
case D3DFMT_L8: return WINED3DFMT_L8;
case D3DFMT_A8L8: return WINED3DFMT_A8L8;
case D3DFMT_A4L4: return WINED3DFMT_A4L4;
case D3DFMT_A8P8: return WINED3DFMT_P8_UINT_A8_UNORM;
case D3DFMT_P8: return WINED3DFMT_P8_UINT;
case D3DFMT_L8: return WINED3DFMT_L8_UNORM;
case D3DFMT_A8L8: return WINED3DFMT_L8A8_UNORM;
case D3DFMT_A4L4: return WINED3DFMT_L4A4_UNORM;
case D3DFMT_V8U8: return WINED3DFMT_R8G8_SNORM;
case D3DFMT_L6V5U5: return WINED3DFMT_L6V5U5;
case D3DFMT_X8L8V8U8: return WINED3DFMT_X8L8V8U8;
case D3DFMT_L6V5U5: return WINED3DFMT_R5G5_SNORM_L6_UNORM;
case D3DFMT_X8L8V8U8: return WINED3DFMT_R8G8_SNORM_L8X8_UNORM;
case D3DFMT_Q8W8V8U8: return WINED3DFMT_R8G8B8A8_SNORM;
case D3DFMT_V16U16: return WINED3DFMT_R16G16_SNORM;
case D3DFMT_W11V11U10: return WINED3DFMT_W11V11U10;
case D3DFMT_A2W10V10U10: return WINED3DFMT_A2W10V10U10;
case D3DFMT_W11V11U10: return WINED3DFMT_R10G11B11_SNORM;
case D3DFMT_A2W10V10U10: return WINED3DFMT_R10G10B10_SNORM_A2_UNORM;
case D3DFMT_D16_LOCKABLE: return WINED3DFMT_D16_LOCKABLE;
case D3DFMT_D32: return WINED3DFMT_D32;
case D3DFMT_D15S1: return WINED3DFMT_D15S1;
case D3DFMT_D24S8: return WINED3DFMT_D24S8;
case D3DFMT_D24X8: return WINED3DFMT_D24X8;
case D3DFMT_D24X4S4: return WINED3DFMT_D24X4S4;
case D3DFMT_D32: return WINED3DFMT_D32_UNORM;
case D3DFMT_D15S1: return WINED3DFMT_S1_UINT_D15_UNORM;
case D3DFMT_D24S8: return WINED3DFMT_S8_UINT_D24_UNORM;
case D3DFMT_D24X8: return WINED3DFMT_X8D24_UNORM;
case D3DFMT_D24X4S4: return WINED3DFMT_S4X4_UINT_D24_UNORM;
case D3DFMT_D16: return WINED3DFMT_D16_UNORM;
case D3DFMT_VERTEXDATA: return WINED3DFMT_VERTEXDATA;
case D3DFMT_INDEX16: return WINED3DFMT_R16_UINT;
......
......@@ -260,7 +260,7 @@ static const WINED3DFORMAT wined3d_format_lookup[] =
/*WINED3DDECLTYPE_FLOAT2*/ WINED3DFMT_R32G32_FLOAT,
/*WINED3DDECLTYPE_FLOAT3*/ WINED3DFMT_R32G32B32_FLOAT,
/*WINED3DDECLTYPE_FLOAT4*/ WINED3DFMT_R32G32B32A32_FLOAT,
/*WINED3DDECLTYPE_D3DCOLOR*/ WINED3DFMT_A8R8G8B8,
/*WINED3DDECLTYPE_D3DCOLOR*/ WINED3DFMT_B8G8R8A8_UNORM,
/*WINED3DDECLTYPE_UBYTE4*/ WINED3DFMT_R8G8B8A8_UINT,
/*WINED3DDECLTYPE_SHORT2*/ WINED3DFMT_R16G16_SINT,
/*WINED3DDECLTYPE_SHORT4*/ WINED3DFMT_R16G16B16A16_SINT,
......
......@@ -35,44 +35,44 @@ D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format)
switch(format)
{
case WINED3DFMT_UNKNOWN: return D3DFMT_UNKNOWN;
case WINED3DFMT_R8G8B8: return D3DFMT_R8G8B8;
case WINED3DFMT_A8R8G8B8: return D3DFMT_A8R8G8B8;
case WINED3DFMT_X8R8G8B8: return D3DFMT_X8R8G8B8;
case WINED3DFMT_R5G6B5: return D3DFMT_R5G6B5;
case WINED3DFMT_X1R5G5B5: return D3DFMT_X1R5G5B5;
case WINED3DFMT_A1R5G5B5: return D3DFMT_A1R5G5B5;
case WINED3DFMT_A4R4G4B4: return D3DFMT_A4R4G4B4;
case WINED3DFMT_R3G3B2: return D3DFMT_R3G3B2;
case WINED3DFMT_B8G8R8_UNORM: return D3DFMT_R8G8B8;
case WINED3DFMT_B8G8R8A8_UNORM: return D3DFMT_A8R8G8B8;
case WINED3DFMT_B8G8R8X8_UNORM: return D3DFMT_X8R8G8B8;
case WINED3DFMT_B5G6R5_UNORM: return D3DFMT_R5G6B5;
case WINED3DFMT_B5G5R5X1_UNORM: return D3DFMT_X1R5G5B5;
case WINED3DFMT_B5G5R5A1_UNORM: return D3DFMT_A1R5G5B5;
case WINED3DFMT_B4G4R4A4_UNORM: return D3DFMT_A4R4G4B4;
case WINED3DFMT_B2G3R3_UNORM: return D3DFMT_R3G3B2;
case WINED3DFMT_A8_UNORM: return D3DFMT_A8;
case WINED3DFMT_A8R3G3B2: return D3DFMT_A8R3G3B2;
case WINED3DFMT_X4R4G4B4: return D3DFMT_X4R4G4B4;
case WINED3DFMT_B2G3R3A8_UNORM: return D3DFMT_A8R3G3B2;
case WINED3DFMT_B4G4R4X4_UNORM: return D3DFMT_X4R4G4B4;
case WINED3DFMT_R10G10B10A2_UNORM: return D3DFMT_A2B10G10R10;
case WINED3DFMT_R8G8B8A8_UNORM: return D3DFMT_A8B8G8R8;
case WINED3DFMT_X8B8G8R8: return D3DFMT_X8B8G8R8;
case WINED3DFMT_R8G8B8X8_UNORM: return D3DFMT_X8B8G8R8;
case WINED3DFMT_R16G16_UNORM: return D3DFMT_G16R16;
case WINED3DFMT_A2R10G10B10: return D3DFMT_A2R10G10B10;
case WINED3DFMT_B10G10R10A2_UNORM: return D3DFMT_A2R10G10B10;
case WINED3DFMT_R16G16B16A16_UNORM: return D3DFMT_A16B16G16R16;
case WINED3DFMT_A8P8: return D3DFMT_A8P8;
case WINED3DFMT_P8: return D3DFMT_P8;
case WINED3DFMT_L8: return D3DFMT_L8;
case WINED3DFMT_A8L8: return D3DFMT_A8L8;
case WINED3DFMT_A4L4: return D3DFMT_A4L4;
case WINED3DFMT_P8_UINT_A8_UNORM: return D3DFMT_A8P8;
case WINED3DFMT_P8_UINT: return D3DFMT_P8;
case WINED3DFMT_L8_UNORM: return D3DFMT_L8;
case WINED3DFMT_L8A8_UNORM: return D3DFMT_A8L8;
case WINED3DFMT_L4A4_UNORM: return D3DFMT_A4L4;
case WINED3DFMT_R8G8_SNORM: return D3DFMT_V8U8;
case WINED3DFMT_L6V5U5: return D3DFMT_L6V5U5;
case WINED3DFMT_X8L8V8U8: return D3DFMT_X8L8V8U8;
case WINED3DFMT_R5G5_SNORM_L6_UNORM: return D3DFMT_L6V5U5;
case WINED3DFMT_R8G8_SNORM_L8X8_UNORM: return D3DFMT_X8L8V8U8;
case WINED3DFMT_R8G8B8A8_SNORM: return D3DFMT_Q8W8V8U8;
case WINED3DFMT_R16G16_SNORM: return D3DFMT_V16U16;
case WINED3DFMT_A2W10V10U10: return D3DFMT_A2W10V10U10;
case WINED3DFMT_R10G10B10_SNORM_A2_UNORM: return D3DFMT_A2W10V10U10;
case WINED3DFMT_D16_LOCKABLE: return D3DFMT_D16_LOCKABLE;
case WINED3DFMT_D32: return D3DFMT_D32;
case WINED3DFMT_D15S1: return D3DFMT_D15S1;
case WINED3DFMT_D24S8: return D3DFMT_D24S8;
case WINED3DFMT_D24X8: return D3DFMT_D24X8;
case WINED3DFMT_D24X4S4: return D3DFMT_D24X4S4;
case WINED3DFMT_D32_UNORM: return D3DFMT_D32;
case WINED3DFMT_S1_UINT_D15_UNORM: return D3DFMT_D15S1;
case WINED3DFMT_S8_UINT_D24_UNORM: return D3DFMT_D24S8;
case WINED3DFMT_X8D24_UNORM: return D3DFMT_D24X8;
case WINED3DFMT_S4X4_UINT_D24_UNORM: return D3DFMT_D24X4S4;
case WINED3DFMT_D16_UNORM: return D3DFMT_D16;
case WINED3DFMT_L16: return D3DFMT_L16;
case WINED3DFMT_D32F_LOCKABLE: return D3DFMT_D32F_LOCKABLE;
case WINED3DFMT_D24FS8: return D3DFMT_D24FS8;
case WINED3DFMT_L16_UNORM: return D3DFMT_L16;
case WINED3DFMT_D32_FLOAT: return D3DFMT_D32F_LOCKABLE;
case WINED3DFMT_S8_UINT_D24_FLOAT: return D3DFMT_D24FS8;
case WINED3DFMT_VERTEXDATA: return D3DFMT_VERTEXDATA;
case WINED3DFMT_R16_UINT: return D3DFMT_INDEX16;
case WINED3DFMT_R32_UINT: return D3DFMT_INDEX32;
......@@ -83,7 +83,7 @@ D3DFORMAT d3dformat_from_wined3dformat(WINED3DFORMAT format)
case WINED3DFMT_R32_FLOAT: return D3DFMT_R32F;
case WINED3DFMT_R32G32_FLOAT: return D3DFMT_G32R32F;
case WINED3DFMT_R32G32B32A32_FLOAT: return D3DFMT_A32B32G32R32F;
case WINED3DFMT_CxV8U8: return D3DFMT_CxV8U8;
case WINED3DFMT_R8G8_SNORM_Cx: return D3DFMT_CxV8U8;
default:
FIXME("Unhandled WINED3DFORMAT %#x\n", format);
return D3DFMT_UNKNOWN;
......@@ -100,44 +100,44 @@ WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format)
switch(format)
{
case D3DFMT_UNKNOWN: return WINED3DFMT_UNKNOWN;
case D3DFMT_R8G8B8: return WINED3DFMT_R8G8B8;
case D3DFMT_A8R8G8B8: return WINED3DFMT_A8R8G8B8;
case D3DFMT_X8R8G8B8: return WINED3DFMT_X8R8G8B8;
case D3DFMT_R5G6B5: return WINED3DFMT_R5G6B5;
case D3DFMT_X1R5G5B5: return WINED3DFMT_X1R5G5B5;
case D3DFMT_A1R5G5B5: return WINED3DFMT_A1R5G5B5;
case D3DFMT_A4R4G4B4: return WINED3DFMT_A4R4G4B4;
case D3DFMT_R3G3B2: return WINED3DFMT_R3G3B2;
case D3DFMT_R8G8B8: return WINED3DFMT_B8G8R8_UNORM;
case D3DFMT_A8R8G8B8: return WINED3DFMT_B8G8R8A8_UNORM;
case D3DFMT_X8R8G8B8: return WINED3DFMT_B8G8R8X8_UNORM;
case D3DFMT_R5G6B5: return WINED3DFMT_B5G6R5_UNORM;
case D3DFMT_X1R5G5B5: return WINED3DFMT_B5G5R5X1_UNORM;
case D3DFMT_A1R5G5B5: return WINED3DFMT_B5G5R5A1_UNORM;
case D3DFMT_A4R4G4B4: return WINED3DFMT_B4G4R4A4_UNORM;
case D3DFMT_R3G3B2: return WINED3DFMT_B2G3R3_UNORM;
case D3DFMT_A8: return WINED3DFMT_A8_UNORM;
case D3DFMT_A8R3G3B2: return WINED3DFMT_A8R3G3B2;
case D3DFMT_X4R4G4B4: return WINED3DFMT_X4R4G4B4;
case D3DFMT_A8R3G3B2: return WINED3DFMT_B2G3R3A8_UNORM;
case D3DFMT_X4R4G4B4: return WINED3DFMT_B4G4R4X4_UNORM;
case D3DFMT_A2B10G10R10: return WINED3DFMT_R10G10B10A2_UNORM;
case D3DFMT_A8B8G8R8: return WINED3DFMT_R8G8B8A8_UNORM;
case D3DFMT_X8B8G8R8: return WINED3DFMT_X8B8G8R8;
case D3DFMT_X8B8G8R8: return WINED3DFMT_R8G8B8X8_UNORM;
case D3DFMT_G16R16: return WINED3DFMT_R16G16_UNORM;
case D3DFMT_A2R10G10B10: return WINED3DFMT_A2R10G10B10;
case D3DFMT_A2R10G10B10: return WINED3DFMT_B10G10R10A2_UNORM;
case D3DFMT_A16B16G16R16: return WINED3DFMT_R16G16B16A16_UNORM;
case D3DFMT_A8P8: return WINED3DFMT_A8P8;
case D3DFMT_P8: return WINED3DFMT_P8;
case D3DFMT_L8: return WINED3DFMT_L8;
case D3DFMT_A8L8: return WINED3DFMT_A8L8;
case D3DFMT_A4L4: return WINED3DFMT_A4L4;
case D3DFMT_A8P8: return WINED3DFMT_P8_UINT_A8_UNORM;
case D3DFMT_P8: return WINED3DFMT_P8_UINT;
case D3DFMT_L8: return WINED3DFMT_L8_UNORM;
case D3DFMT_A8L8: return WINED3DFMT_L8A8_UNORM;
case D3DFMT_A4L4: return WINED3DFMT_L4A4_UNORM;
case D3DFMT_V8U8: return WINED3DFMT_R8G8_SNORM;
case D3DFMT_L6V5U5: return WINED3DFMT_L6V5U5;
case D3DFMT_X8L8V8U8: return WINED3DFMT_X8L8V8U8;
case D3DFMT_L6V5U5: return WINED3DFMT_R5G5_SNORM_L6_UNORM;
case D3DFMT_X8L8V8U8: return WINED3DFMT_R8G8_SNORM_L8X8_UNORM;
case D3DFMT_Q8W8V8U8: return WINED3DFMT_R8G8B8A8_SNORM;
case D3DFMT_V16U16: return WINED3DFMT_R16G16_SNORM;
case D3DFMT_A2W10V10U10: return WINED3DFMT_A2W10V10U10;
case D3DFMT_A2W10V10U10: return WINED3DFMT_R10G10B10_SNORM_A2_UNORM;
case D3DFMT_D16_LOCKABLE: return WINED3DFMT_D16_LOCKABLE;
case D3DFMT_D32: return WINED3DFMT_D32;
case D3DFMT_D15S1: return WINED3DFMT_D15S1;
case D3DFMT_D24S8: return WINED3DFMT_D24S8;
case D3DFMT_D24X8: return WINED3DFMT_D24X8;
case D3DFMT_D24X4S4: return WINED3DFMT_D24X4S4;
case D3DFMT_D32: return WINED3DFMT_D32_UNORM;
case D3DFMT_D15S1: return WINED3DFMT_S1_UINT_D15_UNORM;
case D3DFMT_D24S8: return WINED3DFMT_S8_UINT_D24_UNORM;
case D3DFMT_D24X8: return WINED3DFMT_X8D24_UNORM;
case D3DFMT_D24X4S4: return WINED3DFMT_S4X4_UINT_D24_UNORM;
case D3DFMT_D16: return WINED3DFMT_D16_UNORM;
case D3DFMT_L16: return WINED3DFMT_L16;
case D3DFMT_D32F_LOCKABLE: return WINED3DFMT_D32F_LOCKABLE;
case D3DFMT_D24FS8: return WINED3DFMT_D24FS8;
case D3DFMT_L16: return WINED3DFMT_L16_UNORM;
case D3DFMT_D32F_LOCKABLE: return WINED3DFMT_D32_FLOAT;
case D3DFMT_D24FS8: return WINED3DFMT_S8_UINT_D24_FLOAT;
case D3DFMT_VERTEXDATA: return WINED3DFMT_VERTEXDATA;
case D3DFMT_INDEX16: return WINED3DFMT_R16_UINT;
case D3DFMT_INDEX32: return WINED3DFMT_R32_UINT;
......@@ -148,7 +148,7 @@ WINED3DFORMAT wined3dformat_from_d3dformat(D3DFORMAT format)
case D3DFMT_R32F: return WINED3DFMT_R32_FLOAT;
case D3DFMT_G32R32F: return WINED3DFMT_R32G32_FLOAT;
case D3DFMT_A32B32G32R32F: return WINED3DFMT_R32G32B32A32_FLOAT;
case D3DFMT_CxV8U8: return WINED3DFMT_CxV8U8;
case D3DFMT_CxV8U8: return WINED3DFMT_R8G8_SNORM_Cx;
default:
FIXME("Unhandled D3DFORMAT %#x\n", format);
return WINED3DFMT_UNKNOWN;
......
......@@ -36,7 +36,7 @@ static D3DDECLTYPE_INFO const d3d_dtype_lookup[D3DDECLTYPE_UNUSED] = {
{D3DDECLTYPE_FLOAT2, WINED3DFMT_R32G32_FLOAT, 2, sizeof(float)},
{D3DDECLTYPE_FLOAT3, WINED3DFMT_R32G32B32_FLOAT, 3, sizeof(float)},
{D3DDECLTYPE_FLOAT4, WINED3DFMT_R32G32B32A32_FLOAT, 4, sizeof(float)},
{D3DDECLTYPE_D3DCOLOR, WINED3DFMT_A8R8G8B8, 4, sizeof(BYTE)},
{D3DDECLTYPE_D3DCOLOR, WINED3DFMT_B8G8R8A8_UNORM, 4, sizeof(BYTE)},
{D3DDECLTYPE_UBYTE4, WINED3DFMT_R8G8B8A8_UINT, 4, sizeof(BYTE)},
{D3DDECLTYPE_SHORT2, WINED3DFMT_R16G16_SINT, 2, sizeof(short int)},
{D3DDECLTYPE_SHORT4, WINED3DFMT_R16G16B16A16_SINT, 4, sizeof(short int)},
......
......@@ -581,11 +581,11 @@ IDirectDrawImpl_SetDisplayModeNoOverride(IDirectDraw7 *iface,
Mode.RefreshRate = RefreshRate;
switch(BPP)
{
case 8: Mode.Format = WINED3DFMT_P8; break;
case 15: Mode.Format = WINED3DFMT_X1R5G5B5; break;
case 16: Mode.Format = WINED3DFMT_R5G6B5; break;
case 24: Mode.Format = WINED3DFMT_R8G8B8; break;
case 32: Mode.Format = WINED3DFMT_X8R8G8B8; break;
case 8: Mode.Format = WINED3DFMT_P8_UINT; break;
case 15: Mode.Format = WINED3DFMT_B5G5R5X1_UNORM; break;
case 16: Mode.Format = WINED3DFMT_B5G6R5_UNORM; break;
case 24: Mode.Format = WINED3DFMT_B8G8R8_UNORM; break;
case 32: Mode.Format = WINED3DFMT_B8G8R8X8_UNORM; break;
}
/* TODO: The possible return values from msdn suggest that
......@@ -1336,22 +1336,22 @@ IDirectDrawImpl_EnumDisplayModes(IDirectDraw7 *iface,
WINED3DFORMAT checkFormatList[] =
{
WINED3DFMT_R8G8B8,
WINED3DFMT_A8R8G8B8,
WINED3DFMT_X8R8G8B8,
WINED3DFMT_R5G6B5,
WINED3DFMT_X1R5G5B5,
WINED3DFMT_A1R5G5B5,
WINED3DFMT_A4R4G4B4,
WINED3DFMT_R3G3B2,
WINED3DFMT_A8R3G3B2,
WINED3DFMT_X4R4G4B4,
WINED3DFMT_B8G8R8_UNORM,
WINED3DFMT_B8G8R8A8_UNORM,
WINED3DFMT_B8G8R8X8_UNORM,
WINED3DFMT_B5G6R5_UNORM,
WINED3DFMT_B5G5R5X1_UNORM,
WINED3DFMT_B5G5R5A1_UNORM,
WINED3DFMT_B4G4R4A4_UNORM,
WINED3DFMT_B2G3R3_UNORM,
WINED3DFMT_B2G3R3A8_UNORM,
WINED3DFMT_B4G4R4X4_UNORM,
WINED3DFMT_R10G10B10A2_UNORM,
WINED3DFMT_R8G8B8A8_UNORM,
WINED3DFMT_X8B8G8R8,
WINED3DFMT_A2R10G10B10,
WINED3DFMT_A8P8,
WINED3DFMT_P8
WINED3DFMT_R8G8B8X8_UNORM,
WINED3DFMT_B10G10R10A2_UNORM,
WINED3DFMT_P8_UINT_A8_UNORM,
WINED3DFMT_P8_UINT,
};
TRACE("(%p)->(%p,%p,%p): Relay\n", This, DDSD, Context, cb);
......@@ -2341,23 +2341,23 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface,
switch(This->orig_bpp)
{
case 8:
Mode.Format = WINED3DFMT_P8;
Mode.Format = WINED3DFMT_P8_UINT;
break;
case 15:
Mode.Format = WINED3DFMT_X1R5G5B5;
Mode.Format = WINED3DFMT_B5G5R5X1_UNORM;
break;
case 16:
Mode.Format = WINED3DFMT_R5G6B5;
Mode.Format = WINED3DFMT_B5G6R5_UNORM;
break;
case 24:
Mode.Format = WINED3DFMT_R8G8B8;
Mode.Format = WINED3DFMT_B8G8R8_UNORM;
break;
case 32:
Mode.Format = WINED3DFMT_X8R8G8B8;
Mode.Format = WINED3DFMT_B8G8R8X8_UNORM;
break;
}
Mode.Width = This->orig_width;
......@@ -2376,16 +2376,16 @@ IDirectDrawImpl_CreateSurface(IDirectDraw7 *iface,
switch(desc2.u2.dwMipMapCount) /* Who had this glorious idea? */
{
case 15:
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_D15S1);
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_S1_UINT_D15_UNORM);
break;
case 16:
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_D16_UNORM);
break;
case 24:
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_D24X8);
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_X8D24_UNORM);
break;
case 32:
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_D32);
PixelFormat_WineD3DtoDD(&desc2.u4.ddpfPixelFormat, WINED3DFMT_D32_UNORM);
break;
default:
ERR("Unknown Z buffer bit depth\n");
......
......@@ -1147,18 +1147,18 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
WINED3DFORMAT FormatList[] = {
/* 32 bit */
WINED3DFMT_A8R8G8B8,
WINED3DFMT_X8R8G8B8,
WINED3DFMT_B8G8R8A8_UNORM,
WINED3DFMT_B8G8R8X8_UNORM,
/* 24 bit */
WINED3DFMT_R8G8B8,
WINED3DFMT_B8G8R8_UNORM,
/* 16 Bit */
WINED3DFMT_A1R5G5B5,
WINED3DFMT_A4R4G4B4,
WINED3DFMT_R5G6B5,
WINED3DFMT_X1R5G5B5,
WINED3DFMT_B5G5R5A1_UNORM,
WINED3DFMT_B4G4R4A4_UNORM,
WINED3DFMT_B5G6R5_UNORM,
WINED3DFMT_B5G5R5X1_UNORM,
/* 8 Bit */
WINED3DFMT_R3G3B2,
WINED3DFMT_P8,
WINED3DFMT_B2G3R3_UNORM,
WINED3DFMT_P8_UINT,
/* FOURCC codes */
WINED3DFMT_DXT1,
WINED3DFMT_DXT3,
......@@ -1167,12 +1167,12 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
WINED3DFORMAT BumpFormatList[] = {
WINED3DFMT_R8G8_SNORM,
WINED3DFMT_L6V5U5,
WINED3DFMT_X8L8V8U8,
WINED3DFMT_R5G5_SNORM_L6_UNORM,
WINED3DFMT_R8G8_SNORM_L8X8_UNORM,
WINED3DFMT_R8G8B8A8_SNORM,
WINED3DFMT_R16G16_SNORM,
WINED3DFMT_W11V11U10,
WINED3DFMT_A2W10V10U10
WINED3DFMT_R10G11B11_SNORM,
WINED3DFMT_R10G10B10_SNORM_A2_UNORM
};
TRACE("(%p)->(%p,%p): Relay\n", This, Callback, Arg);
......@@ -1309,18 +1309,18 @@ IDirect3DDeviceImpl_2_EnumTextureFormats(IDirect3DDevice2 *iface,
WINED3DFORMAT FormatList[] = {
/* 32 bit */
WINED3DFMT_A8R8G8B8,
WINED3DFMT_X8R8G8B8,
WINED3DFMT_B8G8R8A8_UNORM,
WINED3DFMT_B8G8R8X8_UNORM,
/* 24 bit */
WINED3DFMT_R8G8B8,
WINED3DFMT_B8G8R8_UNORM,
/* 16 Bit */
WINED3DFMT_A1R5G5B5,
WINED3DFMT_A4R4G4B4,
WINED3DFMT_R5G6B5,
WINED3DFMT_X1R5G5B5,
WINED3DFMT_B5G5R5A1_UNORM,
WINED3DFMT_B4G4R4A4_UNORM,
WINED3DFMT_B5G6R5_UNORM,
WINED3DFMT_B5G5R5X1_UNORM,
/* 8 Bit */
WINED3DFMT_R3G3B2,
WINED3DFMT_P8,
WINED3DFMT_B2G3R3_UNORM,
WINED3DFMT_P8_UINT,
/* FOURCC codes - Not in this version*/
};
......@@ -3841,14 +3841,14 @@ IDirect3DDeviceImpl_7_DrawPrimitiveStrided(IDirect3DDevice7 *iface,
if(VertexType & D3DFVF_DIFFUSE)
{
WineD3DStrided.diffuse.format = WINED3DFMT_A8R8G8B8;
WineD3DStrided.diffuse.format = WINED3DFMT_B8G8R8A8_UNORM;
WineD3DStrided.diffuse.lpData = D3DDrawPrimStrideData->diffuse.lpvData;
WineD3DStrided.diffuse.dwStride = D3DDrawPrimStrideData->diffuse.dwStride;
}
if(VertexType & D3DFVF_SPECULAR)
{
WineD3DStrided.specular.format = WINED3DFMT_A8R8G8B8;
WineD3DStrided.specular.format = WINED3DFMT_B8G8R8A8_UNORM;
WineD3DStrided.specular.lpData = D3DDrawPrimStrideData->specular.lpvData;
WineD3DStrided.specular.dwStride = D3DDrawPrimStrideData->specular.dwStride;
}
......@@ -3982,14 +3982,14 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface,
if(VertexType & D3DFVF_DIFFUSE)
{
WineD3DStrided.diffuse.format = WINED3DFMT_A8R8G8B8;
WineD3DStrided.diffuse.format = WINED3DFMT_B8G8R8A8_UNORM;
WineD3DStrided.diffuse.lpData = D3DDrawPrimStrideData->diffuse.lpvData;
WineD3DStrided.diffuse.dwStride = D3DDrawPrimStrideData->diffuse.dwStride;
}
if(VertexType & D3DFVF_SPECULAR)
{
WineD3DStrided.specular.format = WINED3DFMT_A8R8G8B8;
WineD3DStrided.specular.format = WINED3DFMT_B8G8R8A8_UNORM;
WineD3DStrided.specular.lpData = D3DDrawPrimStrideData->specular.lpvData;
WineD3DStrided.specular.dwStride = D3DDrawPrimStrideData->specular.dwStride;
}
......
......@@ -1112,12 +1112,12 @@ IDirect3DImpl_7_EnumZBufferFormats(IDirect3D7 *iface,
/* Order matters. Specifically, BattleZone II (full version) expects the
* 16-bit depth formats to be listed before the 24 and 32 ones. */
WINED3DFORMAT FormatList[] = {
WINED3DFMT_D15S1,
WINED3DFMT_S1_UINT_D15_UNORM,
WINED3DFMT_D16_UNORM,
WINED3DFMT_D24X8,
WINED3DFMT_D24X4S4,
WINED3DFMT_D24S8,
WINED3DFMT_D32
WINED3DFMT_X8D24_UNORM,
WINED3DFMT_S4X4_UINT_D24_UNORM,
WINED3DFMT_S8_UINT_D24_UNORM,
WINED3DFMT_D32_UNORM,
};
TRACE("(%p)->(%s,%p,%p): Relay\n", iface, debugstr_guid(refiidDevice), Callback, Context);
......
......@@ -223,11 +223,11 @@ static BOOL buffer_check_attribute(struct wined3d_buffer *This, const struct win
else if (is_ffp_color) FIXME("test FLOAT16 fixed function processing colors\n");
*float16_used = TRUE;
}
else if (check_d3dcolor && format == WINED3DFMT_A8R8G8B8)
else if (check_d3dcolor && format == WINED3DFMT_B8G8R8A8_UNORM)
{
ret = buffer_process_converted_attribute(This, CONV_D3DCOLOR, attrib, stride_this_run);
if (!is_ffp_color) FIXME("Test for non-color fixed function WINED3DFMT_A8R8G8B8 format\n");
if (!is_ffp_color) FIXME("Test for non-color fixed function WINED3DFMT_B8G8R8A8_UNORM format\n");
}
else if (is_ffp_position && format == WINED3DFMT_R32G32B32A32_FLOAT)
{
......
......@@ -922,10 +922,10 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc,
* Likely a lot of other new bugs will be exposed. For that reason request a depth stencil surface all the
* time. It can cause a slight performance hit but fixes a lot of regressions. A fixme reminds of that this
* issue needs to be fixed. */
if (ds_format_desc->format != WINED3DFMT_D24S8)
if (ds_format_desc->format != WINED3DFMT_S8_UINT_D24_UNORM)
{
FIXME("Add OpenGL context recreation support to SetDepthStencilSurface\n");
ds_format_desc = getFormatDescEntry(WINED3DFMT_D24S8, &This->adapter->gl_info);
ds_format_desc = getFormatDescEntry(WINED3DFMT_S8_UINT_D24_UNORM, &This->adapter->gl_info);
}
getDepthStencilBits(ds_format_desc, &depthBits, &stencilBits);
......@@ -1137,18 +1137,18 @@ struct wined3d_context *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceI
if(wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER) {
auxBuffers = TRUE;
if (color_format_desc->format == WINED3DFMT_X4R4G4B4)
color_format_desc = getFormatDescEntry(WINED3DFMT_A4R4G4B4, &This->adapter->gl_info);
else if (color_format_desc->format == WINED3DFMT_X8R8G8B8)
color_format_desc = getFormatDescEntry(WINED3DFMT_A8R8G8B8, &This->adapter->gl_info);
if (color_format_desc->format == WINED3DFMT_B4G4R4X4_UNORM)
color_format_desc = getFormatDescEntry(WINED3DFMT_B4G4R4A4_UNORM, &This->adapter->gl_info);
else if (color_format_desc->format == WINED3DFMT_B8G8R8X8_UNORM)
color_format_desc = getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &This->adapter->gl_info);
}
/* DirectDraw supports 8bit paletted render targets and these are used by old games like Starcraft and C&C.
* Most modern hardware doesn't support 8bit natively so we perform some form of 8bit -> 32bit conversion.
* The conversion (ab)uses the alpha component for storing the palette index. For this reason we require
* a format with 8bit alpha, so request A8R8G8B8. */
if (color_format_desc->format == WINED3DFMT_P8)
color_format_desc = getFormatDescEntry(WINED3DFMT_A8R8G8B8, &This->adapter->gl_info);
if (color_format_desc->format == WINED3DFMT_P8_UINT)
color_format_desc = getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &This->adapter->gl_info);
/* Retrieve the depth stencil format from the present parameters.
* The choice of the proper format can give a nice performance boost
......
......@@ -70,8 +70,8 @@ static void cubetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3
ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD);
}
if (This->resource.format_desc->format == WINED3DFMT_P8
|| This->resource.format_desc->format == WINED3DFMT_A8P8)
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT
|| This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM)
{
for (i = 0; i < This->baseTexture.levels; ++i)
{
......
......@@ -298,7 +298,7 @@ void device_stream_info_from_declaration(IWineD3DDeviceImpl *This,
stream_info->elements[idx].stream_idx = element->input_slot;
stream_info->elements[idx].buffer_object = buffer_object;
if (!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) && element->format_desc->format == WINED3DFMT_A8R8G8B8)
if (!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) && element->format_desc->format == WINED3DFMT_B8G8R8A8_UNORM)
{
stream_info->swizzle_map |= 1 << idx;
}
......@@ -360,7 +360,8 @@ void device_stream_info_from_strided(IWineD3DDeviceImpl *This,
{
if (!stream_info->elements[i].format_desc) continue;
if (!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA) && stream_info->elements[i].format_desc->format == WINED3DFMT_A8R8G8B8)
if (!GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA)
&& stream_info->elements[i].format_desc->format == WINED3DFMT_B8G8R8A8_UNORM)
{
stream_info->swizzle_map |= 1 << i;
}
......@@ -1655,7 +1656,7 @@ static unsigned int ConvertFvfToDeclaration(IWineD3DDeviceImpl *This, /* For the
}
if (has_blend && (num_blends > 0)) {
if (((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB2) && (fvf & WINED3DFVF_LASTBETA_D3DCOLOR))
elements[idx].format = WINED3DFMT_A8R8G8B8;
elements[idx].format = WINED3DFMT_B8G8R8A8_UNORM;
else {
switch(num_blends) {
case 1: elements[idx].format = WINED3DFMT_R32_FLOAT; break;
......@@ -1675,7 +1676,7 @@ static unsigned int ConvertFvfToDeclaration(IWineD3DDeviceImpl *This, /* For the
(((fvf & WINED3DFVF_XYZB5) == WINED3DFVF_XYZB2) && (fvf & WINED3DFVF_LASTBETA_D3DCOLOR)))
elements[idx].format = WINED3DFMT_R8G8B8A8_UINT;
else if (fvf & WINED3DFVF_LASTBETA_D3DCOLOR)
elements[idx].format = WINED3DFMT_A8R8G8B8;
elements[idx].format = WINED3DFMT_B8G8R8A8_UNORM;
else
elements[idx].format = WINED3DFMT_R32_FLOAT;
elements[idx].usage = WINED3DDECLUSAGE_BLENDINDICES;
......@@ -1695,13 +1696,13 @@ static unsigned int ConvertFvfToDeclaration(IWineD3DDeviceImpl *This, /* For the
idx++;
}
if (has_diffuse) {
elements[idx].format = WINED3DFMT_A8R8G8B8;
elements[idx].format = WINED3DFMT_B8G8R8A8_UNORM;
elements[idx].usage = WINED3DDECLUSAGE_COLOR;
elements[idx].usage_idx = 0;
idx++;
}
if (has_specular) {
elements[idx].format = WINED3DFMT_A8R8G8B8;
elements[idx].format = WINED3DFMT_B8G8R8A8_UNORM;
elements[idx].usage = WINED3DDECLUSAGE_COLOR;
elements[idx].usage_idx = 1;
idx++;
......@@ -1884,7 +1885,7 @@ static void IWineD3DDeviceImpl_LoadLogo(IWineD3DDeviceImpl *This, const char *fi
bm.bmHeight = 32;
}
hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *) This, bm.bmWidth, bm.bmHeight, WINED3DFMT_R5G6B5, TRUE,
hr = IWineD3DDevice_CreateSurface((IWineD3DDevice *)This, bm.bmWidth, bm.bmHeight, WINED3DFMT_B5G6R5_UNORM, TRUE,
FALSE, 0, &This->logo_surface, 0, WINED3DPOOL_DEFAULT, WINED3DMULTISAMPLE_NONE, 0, SURFACE_OPENGL,
NULL, &wined3d_null_parent_ops);
if(FAILED(hr)) {
......@@ -5457,14 +5458,15 @@ static void dirtify_p8_texture_samplers(IWineD3DDeviceImpl *device)
{
int i;
for (i = 0; i < MAX_COMBINED_SAMPLERS; i++) {
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl*)device->stateBlock->textures[i];
if (texture && (texture->resource.format_desc->format == WINED3DFMT_P8
|| texture->resource.format_desc->format == WINED3DFMT_A8P8))
{
IWineD3DDeviceImpl_MarkStateDirty(device, STATE_SAMPLER(i));
}
for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i)
{
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl*)device->stateBlock->textures[i];
if (texture && (texture->resource.format_desc->format == WINED3DFMT_P8_UINT
|| texture->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM))
{
IWineD3DDeviceImpl_MarkStateDirty(device, STATE_SAMPLER(i));
}
}
}
static HRESULT WINAPI IWineD3DDeviceImpl_SetPaletteEntries(IWineD3DDevice *iface, UINT PaletteNumber, CONST PALETTEENTRY* pEntries) {
......@@ -5994,8 +5996,9 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
unsigned int r, g, b, a;
DWORD ret;
if(destfmt == WINED3DFMT_A8R8G8B8 || destfmt == WINED3DFMT_X8R8G8B8 ||
destfmt == WINED3DFMT_R8G8B8)
if (destfmt == WINED3DFMT_B8G8R8A8_UNORM
|| destfmt == WINED3DFMT_B8G8R8X8_UNORM
|| destfmt == WINED3DFMT_B8G8R8_UNORM)
return color;
TRACE("Converting color %08x to format %s\n", color, debug_d3dformat(destfmt));
......@@ -6007,7 +6010,7 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
switch(destfmt)
{
case WINED3DFMT_R5G6B5:
case WINED3DFMT_B5G6R5_UNORM:
if(r == 0xff && g == 0xff && b == 0xff) return 0xffff;
r = (r * 32) / 256;
g = (g * 64) / 256;
......@@ -6018,8 +6021,8 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
TRACE("Returning %08x\n", ret);
return ret;
case WINED3DFMT_X1R5G5B5:
case WINED3DFMT_A1R5G5B5:
case WINED3DFMT_B5G5R5X1_UNORM:
case WINED3DFMT_B5G5R5A1_UNORM:
a = (a * 2) / 256;
r = (r * 32) / 256;
g = (g * 32) / 256;
......@@ -6035,8 +6038,8 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
TRACE("Returning %08x\n", a);
return a;
case WINED3DFMT_X4R4G4B4:
case WINED3DFMT_A4R4G4B4:
case WINED3DFMT_B4G4R4X4_UNORM:
case WINED3DFMT_B4G4R4A4_UNORM:
a = (a * 16) / 256;
r = (r * 16) / 256;
g = (g * 16) / 256;
......@@ -6048,7 +6051,7 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
TRACE("Returning %08x\n", ret);
return ret;
case WINED3DFMT_R3G3B2:
case WINED3DFMT_B2G3R3_UNORM:
r = (r * 8) / 256;
g = (g * 8) / 256;
b = (b * 4) / 256;
......@@ -6058,7 +6061,7 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
TRACE("Returning %08x\n", ret);
return ret;
case WINED3DFMT_X8B8G8R8:
case WINED3DFMT_R8G8B8X8_UNORM:
case WINED3DFMT_R8G8B8A8_UNORM:
ret = a << 24;
ret |= b << 16;
......@@ -6067,7 +6070,7 @@ static inline DWORD argb_to_fmt(DWORD color, WINED3DFORMAT destfmt) {
TRACE("Returning %08x\n", ret);
return ret;
case WINED3DFMT_A2R10G10B10:
case WINED3DFMT_B10G10R10A2_UNORM:
a = (a * 4) / 256;
r = (r * 1024) / 256;
g = (g * 1024) / 256;
......@@ -6563,7 +6566,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice* i
WINED3DLOCKED_RECT rect;
/* MSDN: Cursor must be A8R8G8B8 */
if (WINED3DFMT_A8R8G8B8 != pSur->resource.format_desc->format)
if (pSur->resource.format_desc->format != WINED3DFMT_B8G8R8A8_UNORM)
{
ERR("(%p) : surface(%p) has an invalid format\n", This, pCursorBitmap);
return WINED3DERR_INVALIDCALL;
......@@ -6589,7 +6592,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice* i
This->cursorHeight = pSur->currentDesc.Height;
if (SUCCEEDED(IWineD3DSurface_LockRect(pCursorBitmap, &rect, NULL, WINED3DLOCK_READONLY)))
{
const struct GlPixelFormatDesc *glDesc = getFormatDescEntry(WINED3DFMT_A8R8G8B8, &GLINFO_LOCATION);
const struct GlPixelFormatDesc *glDesc =
getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &GLINFO_LOCATION);
char *mem, *bits = rect.pBits;
GLint intfmt = glDesc->glInternal;
GLint format = glDesc->glFormat;
......
......@@ -128,7 +128,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context
element = &si->elements[WINED3D_FFP_DIFFUSE];
diffuse = element->data + streamOffset[element->stream_idx];
if (num_untracked_materials && element->format_desc->format != WINED3DFMT_A8R8G8B8)
if (num_untracked_materials && element->format_desc->format != WINED3DFMT_B8G8R8A8_UNORM)
FIXME("Implement diffuse color tracking from %s\n", debug_d3dformat(element->format_desc->format));
}
else
......@@ -149,7 +149,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context
{
if (GL_SUPPORT(EXT_FOG_COORD))
{
if (element->format_desc->format == WINED3DFMT_A8R8G8B8) specular_fog = TRUE;
if (element->format_desc->format == WINED3DFMT_B8G8R8A8_UNORM) specular_fog = TRUE;
else FIXME("Implement fog coordinates from %s\n", debug_d3dformat(element->format_desc->format));
}
else
......@@ -332,7 +332,7 @@ static inline void send_attribute(IWineD3DDeviceImpl *This, WINED3DFORMAT format
case WINED3DFMT_R8G8B8A8_UINT:
GL_EXTCALL(glVertexAttrib4ubvARB(index, ptr));
break;
case WINED3DFMT_A8R8G8B8:
case WINED3DFMT_B8G8R8A8_UNORM:
if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA))
{
const DWORD *src = ptr;
......
......@@ -4068,7 +4068,7 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
case WINED3DFMT_R8G8B8A8_UINT:
GL_EXTCALL(glVertexAttrib4NubvARB(i, ptr));
break;
case WINED3DFMT_A8R8G8B8:
case WINED3DFMT_B8G8R8A8_UNORM:
if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA))
{
const DWORD *src = (const DWORD *)ptr;
......
......@@ -599,22 +599,22 @@ HRESULT IWineD3DBaseSurfaceImpl_CreateDIBSection(IWineD3DSurface *iface) {
masks = (DWORD *)b_info->bmiColors;
switch (This->resource.format_desc->format)
{
case WINED3DFMT_R8G8B8:
case WINED3DFMT_B8G8R8_UNORM:
usage = DIB_RGB_COLORS;
b_info->bmiHeader.biCompression = BI_RGB;
break;
case WINED3DFMT_X1R5G5B5:
case WINED3DFMT_A1R5G5B5:
case WINED3DFMT_A4R4G4B4:
case WINED3DFMT_X4R4G4B4:
case WINED3DFMT_R3G3B2:
case WINED3DFMT_A8R3G3B2:
case WINED3DFMT_B5G5R5X1_UNORM:
case WINED3DFMT_B5G5R5A1_UNORM:
case WINED3DFMT_B4G4R4A4_UNORM:
case WINED3DFMT_B4G4R4X4_UNORM:
case WINED3DFMT_B2G3R3_UNORM:
case WINED3DFMT_B2G3R3A8_UNORM:
case WINED3DFMT_R10G10B10A2_UNORM:
case WINED3DFMT_R8G8B8A8_UNORM:
case WINED3DFMT_X8B8G8R8:
case WINED3DFMT_A2R10G10B10:
case WINED3DFMT_R5G6B5:
case WINED3DFMT_R8G8B8X8_UNORM:
case WINED3DFMT_B10G10R10A2_UNORM:
case WINED3DFMT_B5G6R5_UNORM:
case WINED3DFMT_R16G16B16A16_UNORM:
usage = 0;
b_info->bmiHeader.biCompression = BI_BITFIELDS;
......@@ -757,9 +757,9 @@ struct d3dfmt_convertor_desc {
static const struct d3dfmt_convertor_desc convertors[] =
{
{WINED3DFMT_R32_FLOAT, WINED3DFMT_R16_FLOAT, convert_r32_float_r16_float},
{WINED3DFMT_R5G6B5, WINED3DFMT_X8R8G8B8, convert_r5g6b5_x8r8g8b8},
{WINED3DFMT_A8R8G8B8, WINED3DFMT_X8R8G8B8, convert_a8r8g8b8_x8r8g8b8},
{WINED3DFMT_R32_FLOAT, WINED3DFMT_R16_FLOAT, convert_r32_float_r16_float},
{WINED3DFMT_B5G6R5_UNORM, WINED3DFMT_B8G8R8X8_UNORM, convert_r5g6b5_x8r8g8b8},
{WINED3DFMT_B8G8R8A8_UNORM, WINED3DFMT_B8G8R8X8_UNORM, convert_a8r8g8b8_x8r8g8b8},
};
static inline const struct d3dfmt_convertor_desc *find_convertor(WINED3DFORMAT from, WINED3DFORMAT to)
......
......@@ -313,7 +313,7 @@ const char* filename)
}
fprintf(f, "P6\n%d %d\n255\n", This->pow2Width, This->pow2Height);
if (This->resource.format_desc->format == WINED3DFMT_P8)
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT)
{
unsigned char table[256][3];
int i;
......@@ -418,8 +418,8 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
return hr;
}
if (This->resource.format_desc->format == WINED3DFMT_P8
|| This->resource.format_desc->format == WINED3DFMT_A8P8)
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT
|| This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM)
{
unsigned int n;
const PALETTEENTRY *pal = NULL;
......
......@@ -120,7 +120,8 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
cursor.resource.ref = 1;
cursor.resource.wineD3DDevice = This->wineD3DDevice;
cursor.resource.pool = WINED3DPOOL_SCRATCH;
cursor.resource.format_desc = getFormatDescEntry(WINED3DFMT_A8R8G8B8, &This->wineD3DDevice->adapter->gl_info);
cursor.resource.format_desc =
getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &This->wineD3DDevice->adapter->gl_info);
cursor.resource.resourceType = WINED3DRTYPE_SURFACE;
cursor.texture_name = This->wineD3DDevice->cursorTexture;
cursor.texture_target = GL_TEXTURE_2D;
......
......@@ -67,8 +67,8 @@ static void texture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3DSRG
ActivateContext(device, NULL, CTXUSAGE_RESOURCELOAD);
}
if (This->resource.format_desc->format == WINED3DFMT_P8
|| This->resource.format_desc->format == WINED3DFMT_A8P8)
if (This->resource.format_desc->format == WINED3DFMT_P8_UINT
|| This->resource.format_desc->format == WINED3DFMT_P8_UINT_A8_UNORM)
{
for (i = 0; i < This->baseTexture.levels; ++i)
{
......@@ -528,8 +528,8 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT
texture->baseTexture.minMipLookup = minMipLookup_noFilter;
}
else if (gl_info->supported[ARB_TEXTURE_RECTANGLE] && (width != pow2_width || height != pow2_height)
&& !((format_desc->format == WINED3DFMT_P8) && gl_info->supported[EXT_PALETTED_TEXTURE]
&& (wined3d_settings.rendertargetlock_mode == RTL_READTEX)))
&& !(format_desc->format == WINED3DFMT_P8_UINT && gl_info->supported[EXT_PALETTED_TEXTURE]
&& wined3d_settings.rendertargetlock_mode == RTL_READTEX))
{
if ((width != 1) || (height != 1)) texture->baseTexture.pow2Matrix_identity = FALSE;
......
......@@ -5,6 +5,7 @@
* Copyright 2004 Jason Edmeades
* Copyright 2004 Christian Costa
* Copyright 2005 Oliver Stieber
* Copyright 2009 Henri Verbeet for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -130,7 +131,7 @@ static BOOL declaration_element_valid_ffp(const WINED3DVERTEXELEMENT *element)
case WINED3DFMT_R32G32_FLOAT:
case WINED3DFMT_R32G32B32_FLOAT:
case WINED3DFMT_R32G32B32A32_FLOAT:
case WINED3DFMT_A8R8G8B8:
case WINED3DFMT_B8G8R8A8_UNORM:
case WINED3DFMT_R8G8B8A8_UINT:
case WINED3DFMT_R16G16_SINT:
case WINED3DFMT_R16G16B16A16_SINT:
......@@ -174,7 +175,7 @@ static BOOL declaration_element_valid_ffp(const WINED3DVERTEXELEMENT *element)
{
case WINED3DFMT_R32G32B32_FLOAT:
case WINED3DFMT_R32G32B32A32_FLOAT:
case WINED3DFMT_A8R8G8B8:
case WINED3DFMT_B8G8R8A8_UNORM:
case WINED3DFMT_R8G8B8A8_UINT:
case WINED3DFMT_R16G16B16A16_SINT:
case WINED3DFMT_R8G8B8A8_UNORM:
......
......@@ -132,39 +132,33 @@ typedef enum _WINED3DDEGREETYPE
typedef enum _WINED3DFORMAT
{
WINED3DFMT_UNKNOWN,
WINED3DFMT_R8G8B8,
WINED3DFMT_A8R8G8B8,
WINED3DFMT_X8R8G8B8,
WINED3DFMT_R5G6B5,
WINED3DFMT_X1R5G5B5,
WINED3DFMT_A1R5G5B5,
WINED3DFMT_A4R4G4B4,
WINED3DFMT_R3G3B2,
WINED3DFMT_A8R3G3B2,
WINED3DFMT_X4R4G4B4,
WINED3DFMT_X8B8G8R8,
WINED3DFMT_A2R10G10B10,
WINED3DFMT_A8P8,
WINED3DFMT_P8,
WINED3DFMT_L8,
WINED3DFMT_A8L8,
WINED3DFMT_A4L4,
WINED3DFMT_L6V5U5,
WINED3DFMT_X8L8V8U8,
WINED3DFMT_W11V11U10,
WINED3DFMT_A2W10V10U10,
WINED3DFMT_B8G8R8_UNORM,
WINED3DFMT_B5G5R5X1_UNORM,
WINED3DFMT_B4G4R4A4_UNORM,
WINED3DFMT_B2G3R3_UNORM,
WINED3DFMT_B2G3R3A8_UNORM,
WINED3DFMT_B4G4R4X4_UNORM,
WINED3DFMT_R8G8B8X8_UNORM,
WINED3DFMT_B10G10R10A2_UNORM,
WINED3DFMT_P8_UINT_A8_UNORM,
WINED3DFMT_P8_UINT,
WINED3DFMT_L8_UNORM,
WINED3DFMT_L8A8_UNORM,
WINED3DFMT_L4A4_UNORM,
WINED3DFMT_R5G5_SNORM_L6_UNORM,
WINED3DFMT_R8G8_SNORM_L8X8_UNORM,
WINED3DFMT_R10G11B11_SNORM,
WINED3DFMT_R10G10B10_SNORM_A2_UNORM,
WINED3DFMT_D16_LOCKABLE,
WINED3DFMT_D32,
WINED3DFMT_D15S1,
WINED3DFMT_D24S8,
WINED3DFMT_D24X8,
WINED3DFMT_D24X4S4,
WINED3DFMT_L16,
WINED3DFMT_D32F_LOCKABLE,
WINED3DFMT_D24FS8,
WINED3DFMT_D32_UNORM,
WINED3DFMT_S1_UINT_D15_UNORM,
WINED3DFMT_S8_UINT_D24_UNORM,
WINED3DFMT_X8D24_UNORM,
WINED3DFMT_S4X4_UINT_D24_UNORM,
WINED3DFMT_L16_UNORM,
WINED3DFMT_S8_UINT_D24_FLOAT,
WINED3DFMT_VERTEXDATA,
WINED3DFMT_CxV8U8,
/* DXGI formats */
WINED3DFMT_R8G8_SNORM_Cx,
WINED3DFMT_R32G32B32A32_TYPELESS,
WINED3DFMT_R32G32B32A32_FLOAT,
WINED3DFMT_R32G32B32A32_UINT,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment