Commit afc5744e authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass format_desc to set_shader().

This should be the last unnecessary getFormatDescEntry() call.
parent dd1f0d9c
...@@ -3666,20 +3666,19 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixu ...@@ -3666,20 +3666,19 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixu
return shader; 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; GLenum shader;
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface; IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface;
float size[4] = {width, height, 1, 1}; float size[4] = {width, height, 1, 1};
struct arbfp_blit_priv *priv = device->blit_priv; struct arbfp_blit_priv *priv = device->blit_priv;
const struct GlPixelFormatDesc *glDesc;
enum yuv_fixup yuv_fixup; enum yuv_fixup yuv_fixup;
glDesc = getFormatDescEntry(fmt, &GLINFO_LOCATION); if (!is_yuv_fixup(format_desc->color_fixup))
if (!is_yuv_fixup(glDesc->color_fixup))
{ {
TRACE("Fixup:\n"); 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 */ /* Don't bother setting up a shader for unconverted formats */
ENTER_GL(); ENTER_GL();
glEnable(textype); glEnable(textype);
...@@ -3688,7 +3687,7 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, WINED3DFORMAT fmt, GLenum t ...@@ -3688,7 +3687,7 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, WINED3DFORMAT fmt, GLenum t
return WINED3D_OK; return WINED3D_OK;
} }
yuv_fixup = get_yuv_fixup(glDesc->color_fixup); yuv_fixup = get_yuv_fixup(format_desc->color_fixup);
switch(yuv_fixup) switch(yuv_fixup)
{ {
......
...@@ -3474,8 +3474,8 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const ...@@ -3474,8 +3474,8 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
rect.y1 += This->currentDesc.Height - h; rect.y2 += This->currentDesc.Height - h; rect.y1 += This->currentDesc.Height - h; rect.y2 += This->currentDesc.Height - h;
} }
myDevice->blitter->set_shader((IWineD3DDevice *) myDevice, Src->resource.format_desc->format, myDevice->blitter->set_shader((IWineD3DDevice *) myDevice, Src->resource.format_desc,
Src->glDescription.target, Src->pow2Width, Src->pow2Height); Src->glDescription.target, Src->pow2Width, Src->pow2Height);
ENTER_GL(); ENTER_GL();
...@@ -4812,7 +4812,9 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl = ...@@ -4812,7 +4812,9 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
static HRESULT ffp_blit_alloc(IWineD3DDevice *iface) { return WINED3D_OK; } static HRESULT ffp_blit_alloc(IWineD3DDevice *iface) { return WINED3D_OK; }
static void ffp_blit_free(IWineD3DDevice *iface) { } 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); glEnable(textype);
checkGLcall("glEnable(textype)"); checkGLcall("glEnable(textype)");
return WINED3D_OK; return WINED3D_OK;
......
...@@ -782,7 +782,8 @@ HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_ ...@@ -782,7 +782,8 @@ HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_
struct blit_shader { struct blit_shader {
HRESULT (*alloc_private)(IWineD3DDevice *iface); HRESULT (*alloc_private)(IWineD3DDevice *iface);
void (*free_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); void (*unset_shader)(IWineD3DDevice *iface);
BOOL (*color_fixup_supported)(struct color_fixup_desc fixup); BOOL (*color_fixup_supported)(struct color_fixup_desc fixup);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment