=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Add support for WINED3DFMT_BC3_UNORM format.

Alexandre Julliard julliard at wine.codeweavers.com
Sat Jan 9 03:32:17 CST 2016


Module: wine
Branch: master
Commit: 9d3460c9e0f76030e60885eef833b95c9e7bb6d5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9d3460c9e0f76030e60885eef833b95c9e7bb6d5

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Jan  7 10:54:39 2016 +0100

wined3d: Add support for WINED3DFMT_BC3_UNORM format.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/utils.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 4406067..9d053a3 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -57,6 +57,7 @@ static const struct wined3d_format_channels formats[] =
     {WINED3DFMT_DXT3,                       0,  0,  0,  0,   0,  0,  0,  0,    1,   0,     0},
     {WINED3DFMT_DXT4,                       0,  0,  0,  0,   0,  0,  0,  0,    1,   0,     0},
     {WINED3DFMT_DXT5,                       0,  0,  0,  0,   0,  0,  0,  0,    1,   0,     0},
+    {WINED3DFMT_BC3_UNORM,                  0,  0,  0,  0,   0,  0,  0,  0,    1,   0,     0},
     {WINED3DFMT_MULTI2_ARGB8,               0,  0,  0,  0,   0,  0,  0,  0,    1,   0,     0},
     {WINED3DFMT_G8R8_G8B8,                  0,  0,  0,  0,   0,  0,  0,  0,    1,   0,     0},
     {WINED3DFMT_R8G8_B8G8,                  0,  0,  0,  0,   0,  0,  0,  0,    1,   0,     0},
@@ -201,15 +202,16 @@ struct wined3d_format_block_info
 
 static const struct wined3d_format_block_info format_block_info[] =
 {
-    {WINED3DFMT_DXT1,   4,  4,  8,  TRUE},
-    {WINED3DFMT_DXT2,   4,  4,  16, TRUE},
-    {WINED3DFMT_DXT3,   4,  4,  16, TRUE},
-    {WINED3DFMT_DXT4,   4,  4,  16, TRUE},
-    {WINED3DFMT_DXT5,   4,  4,  16, TRUE},
-    {WINED3DFMT_ATI1N,  4,  4,  8,  FALSE},
-    {WINED3DFMT_ATI2N,  4,  4,  16, FALSE},
-    {WINED3DFMT_YUY2,   2,  1,  4,  FALSE},
-    {WINED3DFMT_UYVY,   2,  1,  4,  FALSE},
+    {WINED3DFMT_DXT1,      4,  4,  8,  TRUE},
+    {WINED3DFMT_DXT2,      4,  4,  16, TRUE},
+    {WINED3DFMT_DXT3,      4,  4,  16, TRUE},
+    {WINED3DFMT_DXT4,      4,  4,  16, TRUE},
+    {WINED3DFMT_DXT5,      4,  4,  16, TRUE},
+    {WINED3DFMT_BC3_UNORM, 4,  4,  16, TRUE},
+    {WINED3DFMT_ATI1N,     4,  4,  8,  FALSE},
+    {WINED3DFMT_ATI2N,     4,  4,  16, FALSE},
+    {WINED3DFMT_YUY2,      2,  1,  4,  FALSE},
+    {WINED3DFMT_UYVY,      2,  1,  4,  FALSE},
 };
 
 struct wined3d_format_vertex_info
@@ -950,6 +952,11 @@ static const struct wined3d_format_texture_info format_texture_info[] =
             WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING
             | WINED3DFMT_FLAG_SRGB_READ | WINED3DFMT_FLAG_COMPRESSED,
             EXT_TEXTURE_COMPRESSION_S3TC, NULL},
+    {WINED3DFMT_BC3_UNORM,              GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,       0,
+            GL_RGBA,                    GL_UNSIGNED_BYTE,                 0,
+            WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING
+            | WINED3DFMT_FLAG_COMPRESSED,
+            EXT_TEXTURE_COMPRESSION_S3TC, NULL},
     /* IEEE formats */
     {WINED3DFMT_R32_FLOAT,              GL_RGB32F_ARB,                    GL_RGB32F_ARB,                          0,
             GL_RED,                     GL_FLOAT,                         0,
@@ -2648,6 +2655,8 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_
     gl_info->formats[idx].flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE;
     idx = getFmtIdx(WINED3DFMT_DXT5);
     gl_info->formats[idx].flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE;
+    idx = getFmtIdx(WINED3DFMT_BC3_UNORM);
+    gl_info->formats[idx].flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE;
     /* Similarly with ATI1N / ATI2N and GL_ARB_texture_compression_rgtc. */
     idx = getFmtIdx(WINED3DFMT_ATI1N);
     gl_info->formats[idx].flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE;




More information about the wine-cvs mailing list