[PATCH 4/5] wined3d: Get rid of MAX_MULTISAMPLE_TYPES.

Józef Kucia jkucia at codeweavers.com
Thu May 17 06:17:40 CDT 2018


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/wined3d/utils.c           | 6 ++++--
 dlls/wined3d/wined3d_private.h | 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 49b08bfbe4bc..655fdb1d8d3f 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -2756,7 +2756,7 @@ static void query_internal_format(struct wined3d_adapter *adapter,
         struct wined3d_format *format, const struct wined3d_format_texture_info *texture_info,
         struct wined3d_gl_info *gl_info, BOOL srgb_write_supported, BOOL srgb_format)
 {
-    GLint count, multisample_types[MAX_MULTISAMPLE_TYPES];
+    GLint count, multisample_types[8];
     unsigned int i, max_log2;
     GLenum target;
 
@@ -2835,7 +2835,9 @@ static void query_internal_format(struct wined3d_adapter *adapter,
             count = 0;
             GL_EXTCALL(glGetInternalformativ(target, format->glInternal,
                     GL_NUM_SAMPLE_COUNTS, 1, &count));
-            count = min(count, MAX_MULTISAMPLE_TYPES);
+            if (count > ARRAY_SIZE(multisample_types))
+                FIXME("Unexpectedly high number of multisample types %d.\n", count);
+            count = min(count, ARRAY_SIZE(multisample_types));
             GL_EXTCALL(glGetInternalformativ(target, format->glInternal,
                     GL_SAMPLES, count, multisample_types));
             checkGLcall("query sample counts");
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index f40d1639496b..3e344a5f0f3e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -275,7 +275,6 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup
 #define MAX_UNORDERED_ACCESS_VIEWS  8
 #define MAX_TGSM_REGISTERS          8192
 #define MAX_VERTEX_BLENDS           4
-#define MAX_MULTISAMPLE_TYPES       8
 
 struct min_lookup
 {
-- 
2.16.1




More information about the wine-devel mailing list