Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fe2ffe1e
Commit
fe2ffe1e
authored
Dec 13, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 13, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass an IWineD3DBaseShaderImpl pointer to shader_destroy().
parent
97ca0e68
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
33 deletions
+39
-33
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+8
-8
device.c
dlls/wined3d/device.c
+3
-2
glsl_shader.c
dlls/wined3d/glsl_shader.c
+24
-20
shader.c
dlls/wined3d/shader.c
+2
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-1
No files found.
dlls/wined3d/arb_program_shader.c
View file @
fe2ffe1e
...
...
@@ -4702,14 +4702,14 @@ static void shader_arb_deselect_depth_blt(void *shader_priv, const struct wined3
}
}
static
void
shader_arb_destroy
(
IWineD3DBaseShader
*
iface
)
{
IWineD3DBaseShaderImpl
*
baseShader
=
(
IWineD3DBaseShaderImpl
*
)
iface
;
IWineD3DDeviceImpl
*
device
=
baseS
hader
->
baseShader
.
device
;
static
void
shader_arb_destroy
(
IWineD3DBaseShader
Impl
*
shader
)
{
IWineD3DDeviceImpl
*
device
=
s
hader
->
baseShader
.
device
;
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
if
(
shader_is_pshader_version
(
baseS
hader
->
baseShader
.
reg_maps
.
shader_version
.
type
))
if
(
shader_is_pshader_version
(
s
hader
->
baseShader
.
reg_maps
.
shader_version
.
type
))
{
struct
arb_pshader_private
*
shader_data
=
baseS
hader
->
baseShader
.
backend_data
;
struct
arb_pshader_private
*
shader_data
=
s
hader
->
baseShader
.
backend_data
;
UINT
i
;
if
(
!
shader_data
)
return
;
/* This can happen if a shader was never compiled */
...
...
@@ -4731,11 +4731,11 @@ static void shader_arb_destroy(IWineD3DBaseShader *iface) {
HeapFree
(
GetProcessHeap
(),
0
,
shader_data
->
gl_shaders
);
HeapFree
(
GetProcessHeap
(),
0
,
shader_data
);
baseS
hader
->
baseShader
.
backend_data
=
NULL
;
s
hader
->
baseShader
.
backend_data
=
NULL
;
}
else
{
struct
arb_vshader_private
*
shader_data
=
baseS
hader
->
baseShader
.
backend_data
;
struct
arb_vshader_private
*
shader_data
=
s
hader
->
baseShader
.
backend_data
;
UINT
i
;
if
(
!
shader_data
)
return
;
/* This can happen if a shader was never compiled */
...
...
@@ -4757,7 +4757,7 @@ static void shader_arb_destroy(IWineD3DBaseShader *iface) {
HeapFree
(
GetProcessHeap
(),
0
,
shader_data
->
gl_shaders
);
HeapFree
(
GetProcessHeap
(),
0
,
shader_data
);
baseS
hader
->
baseShader
.
backend_data
=
NULL
;
s
hader
->
baseShader
.
backend_data
=
NULL
;
}
}
...
...
dlls/wined3d/device.c
View file @
fe2ffe1e
...
...
@@ -6182,8 +6182,9 @@ static void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChainImpl
gl_info
=
context
->
gl_info
;
IWineD3DDevice_EnumResources
(
iface
,
reset_unload_resources
,
NULL
);
LIST_FOR_EACH_ENTRY
(
shader
,
&
This
->
shaders
,
IWineD3DBaseShaderImpl
,
baseShader
.
shader_list_entry
)
{
This
->
shader_backend
->
shader_destroy
((
IWineD3DBaseShader
*
)
shader
);
LIST_FOR_EACH_ENTRY
(
shader
,
&
This
->
shaders
,
IWineD3DBaseShaderImpl
,
baseShader
.
shader_list_entry
)
{
This
->
shader_backend
->
shader_destroy
(
shader
);
}
ENTER_GL
();
...
...
dlls/wined3d/glsl_shader.c
View file @
fe2ffe1e
...
...
@@ -4672,10 +4672,10 @@ static void shader_glsl_deselect_depth_blt(void *shader_priv, const struct wined
checkGLcall
(
"glUseProgramObjectARB"
);
}
static
void
shader_glsl_destroy
(
IWineD3DBaseShader
*
iface
)
{
static
void
shader_glsl_destroy
(
IWineD3DBaseShaderImpl
*
shader
)
{
const
struct
list
*
linked_programs
;
IWineD3DBaseShaderImpl
*
This
=
(
IWineD3DBaseShaderImpl
*
)
iface
;
IWineD3DDeviceImpl
*
device
=
This
->
baseShader
.
device
;
IWineD3DDeviceImpl
*
device
=
shader
->
baseShader
.
device
;
struct
shader_glsl_priv
*
priv
=
device
->
shader_priv
;
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_context
*
context
;
...
...
@@ -4683,41 +4683,44 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) {
/* Note: Do not use QueryInterface here to find out which shader type this is because this code
* can be called from IWineD3DBaseShader::Release
*/
char
pshader
=
shader_is_pshader_version
(
This
->
baseShader
.
reg_maps
.
shader_version
.
type
);
char
pshader
=
shader_is_pshader_version
(
shader
->
baseShader
.
reg_maps
.
shader_version
.
type
);
if
(
pshader
)
{
struct
glsl_pshader_private
*
shader_data
=
shader
->
baseShader
.
backend_data
;
if
(
pshader
)
{
struct
glsl_pshader_private
*
shader_data
;
shader_data
=
This
->
baseShader
.
backend_data
;
if
(
!
shader_data
||
!
shader_data
->
num_gl_shaders
)
{
HeapFree
(
GetProcessHeap
(),
0
,
shader_data
);
This
->
baseShader
.
backend_data
=
NULL
;
shader
->
baseShader
.
backend_data
=
NULL
;
return
;
}
context
=
context_acquire
(
device
,
NULL
);
gl_info
=
context
->
gl_info
;
if
(
priv
->
glsl_program
&&
(
IWineD3DBaseShader
*
)
priv
->
glsl_program
->
pshader
==
iface
)
if
(
priv
->
glsl_program
&&
(
IWineD3DBaseShader
Impl
*
)
priv
->
glsl_program
->
pshader
==
shader
)
{
ENTER_GL
();
shader_glsl_select
(
context
,
FALSE
,
FALSE
);
LEAVE_GL
();
}
}
else
{
struct
glsl_vshader_private
*
shader_data
;
shader_data
=
This
->
baseShader
.
backend_data
;
}
else
{
struct
glsl_vshader_private
*
shader_data
=
shader
->
baseShader
.
backend_data
;
if
(
!
shader_data
||
!
shader_data
->
num_gl_shaders
)
{
HeapFree
(
GetProcessHeap
(),
0
,
shader_data
);
This
->
baseShader
.
backend_data
=
NULL
;
shader
->
baseShader
.
backend_data
=
NULL
;
return
;
}
context
=
context_acquire
(
device
,
NULL
);
gl_info
=
context
->
gl_info
;
if
(
priv
->
glsl_program
&&
(
IWineD3DBaseShader
*
)
priv
->
glsl_program
->
vshader
==
iface
)
if
(
priv
->
glsl_program
&&
(
IWineD3DBaseShader
Impl
*
)
priv
->
glsl_program
->
vshader
==
shader
)
{
ENTER_GL
();
shader_glsl_select
(
context
,
FALSE
,
FALSE
);
...
...
@@ -4725,7 +4728,7 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) {
}
}
linked_programs
=
&
This
->
baseShader
.
linked_programs
;
linked_programs
=
&
shader
->
baseShader
.
linked_programs
;
TRACE
(
"Deleting linked programs
\n
"
);
if
(
linked_programs
->
next
)
{
...
...
@@ -4744,9 +4747,10 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) {
LEAVE_GL
();
}
if
(
pshader
)
{
if
(
pshader
)
{
struct
glsl_pshader_private
*
shader_data
=
shader
->
baseShader
.
backend_data
;
UINT
i
;
struct
glsl_pshader_private
*
shader_data
=
This
->
baseShader
.
backend_data
;
ENTER_GL
();
for
(
i
=
0
;
i
<
shader_data
->
num_gl_shaders
;
i
++
)
{
...
...
@@ -4759,8 +4763,8 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) {
}
else
{
struct
glsl_vshader_private
*
shader_data
=
shader
->
baseShader
.
backend_data
;
UINT
i
;
struct
glsl_vshader_private
*
shader_data
=
This
->
baseShader
.
backend_data
;
ENTER_GL
();
for
(
i
=
0
;
i
<
shader_data
->
num_gl_shaders
;
i
++
)
{
...
...
@@ -4772,8 +4776,8 @@ static void shader_glsl_destroy(IWineD3DBaseShader *iface) {
HeapFree
(
GetProcessHeap
(),
0
,
shader_data
->
gl_shaders
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
baseShader
.
backend_data
);
This
->
baseShader
.
backend_data
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
shader
->
baseShader
.
backend_data
);
shader
->
baseShader
.
backend_data
=
NULL
;
context_release
(
context
);
}
...
...
dlls/wined3d/shader.c
View file @
fe2ffe1e
...
...
@@ -1479,7 +1479,7 @@ static void shader_cleanup(IWineD3DBaseShader *iface)
{
IWineD3DBaseShaderImpl
*
shader
=
(
IWineD3DBaseShaderImpl
*
)
iface
;
shader
->
baseShader
.
device
->
shader_backend
->
shader_destroy
(
iface
);
shader
->
baseShader
.
device
->
shader_backend
->
shader_destroy
(
shader
);
HeapFree
(
GetProcessHeap
(),
0
,
shader
->
baseShader
.
reg_maps
.
constf
);
HeapFree
(
GetProcessHeap
(),
0
,
shader
->
baseShader
.
function
);
shader_delete_constant_list
(
&
shader
->
baseShader
.
constantsF
);
...
...
@@ -1503,7 +1503,7 @@ static void shader_none_update_float_pixel_constants(IWineD3DDeviceImpl *device,
static
void
shader_none_load_constants
(
const
struct
wined3d_context
*
context
,
char
usePS
,
char
useVS
)
{}
static
void
shader_none_load_np2fixup_constants
(
void
*
shader_priv
,
const
struct
wined3d_gl_info
*
gl_info
,
const
struct
wined3d_state
*
state
)
{}
static
void
shader_none_destroy
(
IWineD3DBaseShader
*
iface
)
{}
static
void
shader_none_destroy
(
IWineD3DBaseShader
Impl
*
shader
)
{}
static
HRESULT
shader_none_alloc
(
IWineD3DDeviceImpl
*
device
)
{
return
WINED3D_OK
;}
static
void
shader_none_free
(
IWineD3DDeviceImpl
*
device
)
{}
static
BOOL
shader_none_dirty_const
(
void
)
{
return
FALSE
;}
...
...
dlls/wined3d/wined3d_private.h
View file @
fe2ffe1e
...
...
@@ -57,6 +57,7 @@ typedef struct IWineD3DSurfaceImpl IWineD3DSurfaceImpl;
typedef
struct
IWineD3DPaletteImpl
IWineD3DPaletteImpl
;
typedef
struct
IWineD3DDeviceImpl
IWineD3DDeviceImpl
;
typedef
struct
IWineD3DSwapChainImpl
IWineD3DSwapChainImpl
;
struct
IWineD3DBaseShaderImpl
;
/* Texture format fixups */
...
...
@@ -758,7 +759,7 @@ typedef struct {
void
(
*
shader_load_constants
)(
const
struct
wined3d_context
*
context
,
char
usePS
,
char
useVS
);
void
(
*
shader_load_np2fixup_constants
)(
void
*
shader_priv
,
const
struct
wined3d_gl_info
*
gl_info
,
const
struct
wined3d_state
*
state
);
void
(
*
shader_destroy
)(
IWineD3DBaseShader
*
iface
);
void
(
*
shader_destroy
)(
struct
IWineD3DBaseShaderImpl
*
shader
);
HRESULT
(
*
shader_alloc_private
)(
IWineD3DDeviceImpl
*
device
);
void
(
*
shader_free_private
)(
IWineD3DDeviceImpl
*
device
);
BOOL
(
*
shader_dirtifyable_constants
)(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment