[PATCH 1/4] wined3d: Implement D3D11_STANDARD_MULTISAMPLE_PATTERN.

Henri Verbeet hverbeet at codeweavers.com
Mon Oct 22 05:27:21 CDT 2018


From: Andrew Wesie <awesie at gmail.com>

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45197
Signed-off-by: Andrew Wesie <awesie at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
---
 dlls/wined3d/texture.c | 8 +++++---
 include/wine/wined3d.h | 2 ++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index b8e7ef03489..15492cd86fe 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -627,6 +627,8 @@ static void wined3d_texture_allocate_gl_immutable_storage(struct wined3d_texture
     unsigned int samples = wined3d_texture_get_gl_sample_count(texture);
     GLsizei height = wined3d_texture_get_level_pow2_height(texture, 0);
     GLsizei width = wined3d_texture_get_level_pow2_width(texture, 0);
+    GLboolean standard_pattern = texture->resource.multisample_type != WINED3D_MULTISAMPLE_NON_MASKABLE
+            && texture->resource.multisample_quality == WINED3D_STANDARD_MULTISAMPLE_PATTERN;
 
     switch (texture->target)
     {
@@ -640,11 +642,11 @@ static void wined3d_texture_allocate_gl_immutable_storage(struct wined3d_texture
             break;
         case GL_TEXTURE_2D_MULTISAMPLE:
             GL_EXTCALL(glTexStorage2DMultisample(texture->target, samples,
-                    gl_internal_format, width, height, GL_FALSE));
+                    gl_internal_format, width, height, standard_pattern));
             break;
         case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
             GL_EXTCALL(glTexStorage3DMultisample(texture->target, samples,
-                    gl_internal_format, width, height, texture->layer_count, GL_FALSE));
+                    gl_internal_format, width, height, texture->layer_count, standard_pattern));
             break;
         case GL_TEXTURE_1D_ARRAY:
             GL_EXTCALL(glTexStorage2D(texture->target, texture->level_count,
@@ -3604,7 +3606,7 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
         }
         if (desc->multisample_type != WINED3D_MULTISAMPLE_NON_MASKABLE
                 && (!(format->multisample_types & 1u << (desc->multisample_type - 1))
-                || desc->multisample_quality))
+                || (desc->multisample_quality && desc->multisample_quality != WINED3D_STANDARD_MULTISAMPLE_PATTERN)))
         {
             WARN("Unsupported multisample type %u quality %u requested.\n", desc->multisample_type,
                     desc->multisample_quality);
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 95549e96cb4..1b3a46e6567 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1571,6 +1571,8 @@ enum wined3d_shader_type
 #define WINED3D_TEXTURE_CREATE_GET_DC                           0x00000008
 #define WINED3D_TEXTURE_CREATE_GENERATE_MIPMAPS                 0x00000010
 
+#define WINED3D_STANDARD_MULTISAMPLE_PATTERN                    0xffffffff
+
 #define WINED3D_APPEND_ALIGNED_ELEMENT                          0xffffffff
 
 #define WINED3D_OUTPUT_SLOT_SEMANTIC                            0xffffffff
-- 
2.11.0




More information about the wine-devel mailing list