[PATCH v2 1/5] wined3d: Add support for WINED3DFMT_R16_UINT format.

Józef Kucia jkucia at codeweavers.com
Tue Feb 9 04:24:41 CST 2016


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
Version 2: Check for EXT_texture_integer and ARB_texture_rg instead of
OpenGL version 3.0.
---
 dlls/wined3d/utils.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 4d00281..0cc0b4c 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -199,6 +199,7 @@ static const struct wined3d_format_base_flags format_base_flags[] =
     {WINED3DFMT_S8_UINT_D24_FLOAT,  WINED3DFMT_FLAG_FLOAT},
     {WINED3DFMT_R8G8B8A8_UINT,      WINED3DFMT_FLAG_INTEGER},
     {WINED3DFMT_R8G8B8A8_SINT,      WINED3DFMT_FLAG_INTEGER},
+    {WINED3DFMT_R16_UINT,           WINED3DFMT_FLAG_INTEGER},
 };
 
 struct wined3d_format_block_info
@@ -1138,6 +1139,10 @@ static const struct wined3d_format_texture_info format_texture_info[] =
             WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING
             | WINED3DFMT_FLAG_RENDERTARGET,
             ARB_TEXTURE_RG,             NULL},
+    {WINED3DFMT_R16_UINT,               GL_R16UI,                         GL_R16UI,                               0,
+            GL_RED_INTEGER,             GL_UNSIGNED_SHORT,                0,
+            WINED3DFMT_FLAG_TEXTURE,
+            ARB_TEXTURE_RG,             NULL},
     /* Luminance */
     {WINED3DFMT_L8_UNORM,               GL_LUMINANCE8,                    GL_SLUMINANCE8_EXT,                     0,
             GL_LUMINANCE,               GL_UNSIGNED_BYTE,                 0,
@@ -2319,6 +2324,11 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win
                 && (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FLOAT))
             continue;
 
+        /* ARB_texture_rg defines integer formats if ARB_texture_integer is also supported. */
+        if (!gl_info->supported[EXT_TEXTURE_INTEGER]
+                && (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_INTEGER))
+            continue;
+
         format->glInternal = format_texture_info[i].gl_internal;
         format->glGammaInternal = format_texture_info[i].gl_srgb_internal;
         format->rtInternal = format_texture_info[i].gl_rt_internal;
-- 
2.4.10




More information about the wine-patches mailing list