[PATCH 5/6] wined3d: Introduce R10G10B10X2 vertex formats for D3D8/9.
Józef Kucia
jkucia at codeweavers.com
Tue Jul 26 05:16:37 CDT 2016
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
This is required in order to properly implement R10G10B10A2_UINT vertex
format for D3D10+.
---
dlls/d3d8/vertexdeclaration.c | 4 ++--
dlls/d3d9/vertexdeclaration.c | 4 ++--
dlls/wined3d/state.c | 4 ++--
dlls/wined3d/utils.c | 8 ++++++--
include/wine/wined3d.h | 2 ++
5 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d8/vertexdeclaration.c b/dlls/d3d8/vertexdeclaration.c
index 7900325..9206a2c 100644
--- a/dlls/d3d8/vertexdeclaration.c
+++ b/dlls/d3d8/vertexdeclaration.c
@@ -220,8 +220,8 @@ static const enum wined3d_format_id wined3d_format_lookup[] =
/*WINED3DDECLTYPE_SHORT4N*/ WINED3DFMT_R16G16B16A16_SNORM,
/*WINED3DDECLTYPE_USHORT2N*/ WINED3DFMT_R16G16_UNORM,
/*WINED3DDECLTYPE_USHORT4N*/ WINED3DFMT_R16G16B16A16_UNORM,
- /*WINED3DDECLTYPE_UDEC3*/ WINED3DFMT_R10G10B10A2_UINT,
- /*WINED3DDECLTYPE_DEC3N*/ WINED3DFMT_R10G10B10A2_SNORM,
+ /*WINED3DDECLTYPE_UDEC3*/ WINED3DFMT_R10G10B10X2_UINT,
+ /*WINED3DDECLTYPE_DEC3N*/ WINED3DFMT_R10G10B10X2_SNORM,
/*WINED3DDECLTYPE_FLOAT16_2*/ WINED3DFMT_R16G16_FLOAT,
/*WINED3DDECLTYPE_FLOAT16_4*/ WINED3DFMT_R16G16B16A16_FLOAT,
};
diff --git a/dlls/d3d9/vertexdeclaration.c b/dlls/d3d9/vertexdeclaration.c
index 914de24..b66827f 100644
--- a/dlls/d3d9/vertexdeclaration.c
+++ b/dlls/d3d9/vertexdeclaration.c
@@ -45,8 +45,8 @@ d3d_dtype_lookup[] =
/* D3DDECLTYPE_SHORT4N */ {WINED3DFMT_R16G16B16A16_SNORM, 4, sizeof(short int)},
/* D3DDECLTYPE_USHORT2N */ {WINED3DFMT_R16G16_UNORM, 2, sizeof(short int)},
/* D3DDECLTYPE_USHORT4N */ {WINED3DFMT_R16G16B16A16_UNORM, 4, sizeof(short int)},
- /* D3DDECLTYPE_UDEC3 */ {WINED3DFMT_R10G10B10A2_UINT, 3, sizeof(short int)},
- /* D3DDECLTYPE_DEC3N */ {WINED3DFMT_R10G10B10A2_SNORM, 3, sizeof(short int)},
+ /* D3DDECLTYPE_UDEC3 */ {WINED3DFMT_R10G10B10X2_UINT, 3, sizeof(short int)},
+ /* D3DDECLTYPE_DEC3N */ {WINED3DFMT_R10G10B10X2_SNORM, 3, sizeof(short int)},
/* D3DDECLTYPE_FLOAT16_2 */ {WINED3DFMT_R16G16_FLOAT, 2, sizeof(short int)},
/* D3DDECLTYPE_FLOAT16_4 */ {WINED3DFMT_R16G16B16A16_FLOAT, 4, sizeof(short int)}
};
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 30ea1c7..a35f9c8 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -4110,11 +4110,11 @@ static void load_numbered_arrays(struct wined3d_context *context,
GL_EXTCALL(glVertexAttrib4Nusv(i, (const GLushort *)ptr));
break;
- case WINED3DFMT_R10G10B10A2_UINT:
+ case WINED3DFMT_R10G10B10X2_UINT:
FIXME("Unsure about WINED3DDECLTYPE_UDEC3.\n");
/*glVertexAttrib3usvARB(i, (const GLushort *)ptr); Does not exist */
break;
- case WINED3DFMT_R10G10B10A2_SNORM:
+ case WINED3DFMT_R10G10B10X2_SNORM:
FIXME("Unsure about WINED3DDECLTYPE_DEC3N.\n");
/*glVertexAttrib3NusvARB(i, (const GLushort *)ptr); Does not exist */
break;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 3406fdd..b686b09 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -124,6 +124,8 @@ static const struct wined3d_format_channels formats[] =
{WINED3DFMT_R8G8_SNORM_L8X8_UNORM, 8, 8, 0, 0, 0, 8, 0, 0, 4, 0, 0},
{WINED3DFMT_R8G8B8A8_SNORM, 8, 8, 8, 8, 0, 8, 16, 24, 4, 0, 0},
{WINED3DFMT_R10G11B11_SNORM, 10, 11, 11, 0, 0, 10, 21, 0, 4, 0, 0},
+ {WINED3DFMT_R10G10B10X2_UINT, 10, 10, 10, 0, 0, 10, 20, 0, 4, 0, 0},
+ {WINED3DFMT_R10G10B10X2_SNORM, 10, 10, 10, 0, 0, 10, 20, 0, 4, 0, 0},
{WINED3DFMT_R10G10B10_SNORM_A2_UNORM, 10, 10, 10, 2, 0, 10, 20, 30, 4, 0, 0},
/* Depth stencil formats */
{WINED3DFMT_D16_LOCKABLE, 0, 0, 0, 0, 0, 0, 0, 0, 2, 16, 0},
@@ -348,8 +350,8 @@ static const struct wined3d_format_vertex_info format_vertex_info[] =
{WINED3DFMT_R16G16B16A16_SNORM, WINED3D_FFP_EMIT_SHORT4N, 4, GL_SHORT, GL_TRUE },
{WINED3DFMT_R16G16_UNORM, WINED3D_FFP_EMIT_USHORT2N, 2, GL_UNSIGNED_SHORT, GL_TRUE },
{WINED3DFMT_R16G16B16A16_UNORM, WINED3D_FFP_EMIT_USHORT4N, 4, GL_UNSIGNED_SHORT, GL_TRUE },
- {WINED3DFMT_R10G10B10A2_UINT, WINED3D_FFP_EMIT_UDEC3, 3, GL_UNSIGNED_SHORT, GL_FALSE},
- {WINED3DFMT_R10G10B10A2_SNORM, WINED3D_FFP_EMIT_DEC3N, 3, GL_SHORT, GL_TRUE },
+ {WINED3DFMT_R10G10B10X2_UINT, WINED3D_FFP_EMIT_UDEC3, 3, GL_UNSIGNED_SHORT, GL_FALSE},
+ {WINED3DFMT_R10G10B10X2_SNORM, WINED3D_FFP_EMIT_DEC3N, 3, GL_SHORT, GL_TRUE },
{WINED3DFMT_R10G10B10A2_UNORM, WINED3D_FFP_EMIT_INVALID, 4, GL_UNSIGNED_INT_2_10_10_10_REV, GL_TRUE,
ARB_VERTEX_TYPE_2_10_10_10_REV},
{WINED3DFMT_R16G16_FLOAT, WINED3D_FFP_EMIT_FLOAT16_2, 2, GL_HALF_FLOAT, GL_FALSE},
@@ -3613,6 +3615,8 @@ const char *debug_d3dformat(enum wined3d_format_id format_id)
FMT_TO_STR(WINED3DFMT_R5G5_SNORM_L6_UNORM);
FMT_TO_STR(WINED3DFMT_R8G8_SNORM_L8X8_UNORM);
FMT_TO_STR(WINED3DFMT_R10G11B11_SNORM);
+ FMT_TO_STR(WINED3DFMT_R10G10B10X2_UINT);
+ FMT_TO_STR(WINED3DFMT_R10G10B10X2_SNORM);
FMT_TO_STR(WINED3DFMT_R10G10B10_SNORM_A2_UNORM);
FMT_TO_STR(WINED3DFMT_UYVY);
FMT_TO_STR(WINED3DFMT_YUY2);
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index a425ac5..ff1a949 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -113,6 +113,8 @@ enum wined3d_format_id
WINED3DFMT_R5G5_SNORM_L6_UNORM,
WINED3DFMT_R8G8_SNORM_L8X8_UNORM,
WINED3DFMT_R10G11B11_SNORM,
+ WINED3DFMT_R10G10B10X2_UINT,
+ WINED3DFMT_R10G10B10X2_SNORM,
WINED3DFMT_R10G10B10_SNORM_A2_UNORM,
WINED3DFMT_D16_LOCKABLE,
WINED3DFMT_D32_UNORM,
--
2.7.3
More information about the wine-patches
mailing list