Commit fa97fbdc authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Make shader_cleanup more useful.

parent 67b1f4a7
...@@ -986,9 +986,11 @@ static void shader_arb_select_depth_blt(IWineD3DDevice *iface) { ...@@ -986,9 +986,11 @@ static void shader_arb_select_depth_blt(IWineD3DDevice *iface) {
glEnable(GL_FRAGMENT_PROGRAM_ARB); glEnable(GL_FRAGMENT_PROGRAM_ARB);
} }
static void shader_arb_cleanup(BOOL usePS, BOOL useVS) { static void shader_arb_cleanup(IWineD3DDevice *iface) {
if (useVS) glDisable(GL_VERTEX_PROGRAM_ARB); IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
if (usePS) glDisable(GL_FRAGMENT_PROGRAM_ARB); WineD3D_GL_Info *gl_info = &((IWineD3DImpl *)(This->wineD3D))->gl_info;
if (GL_SUPPORT(ARB_VERTEX_PROGRAM)) glDisable(GL_VERTEX_PROGRAM_ARB);
if (GL_SUPPORT(ARB_FRAGMENT_PROGRAM)) glDisable(GL_FRAGMENT_PROGRAM_ARB);
} }
const shader_backend_t arb_program_shader_backend = { const shader_backend_t arb_program_shader_backend = {
......
...@@ -980,7 +980,7 @@ void shader_delete_constant_list( ...@@ -980,7 +980,7 @@ void shader_delete_constant_list(
static void shader_none_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {} static void shader_none_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {}
static void shader_none_select_depth_blt(IWineD3DDevice *iface) {} static void shader_none_select_depth_blt(IWineD3DDevice *iface) {}
static void shader_none_load_constants(IWineD3DDevice *iface, char usePS, char useVS) {} static void shader_none_load_constants(IWineD3DDevice *iface, char usePS, char useVS) {}
static void shader_none_cleanup(BOOL usePS, BOOL useVS) {} static void shader_none_cleanup(IWineD3DDevice *iface) {}
const shader_backend_t none_shader_backend = { const shader_backend_t none_shader_backend = {
&shader_none_select, &shader_none_select,
......
...@@ -2161,8 +2161,10 @@ static void shader_glsl_select_depth_blt(IWineD3DDevice *iface) { ...@@ -2161,8 +2161,10 @@ static void shader_glsl_select_depth_blt(IWineD3DDevice *iface) {
GL_EXTCALL(glUniform1iARB(loc, 0)); GL_EXTCALL(glUniform1iARB(loc, 0));
} }
static void shader_glsl_cleanup(BOOL usePS, BOOL useVS) { static void shader_glsl_cleanup(IWineD3DDevice *iface) {
/* Nothing to do */ IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
WineD3D_GL_Info *gl_info = &((IWineD3DImpl *)(This->wineD3D))->gl_info;
GL_EXTCALL(glUseProgramObjectARB(0));
} }
const shader_backend_t glsl_shader_backend = { const shader_backend_t glsl_shader_backend = {
......
...@@ -177,7 +177,7 @@ typedef struct { ...@@ -177,7 +177,7 @@ typedef struct {
void (*shader_select)(IWineD3DDevice *iface, BOOL usePS, BOOL useVS); void (*shader_select)(IWineD3DDevice *iface, BOOL usePS, BOOL useVS);
void (*shader_select_depth_blt)(IWineD3DDevice *iface); void (*shader_select_depth_blt)(IWineD3DDevice *iface);
void (*shader_load_constants)(IWineD3DDevice *iface, char usePS, char useVS); void (*shader_load_constants)(IWineD3DDevice *iface, char usePS, char useVS);
void (*shader_cleanup)(BOOL usePS, BOOL useVS); void (*shader_cleanup)(IWineD3DDevice *iface);
} shader_backend_t; } shader_backend_t;
extern const shader_backend_t glsl_shader_backend; extern const shader_backend_t glsl_shader_backend;
......
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