Henri Verbeet : wined3d: Disable client storage in upload_palette().

Alexandre Julliard julliard at winehq.org
Tue Dec 6 15:46:17 CST 2011


Module: wine
Branch: master
Commit: 107369d018cb9d6426538ed0a011e7518eacece3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=107369d018cb9d6426538ed0a011e7518eacece3

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Dec  5 22:06:54 2011 +0100

wined3d: Disable client storage in upload_palette().

Stack pointers don't work so well with client storage.

---

 dlls/wined3d/arb_program_shader.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 86eb5f1..ecb2c03 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -6950,6 +6950,13 @@ static void upload_palette(const struct wined3d_surface *surface, struct wined3d
     d3dfmt_p8_init_palette(surface, table, colorkey);
 
     ENTER_GL();
+
+    if (gl_info->supported[APPLE_CLIENT_STORAGE])
+    {
+        glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_FALSE);
+        checkGLcall("glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_FALSE)");
+    }
+
     if (!priv->palette_texture)
         glGenTextures(1, &priv->palette_texture);
 
@@ -6966,6 +6973,12 @@ static void upload_palette(const struct wined3d_surface *surface, struct wined3d
     /* TODO: avoid unneeded uploads in the future by adding some SFLAG_PALETTE_DIRTY mechanism */
     glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, table);
 
+    if (gl_info->supported[APPLE_CLIENT_STORAGE])
+    {
+        glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE);
+        checkGLcall("glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE)");
+    }
+
     /* Switch back to unit 0 in which the 2D texture will be stored. */
     context_active_texture(context, gl_info, 0);
     LEAVE_GL();




More information about the wine-cvs mailing list