Commit 93a824d7 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Explicitly pass data and gl_info to shader_select_depth_blt().

parent 363d8a31
...@@ -4624,13 +4624,12 @@ static void shader_arb_select(const struct wined3d_context *context, BOOL usePS, ...@@ -4624,13 +4624,12 @@ static void shader_arb_select(const struct wined3d_context *context, BOOL usePS,
} }
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static void shader_arb_select_depth_blt(IWineD3DDevice *iface, enum tex_types tex_type, const SIZE *ds_mask_size) static void shader_arb_select_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info,
enum tex_types tex_type, const SIZE *ds_mask_size)
{ {
const float mask[] = {0.0f, 0.0f, (float)ds_mask_size->cx, (float)ds_mask_size->cy}; const float mask[] = {0.0f, 0.0f, (float)ds_mask_size->cx, (float)ds_mask_size->cy};
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
BOOL masked = ds_mask_size->cx && ds_mask_size->cy; BOOL masked = ds_mask_size->cx && ds_mask_size->cy;
struct shader_arb_priv *priv = This->shader_priv; struct shader_arb_priv *priv = shader_priv;
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
GLuint *blt_fprogram; GLuint *blt_fprogram;
if (!priv->depth_blt_vprogram_id) priv->depth_blt_vprogram_id = create_arb_blt_vertex_program(gl_info); if (!priv->depth_blt_vprogram_id) priv->depth_blt_vprogram_id = create_arb_blt_vertex_program(gl_info);
......
...@@ -4622,13 +4622,11 @@ static void shader_glsl_select(const struct wined3d_context *context, BOOL usePS ...@@ -4622,13 +4622,11 @@ static void shader_glsl_select(const struct wined3d_context *context, BOOL usePS
} }
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static void shader_glsl_select_depth_blt(IWineD3DDevice *iface, static void shader_glsl_select_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info,
enum tex_types tex_type, const SIZE *ds_mask_size) enum tex_types tex_type, const SIZE *ds_mask_size)
{ {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
BOOL masked = ds_mask_size->cx && ds_mask_size->cy; BOOL masked = ds_mask_size->cx && ds_mask_size->cy;
struct shader_glsl_priv *priv = This->shader_priv; struct shader_glsl_priv *priv = shader_priv;
GLhandleARB *blt_program; GLhandleARB *blt_program;
GLint loc; GLint loc;
......
...@@ -1510,7 +1510,8 @@ static void shader_cleanup(IWineD3DBaseShader *iface) ...@@ -1510,7 +1510,8 @@ static void shader_cleanup(IWineD3DBaseShader *iface)
static void shader_none_handle_instruction(const struct wined3d_shader_instruction *ins) {} static void shader_none_handle_instruction(const struct wined3d_shader_instruction *ins) {}
static void shader_none_select(const struct wined3d_context *context, BOOL usePS, BOOL useVS) {} static void shader_none_select(const struct wined3d_context *context, BOOL usePS, BOOL useVS) {}
static void shader_none_select_depth_blt(IWineD3DDevice *iface, enum tex_types tex_type, const SIZE *ds_mask_size) {} static void shader_none_select_depth_blt(void *shader_priv, const struct wined3d_gl_info *gl_info,
enum tex_types tex_type, const SIZE *ds_mask_size) {}
static void shader_none_deselect_depth_blt(IWineD3DDevice *iface) {} static void shader_none_deselect_depth_blt(IWineD3DDevice *iface) {}
static void shader_none_update_float_vertex_constants(IWineD3DDevice *iface, UINT start, UINT count) {} static void shader_none_update_float_vertex_constants(IWineD3DDevice *iface, UINT start, UINT count) {}
static void shader_none_update_float_pixel_constants(IWineD3DDevice *iface, UINT start, UINT count) {} static void shader_none_update_float_pixel_constants(IWineD3DDevice *iface, UINT start, UINT count) {}
......
...@@ -4102,8 +4102,8 @@ static void surface_depth_blt(IWineD3DSurfaceImpl *This, const struct wined3d_gl ...@@ -4102,8 +4102,8 @@ static void surface_depth_blt(IWineD3DSurfaceImpl *This, const struct wined3d_gl
if (compare_mode != GL_NONE) glTexParameteri(info.bind_target, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE); if (compare_mode != GL_NONE) glTexParameteri(info.bind_target, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE);
} }
device->shader_backend->shader_select_depth_blt((IWineD3DDevice *)device, device->shader_backend->shader_select_depth_blt(device->shader_priv,
info.tex_type, &This->ds_current_size); gl_info, info.tex_type, &This->ds_current_size);
glBegin(GL_TRIANGLE_STRIP); glBegin(GL_TRIANGLE_STRIP);
glTexCoord3fv(info.coords[0]); glTexCoord3fv(info.coords[0]);
......
...@@ -744,7 +744,8 @@ struct wined3d_state; ...@@ -744,7 +744,8 @@ struct wined3d_state;
typedef struct { typedef struct {
void (*shader_handle_instruction)(const struct wined3d_shader_instruction *); void (*shader_handle_instruction)(const struct wined3d_shader_instruction *);
void (*shader_select)(const struct wined3d_context *context, BOOL usePS, BOOL useVS); void (*shader_select)(const struct wined3d_context *context, BOOL usePS, BOOL useVS);
void (*shader_select_depth_blt)(IWineD3DDevice *iface, enum tex_types tex_type, const SIZE *ds_mask_size); void (*shader_select_depth_blt)(void *shader_priv, const struct wined3d_gl_info *gl_info,
enum tex_types tex_type, const SIZE *ds_mask_size);
void (*shader_deselect_depth_blt)(IWineD3DDevice *iface); void (*shader_deselect_depth_blt)(IWineD3DDevice *iface);
void (*shader_update_float_vertex_constants)(IWineD3DDevice *iface, UINT start, UINT count); void (*shader_update_float_vertex_constants)(IWineD3DDevice *iface, UINT start, UINT count);
void (*shader_update_float_pixel_constants)(IWineD3DDevice *iface, UINT start, UINT count); void (*shader_update_float_pixel_constants)(IWineD3DDevice *iface, UINT start, UINT count);
......
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