wined3d: Make shader_cleanup more useful.

This commit is contained in:
Stefan Dösinger 2007-02-08 22:31:01 +01:00 committed by Alexandre Julliard
parent 67b1f4a7e9
commit fa97fbdcad
4 changed files with 11 additions and 7 deletions

View file

@ -986,9 +986,11 @@ static void shader_arb_select_depth_blt(IWineD3DDevice *iface) {
glEnable(GL_FRAGMENT_PROGRAM_ARB);
}
static void shader_arb_cleanup(BOOL usePS, BOOL useVS) {
if (useVS) glDisable(GL_VERTEX_PROGRAM_ARB);
if (usePS) glDisable(GL_FRAGMENT_PROGRAM_ARB);
static void shader_arb_cleanup(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
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 = {

View file

@ -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_depth_blt(IWineD3DDevice *iface) {}
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 = {
&shader_none_select,

View file

@ -2161,8 +2161,10 @@ static void shader_glsl_select_depth_blt(IWineD3DDevice *iface) {
GL_EXTCALL(glUniform1iARB(loc, 0));
}
static void shader_glsl_cleanup(BOOL usePS, BOOL useVS) {
/* Nothing to do */
static void shader_glsl_cleanup(IWineD3DDevice *iface) {
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 = {

View file

@ -177,7 +177,7 @@ typedef struct {
void (*shader_select)(IWineD3DDevice *iface, BOOL usePS, BOOL useVS);
void (*shader_select_depth_blt)(IWineD3DDevice *iface);
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;
extern const shader_backend_t glsl_shader_backend;