wined3d: Set the sampler only once in shader_glsl_select_depth_blt().

It (obviously) never changes.
This commit is contained in:
Henri Verbeet 2008-10-20 00:15:13 +02:00 committed by Alexandre Julliard
parent 2188aa87d6
commit bf187ed1e0
1 changed files with 5 additions and 4 deletions

View File

@ -3458,15 +3458,16 @@ static void shader_glsl_select_depth_blt(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
WineD3D_GL_Info *gl_info = &This->adapter->gl_info; WineD3D_GL_Info *gl_info = &This->adapter->gl_info;
struct shader_glsl_priv *priv = (struct shader_glsl_priv *) This->shader_priv; struct shader_glsl_priv *priv = (struct shader_glsl_priv *) This->shader_priv;
static GLhandleARB loc = -1;
if (!priv->depth_blt_glsl_program_id) { if (!priv->depth_blt_glsl_program_id) {
GLhandleARB loc;
priv->depth_blt_glsl_program_id = create_glsl_blt_shader(gl_info); priv->depth_blt_glsl_program_id = create_glsl_blt_shader(gl_info);
loc = GL_EXTCALL(glGetUniformLocationARB(priv->depth_blt_glsl_program_id, "sampler")); loc = GL_EXTCALL(glGetUniformLocationARB(priv->depth_blt_glsl_program_id, "sampler"));
GL_EXTCALL(glUseProgramObjectARB(priv->depth_blt_glsl_program_id));
GL_EXTCALL(glUniform1iARB(loc, 0));
} else {
GL_EXTCALL(glUseProgramObjectARB(priv->depth_blt_glsl_program_id));
} }
GL_EXTCALL(glUseProgramObjectARB(priv->depth_blt_glsl_program_id));
GL_EXTCALL(glUniform1iARB(loc, 0));
} }
static void shader_glsl_deselect_depth_blt(IWineD3DDevice *iface) { static void shader_glsl_deselect_depth_blt(IWineD3DDevice *iface) {