Matteo Bruni : wined3d: Make dummy textures black.

Alexandre Julliard julliard at winehq.org
Wed Jul 6 13:31:10 CDT 2011


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

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Thu Jun 30 15:01:07 2011 +0200

wined3d: Make dummy textures black.

---

 dlls/d3d9/tests/visual.c |    2 +-
 dlls/wined3d/device.c    |   13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 0496896..16047bf 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -12117,7 +12117,7 @@ static void unbound_sampler_test(IDirect3DDevice9 *device)
     }
 
     color = getPixelColorFromSurface(rt, 32, 32);
-    todo_wine ok(color == 0xff000000, "Unbound sampler color is %#x.\n", color);
+    ok(color == 0xff000000, "Unbound sampler color is %#x.\n", color);
 
     hr = IDirect3DDevice9_SetRenderTarget(device, 0, old_rt);
     ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderTarget failed, hr %#x.\n", hr);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index a7e578a..bc9c716 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -958,11 +958,10 @@ static void create_dummy_textures(struct wined3d_device *device)
 {
     const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
     unsigned int i;
-    /* Under DirectX you can have texture stage operations even if no texture is
-    bound, whereas opengl will only do texture operations when a valid texture is
-    bound. We emulate this by creating dummy textures and binding them to each
-    texture stage, but disable all stages by default. Hence if a stage is enabled
-    then the default texture will kick in until replaced by a SetTexture call     */
+    /* Under DirectX you can sample even if no texture is bound, whereas
+     * OpenGL will only allow that when a valid texture is bound.
+     * We emulate this by creating dummy textures and binding them
+     * to each texture stage when the currently set D3D texture is NULL. */
     ENTER_GL();
 
     if (gl_info->supported[APPLE_CLIENT_STORAGE])
@@ -974,7 +973,7 @@ static void create_dummy_textures(struct wined3d_device *device)
 
     for (i = 0; i < gl_info->limits.textures; ++i)
     {
-        GLubyte white = 255;
+        DWORD color = 0x000000ff;
 
         /* Make appropriate texture active */
         GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + i));
@@ -990,7 +989,7 @@ static void create_dummy_textures(struct wined3d_device *device)
         glBindTexture(GL_TEXTURE_2D, device->dummyTextureName[i]);
         checkGLcall("glBindTexture");
 
-        glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 1, 1, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, &white);
+        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color);
         checkGLcall("glTexImage2D");
     }
 




More information about the wine-cvs mailing list