Henri Verbeet : wined3d: Pass format_desc to set_shader().

Alexandre Julliard julliard at winehq.org
Tue Mar 24 09:01:58 CDT 2009


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Mar 24 10:09:24 2009 +0100

wined3d: Pass format_desc to set_shader().

This should be the last unnecessary getFormatDescEntry() call.

---

 dlls/wined3d/arb_program_shader.c |   13 ++++++-------
 dlls/wined3d/surface.c            |    8 +++++---
 dlls/wined3d/wined3d_private.h    |    3 ++-
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 7b622d4..cf5716a 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -3666,20 +3666,19 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixu
     return shader;
 }
 
-static HRESULT arbfp_blit_set(IWineD3DDevice *iface, WINED3DFORMAT fmt, GLenum textype, UINT width, UINT height) {
+static HRESULT arbfp_blit_set(IWineD3DDevice *iface, const struct GlPixelFormatDesc *format_desc,
+        GLenum textype, UINT width, UINT height)
+{
     GLenum shader;
     IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface;
     float size[4] = {width, height, 1, 1};
     struct arbfp_blit_priv *priv = device->blit_priv;
-    const struct GlPixelFormatDesc *glDesc;
     enum yuv_fixup yuv_fixup;
 
-    glDesc = getFormatDescEntry(fmt, &GLINFO_LOCATION);
-
-    if (!is_yuv_fixup(glDesc->color_fixup))
+    if (!is_yuv_fixup(format_desc->color_fixup))
     {
         TRACE("Fixup:\n");
-        dump_color_fixup_desc(glDesc->color_fixup);
+        dump_color_fixup_desc(format_desc->color_fixup);
         /* Don't bother setting up a shader for unconverted formats */
         ENTER_GL();
         glEnable(textype);
@@ -3688,7 +3687,7 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, WINED3DFORMAT fmt, GLenum t
         return WINED3D_OK;
     }
 
-    yuv_fixup = get_yuv_fixup(glDesc->color_fixup);
+    yuv_fixup = get_yuv_fixup(format_desc->color_fixup);
 
     switch(yuv_fixup)
     {
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index fc71ecf..ecca666 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -3474,8 +3474,8 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
             rect.y1 += This->currentDesc.Height - h; rect.y2 += This->currentDesc.Height - h;
         }
 
-        myDevice->blitter->set_shader((IWineD3DDevice *) myDevice, Src->resource.format_desc->format,
-                                       Src->glDescription.target, Src->pow2Width, Src->pow2Height);
+        myDevice->blitter->set_shader((IWineD3DDevice *) myDevice, Src->resource.format_desc,
+                Src->glDescription.target, Src->pow2Width, Src->pow2Height);
 
         ENTER_GL();
 
@@ -4812,7 +4812,9 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
 static HRESULT ffp_blit_alloc(IWineD3DDevice *iface) { return WINED3D_OK; }
 static void ffp_blit_free(IWineD3DDevice *iface) { }
 
-static HRESULT ffp_blit_set(IWineD3DDevice *iface, WINED3DFORMAT fmt, GLenum textype, UINT width, UINT height) {
+static HRESULT ffp_blit_set(IWineD3DDevice *iface, const struct GlPixelFormatDesc *format_desc,
+        GLenum textype, UINT width, UINT height)
+{
     glEnable(textype);
     checkGLcall("glEnable(textype)");
     return WINED3D_OK;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index eab085d..2125366 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -782,7 +782,8 @@ HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_
 struct blit_shader {
     HRESULT (*alloc_private)(IWineD3DDevice *iface);
     void (*free_private)(IWineD3DDevice *iface);
-    HRESULT (*set_shader)(IWineD3DDevice *iface, WINED3DFORMAT fmt, GLenum textype, UINT width, UINT height);
+    HRESULT (*set_shader)(IWineD3DDevice *iface, const struct GlPixelFormatDesc *format_desc,
+            GLenum textype, UINT width, UINT height);
     void (*unset_shader)(IWineD3DDevice *iface);
     BOOL (*color_fixup_supported)(struct color_fixup_desc fixup);
 };




More information about the wine-cvs mailing list