[PATCH 4/7] wined3d: Initialise typeless_id for typeless formats early.

Józef Kucia jkucia at codeweavers.com
Mon Sep 17 04:06:25 CDT 2018


Allows us to use wined3d_format_is_typeless() while initialising
formats.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/wined3d/utils.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index eb4001df6e73..0d87ffda914e 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -2025,7 +2025,7 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter)
 
     for (i = 0; i < ARRAY_SIZE(typed_formats); ++i)
     {
-        const struct wined3d_format *typeless_format;
+        struct wined3d_format *typeless_format;
         unsigned int component_count = 0;
         DWORD flags = 0;
 
@@ -2052,6 +2052,8 @@ static BOOL init_format_base_info(struct wined3d_adapter *adapter)
         format->block_byte_count = typeless_format->block_byte_count;
         format->typeless_id = typeless_format->id;
 
+        typeless_format->typeless_id = typeless_format->id;
+
         for (j = 0; j < strlen(typed_formats[i].channels); ++j)
         {
             enum wined3d_channel_type channel_type = map_channel_type(typed_formats[i].channels[j]);
-- 
2.16.4




More information about the wine-devel mailing list