wined3d: Pass format_desc to set_shader().
This should be the last unnecessary getFormatDescEntry() call.
This commit is contained in:
parent
dd1f0d9c48
commit
afc5744e70
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue