wined3d: Destroy depth_blt resources in the backend's destructor.

No need to expose this in the interface.
This commit is contained in:
H. Verbeet 2008-07-09 17:59:39 +02:00 committed by Alexandre Julliard
parent 7de6c2674a
commit 54ae3ebfd4
6 changed files with 19 additions and 38 deletions

View File

@ -1819,21 +1819,6 @@ static void shader_arb_select_depth_blt(IWineD3DDevice *iface) {
glEnable(GL_FRAGMENT_PROGRAM_ARB);
}
static void shader_arb_destroy_depth_blt(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
struct shader_arb_priv *priv = (struct shader_arb_priv *) This->shader_priv;
WineD3D_GL_Info *gl_info = &This->adapter->gl_info;
if(priv->depth_blt_vprogram_id) {
GL_EXTCALL(glDeleteProgramsARB(1, &priv->depth_blt_vprogram_id));
priv->depth_blt_vprogram_id = 0;
}
if(priv->depth_blt_fprogram_id) {
GL_EXTCALL(glDeleteProgramsARB(1, &priv->depth_blt_fprogram_id));
priv->depth_blt_fprogram_id = 0;
}
}
static void shader_arb_cleanup(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
WineD3D_GL_Info *gl_info = &This->adapter->gl_info;
@ -1861,6 +1846,16 @@ static HRESULT shader_arb_alloc(IWineD3DDevice *iface) {
static void shader_arb_free(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
WineD3D_GL_Info *gl_info = &This->adapter->gl_info;
struct shader_arb_priv *priv = (struct shader_arb_priv *) This->shader_priv;
if(priv->depth_blt_vprogram_id) {
GL_EXTCALL(glDeleteProgramsARB(1, &priv->depth_blt_vprogram_id));
}
if(priv->depth_blt_fprogram_id) {
GL_EXTCALL(glDeleteProgramsARB(1, &priv->depth_blt_fprogram_id));
}
HeapFree(GetProcessHeap(), 0, This->shader_priv);
}
@ -2097,7 +2092,6 @@ static void shader_arb_fragment_enable(IWineD3DDevice *iface, BOOL enable) {
const shader_backend_t arb_program_shader_backend = {
shader_arb_select,
shader_arb_select_depth_blt,
shader_arb_destroy_depth_blt,
shader_arb_load_constants,
shader_arb_cleanup,
shader_arb_color_correction,

View File

@ -976,10 +976,6 @@ static void shader_atifs_select_depth_blt(IWineD3DDevice *iface) {
arb_program_shader_backend.shader_select_depth_blt(iface);
}
static void shader_atifs_destroy_depth_blt(IWineD3DDevice *iface) {
arb_program_shader_backend.shader_destroy_depth_blt(iface);
}
static void shader_atifs_load_constants(IWineD3DDevice *iface, char usePS, char useVS) {
arb_program_shader_backend.shader_load_constants(iface, usePS, useVS);
}
@ -1111,7 +1107,6 @@ static void shader_atifs_fragment_enable(IWineD3DDevice *iface, BOOL enable) {
const shader_backend_t atifs_shader_backend = {
shader_atifs_select,
shader_atifs_select_depth_blt,
shader_atifs_destroy_depth_blt,
shader_atifs_load_constants,
shader_atifs_cleanup,
shader_atifs_color_correction,

View File

@ -1091,7 +1091,6 @@ void shader_trace_init(
static void shader_none_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {}
static void shader_none_select_depth_blt(IWineD3DDevice *iface) {}
static void shader_none_destroy_depth_blt(IWineD3DDevice *iface) {}
static void shader_none_load_constants(IWineD3DDevice *iface, char usePS, char useVS) {}
static void shader_none_cleanup(IWineD3DDevice *iface) {}
static void shader_none_color_correction(SHADER_OPCODE_ARG* arg) {}
@ -1202,7 +1201,6 @@ static void shader_none_fragment_enable(IWineD3DDevice *iface, BOOL enable) {
const shader_backend_t none_shader_backend = {
shader_none_select,
shader_none_select_depth_blt,
shader_none_destroy_depth_blt,
shader_none_load_constants,
shader_none_cleanup,
shader_none_color_correction,

View File

@ -2283,7 +2283,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D
This->depth_blt_rb_w = 0;
This->depth_blt_rb_h = 0;
}
This->shader_backend->shader_destroy_depth_blt(iface);
This->shader_backend->shader_free_private(iface);
/* Release the update stateblock */
@ -7218,7 +7217,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE
This->depth_blt_rb_w = 0;
This->depth_blt_rb_h = 0;
}
This->shader_backend->shader_destroy_depth_blt(iface);
This->shader_backend->shader_free_private(iface);
for (i = 0; i < GL_LIMITS(textures); i++) {

View File

@ -3398,17 +3398,6 @@ static void shader_glsl_select_depth_blt(IWineD3DDevice *iface) {
GL_EXTCALL(glUniform1iARB(loc, 0));
}
static void shader_glsl_destroy_depth_blt(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
struct shader_glsl_priv *priv = (struct shader_glsl_priv *) This->shader_priv;
WineD3D_GL_Info *gl_info = &This->adapter->gl_info;
if(priv->depth_blt_glsl_program_id) {
GL_EXTCALL(glDeleteObjectARB(priv->depth_blt_glsl_program_id));
priv->depth_blt_glsl_program_id = 0;
}
}
static void shader_glsl_cleanup(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
WineD3D_GL_Info *gl_info = &This->adapter->gl_info;
@ -3483,6 +3472,15 @@ static HRESULT shader_glsl_alloc(IWineD3DDevice *iface) {
static void shader_glsl_free(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
WineD3D_GL_Info *gl_info = &This->adapter->gl_info;
struct shader_glsl_priv *priv = (struct shader_glsl_priv *)This->shader_priv;
if(priv->depth_blt_glsl_program_id) {
GL_EXTCALL(glDeleteObjectARB(priv->depth_blt_glsl_program_id));
}
hash_table_destroy(priv->glsl_program_lookup);
HeapFree(GetProcessHeap(), 0, This->shader_priv);
This->shader_priv = NULL;
}
@ -3697,7 +3695,6 @@ static void shader_glsl_fragment_enable(IWineD3DDevice *iface, BOOL enable) {
const shader_backend_t glsl_shader_backend = {
shader_glsl_select,
shader_glsl_select_depth_blt,
shader_glsl_destroy_depth_blt,
shader_glsl_load_constants,
shader_glsl_cleanup,
shader_glsl_color_correction,

View File

@ -289,7 +289,6 @@ struct shader_caps {
typedef struct {
void (*shader_select)(IWineD3DDevice *iface, BOOL usePS, BOOL useVS);
void (*shader_select_depth_blt)(IWineD3DDevice *iface);
void (*shader_destroy_depth_blt)(IWineD3DDevice *iface);
void (*shader_load_constants)(IWineD3DDevice *iface, char usePS, char useVS);
void (*shader_cleanup)(IWineD3DDevice *iface);
void (*shader_color_correction)(struct SHADER_OPCODE_ARG *arg);