wined3d: Explicitly pass blit_priv and gl_info to set_shader().

oldstable
Henri Verbeet 2010-12-09 23:41:18 +01:00 committed by Alexandre Julliard
parent 0caed0a771
commit ae7a20af2f
4 changed files with 8 additions and 12 deletions

View File

@ -7027,13 +7027,11 @@ static GLuint gen_yuv_shader(struct arbfp_blit_priv *priv, const struct wined3d_
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static HRESULT arbfp_blit_set(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface) static HRESULT arbfp_blit_set(void *blit_priv, const struct wined3d_gl_info *gl_info, IWineD3DSurfaceImpl *surface)
{ {
GLenum shader; GLenum shader;
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
float size[4] = {(float) surface->pow2Width, (float) surface->pow2Height, 1.0f, 1.0f}; float size[4] = {(float) surface->pow2Width, (float) surface->pow2Height, 1.0f, 1.0f};
struct arbfp_blit_priv *priv = device->blit_priv; struct arbfp_blit_priv *priv = blit_priv;
enum complex_fixup fixup; enum complex_fixup fixup;
GLenum textype = surface->texture_target; GLenum textype = surface->texture_target;
@ -7190,7 +7188,7 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_
if (!surface_is_offscreen(dst_surface)) if (!surface_is_offscreen(dst_surface))
surface_translate_drawable_coords(dst_surface, context->win_handle, &dst_rect); surface_translate_drawable_coords(dst_surface, context->win_handle, &dst_rect);
arbfp_blit_set((IWineD3DDevice *)device, src_surface); arbfp_blit_set(device->blit_priv, context->gl_info, src_surface);
ENTER_GL(); ENTER_GL();

View File

@ -3358,7 +3358,7 @@ static void surface_blt_to_drawable(IWineD3DDeviceImpl *device,
if (!surface_is_offscreen(dst_surface)) if (!surface_is_offscreen(dst_surface))
surface_translate_drawable_coords(dst_surface, context->win_handle, &dst_rect); surface_translate_drawable_coords(dst_surface, context->win_handle, &dst_rect);
device->blitter->set_shader((IWineD3DDevice *)device, src_surface); device->blitter->set_shader(device->blit_priv, context->gl_info, src_surface);
ENTER_GL(); ENTER_GL();
@ -4752,10 +4752,8 @@ static void ffp_blit_p8_upload_palette(IWineD3DSurfaceImpl *surface, const struc
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static HRESULT ffp_blit_set(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface) static HRESULT ffp_blit_set(void *blit_priv, const struct wined3d_gl_info *gl_info, IWineD3DSurfaceImpl *surface)
{ {
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
enum complex_fixup fixup = get_complex_fixup(surface->resource.format->color_fixup); enum complex_fixup fixup = get_complex_fixup(surface->resource.format->color_fixup);
/* When EXT_PALETTED_TEXTURE is around, palette conversion is done by the GPU /* When EXT_PALETTED_TEXTURE is around, palette conversion is done by the GPU
@ -4876,7 +4874,7 @@ static void cpu_blit_free(IWineD3DDeviceImpl *device)
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static HRESULT cpu_blit_set(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface) static HRESULT cpu_blit_set(void *blit_priv, const struct wined3d_gl_info *gl_info, IWineD3DSurfaceImpl *surface)
{ {
return WINED3D_OK; return WINED3D_OK;
} }

View File

@ -171,7 +171,7 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *
/* Set up the texture. The surface is not in a IWineD3D*Texture container, /* Set up the texture. The surface is not in a IWineD3D*Texture container,
* so there are no d3d texture settings to dirtify * so there are no d3d texture settings to dirtify
*/ */
device->blitter->set_shader((IWineD3DDevice *) device, backbuffer); device->blitter->set_shader(device->blit_priv, context2->gl_info, backbuffer);
glTexParameteri(backbuffer->texture_target, GL_TEXTURE_MIN_FILTER, gl_filter); glTexParameteri(backbuffer->texture_target, GL_TEXTURE_MIN_FILTER, gl_filter);
glTexParameteri(backbuffer->texture_target, GL_TEXTURE_MAG_FILTER, gl_filter); glTexParameteri(backbuffer->texture_target, GL_TEXTURE_MAG_FILTER, gl_filter);

View File

@ -1177,7 +1177,7 @@ struct blit_shader
{ {
HRESULT (*alloc_private)(IWineD3DDeviceImpl *device); HRESULT (*alloc_private)(IWineD3DDeviceImpl *device);
void (*free_private)(IWineD3DDeviceImpl *device); void (*free_private)(IWineD3DDeviceImpl *device);
HRESULT (*set_shader)(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface); HRESULT (*set_shader)(void *blit_priv, const struct wined3d_gl_info *gl_info, IWineD3DSurfaceImpl *surface);
void (*unset_shader)(IWineD3DDevice *iface); void (*unset_shader)(IWineD3DDevice *iface);
BOOL (*blit_supported)(const struct wined3d_gl_info *gl_info, enum blit_operation blit_op, BOOL (*blit_supported)(const struct wined3d_gl_info *gl_info, enum blit_operation blit_op,
const RECT *src_rect, DWORD src_usage, WINED3DPOOL src_pool, const struct wined3d_format *src_format, const RECT *src_rect, DWORD src_usage, WINED3DPOOL src_pool, const struct wined3d_format *src_format,