=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Query supported sample counts for multisample textures.

Alexandre Julliard julliard at winehq.org
Tue Feb 13 13:57:55 CST 2018


Module: wine
Branch: master
Commit: ae5d802bda0edc9b1cc1f3410f8d376c4dd072e7
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ae5d802bda0edc9b1cc1f3410f8d376c4dd072e7

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon Feb 12 18:46:22 2018 +0100

wined3d: Query supported sample counts for multisample textures.

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 | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index c4d6e65..6f7740d 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -2805,6 +2805,7 @@ static void query_internal_format(struct wined3d_adapter *adapter,
 {
     GLint count, multisample_types[MAX_MULTISAMPLE_TYPES];
     unsigned int i, max_log2;
+    GLenum target;
 
     if (gl_info->supported[ARB_INTERNALFORMAT_QUERY2])
     {
@@ -2877,17 +2878,17 @@ static void query_internal_format(struct wined3d_adapter *adapter,
     {
         if (gl_info->supported[ARB_INTERNALFORMAT_QUERY])
         {
+            target = gl_info->supported[ARB_TEXTURE_MULTISAMPLE] ? GL_TEXTURE_2D_MULTISAMPLE : GL_RENDERBUFFER;
             count = 0;
-            GL_EXTCALL(glGetInternalformativ(GL_RENDERBUFFER, format->glInternal,
+            GL_EXTCALL(glGetInternalformativ(target, format->glInternal,
                     GL_NUM_SAMPLE_COUNTS, 1, &count));
-            checkGLcall("glGetInternalformativ(GL_NUM_SAMPLE_COUNTS)");
             count = min(count, MAX_MULTISAMPLE_TYPES);
-            GL_EXTCALL(glGetInternalformativ(GL_RENDERBUFFER, format->glInternal,
+            GL_EXTCALL(glGetInternalformativ(target, format->glInternal,
                     GL_SAMPLES, count, multisample_types));
-            checkGLcall("glGetInternalformativ(GL_SAMPLES)");
+            checkGLcall("query sample counts");
             for (i = 0; i < count; ++i)
             {
-                if (multisample_types[i] > sizeof(format->multisample_types) * 8)
+                if (multisample_types[i] > sizeof(format->multisample_types) * CHAR_BIT)
                     continue;
                 format->multisample_types |= 1u << (multisample_types[i] - 1);
             }
@@ -2895,7 +2896,7 @@ static void query_internal_format(struct wined3d_adapter *adapter,
         else
         {
             max_log2 = wined3d_log2i(min(gl_info->limits.samples,
-                    sizeof(format->multisample_types) * 8));
+                    sizeof(format->multisample_types) * CHAR_BIT));
             for (i = 1; i <= max_log2; ++i)
                 format->multisample_types |= 1u << ((1u << i) - 1);
         }




More information about the wine-cvs mailing list