=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Get rid of MAX_MULTISAMPLE_TYPES.
Alexandre Julliard
julliard at winehq.org
Thu May 17 19:10:58 CDT 2018
Module: wine
Branch: master
Commit: 087730c057315c44f3abbea6885b278692cabb62
URL: https://source.winehq.org/git/wine.git/?a=commit;h=087730c057315c44f3abbea6885b278692cabb62
Author: Józef Kucia <jkucia at codeweavers.com>
Date: Thu May 17 13:17:40 2018 +0200
wined3d: Get rid of MAX_MULTISAMPLE_TYPES.
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 | 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 49b08bf..655fdb1 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 f40d163..3e344a5 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
{
More information about the wine-cvs
mailing list