Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f298b969
Commit
f298b969
authored
Sep 20, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Simplify shader_glsl_destroy() control flow a bit.
parent
2f03ad1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
40 deletions
+49
-40
glsl_shader.c
dlls/wined3d/glsl_shader.c
+49
-40
No files found.
dlls/wined3d/glsl_shader.c
View file @
f298b969
...
...
@@ -4735,8 +4735,6 @@ static void shader_glsl_destroy(struct wined3d_shader *shader)
const
struct
list
*
linked_programs
;
struct
wined3d_context
*
context
;
char
pshader
=
shader_is_pshader_version
(
shader
->
reg_maps
.
shader_version
.
type
);
if
(
!
shader_data
||
!
shader_data
->
num_gl_shaders
)
{
HeapFree
(
GetProcessHeap
(),
0
,
shader_data
);
...
...
@@ -4755,54 +4753,65 @@ static void shader_glsl_destroy(struct wined3d_shader *shader)
LEAVE_GL
();
}
TRACE
(
"Deleting linked programs.
\n
"
);
linked_programs
=
&
shader
->
linked_programs
;
TRACE
(
"Deleting linked programs
\n
"
);
if
(
linked_programs
->
next
)
{
if
(
linked_programs
->
next
)
{
struct
glsl_shader_prog_link
*
entry
,
*
entry2
;
UINT
i
;
ENTER_GL
();
if
(
pshader
)
{
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
linked_programs
,
struct
glsl_shader_prog_link
,
pshader_entry
)
{
delete_glsl_program_entry
(
priv
,
gl_info
,
entry
);
}
}
else
{
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
linked_programs
,
struct
glsl_shader_prog_link
,
vshader_entry
)
{
delete_glsl_program_entry
(
priv
,
gl_info
,
entry
);
switch
(
shader
->
reg_maps
.
shader_version
.
type
)
{
case
WINED3D_SHADER_TYPE_PIXEL
:
{
struct
glsl_ps_compiled_shader
*
gl_shaders
=
shader_data
->
gl_shaders
.
ps
;
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
linked_programs
,
struct
glsl_shader_prog_link
,
pshader_entry
)
{
delete_glsl_program_entry
(
priv
,
gl_info
,
entry
);
}
for
(
i
=
0
;
i
<
shader_data
->
num_gl_shaders
;
++
i
)
{
TRACE
(
"Deleting pixel shader %u.
\n
"
,
gl_shaders
[
i
].
prgId
);
GL_EXTCALL
(
glDeleteObjectARB
(
gl_shaders
[
i
].
prgId
));
checkGLcall
(
"glDeleteObjectARB"
);
}
HeapFree
(
GetProcessHeap
(),
0
,
shader_data
->
gl_shaders
.
ps
);
break
;
}
}
LEAVE_GL
();
}
if
(
pshader
)
{
struct
glsl_ps_compiled_shader
*
gl_shaders
=
shader_data
->
gl_shaders
.
ps
;
UINT
i
;
case
WINED3D_SHADER_TYPE_VERTEX
:
{
struct
glsl_vs_compiled_shader
*
gl_shaders
=
shader_data
->
gl_shaders
.
vs
;
ENTER_GL
();
for
(
i
=
0
;
i
<
shader_data
->
num_gl_shaders
;
++
i
)
{
TRACE
(
"Deleting pixel shader %u.
\n
"
,
gl_shaders
[
i
].
prgId
);
GL_EXTCALL
(
glDeleteObjectARB
(
gl_shaders
[
i
].
prgId
));
checkGLcall
(
"glDeleteObjectARB"
);
}
LEAVE_GL
();
HeapFree
(
GetProcessHeap
(),
0
,
shader_data
->
gl_shaders
.
ps
);
}
else
{
struct
glsl_vs_compiled_shader
*
gl_shaders
=
shader_data
->
gl_shaders
.
vs
;
UINT
i
;
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
linked_programs
,
struct
glsl_shader_prog_link
,
vshader_entry
)
{
delete_glsl_program_entry
(
priv
,
gl_info
,
entry
);
}
ENTER_GL
();
for
(
i
=
0
;
i
<
shader_data
->
num_gl_shaders
;
++
i
)
{
TRACE
(
"Deleting vertex shader %u.
\n
"
,
gl_shaders
[
i
].
prgId
);
GL_EXTCALL
(
glDeleteObjectARB
(
gl_shaders
[
i
].
prgId
));
checkGLcall
(
"glDeleteObjectARB"
);
for
(
i
=
0
;
i
<
shader_data
->
num_gl_shaders
;
++
i
)
{
TRACE
(
"Deleting vertex shader %u.
\n
"
,
gl_shaders
[
i
].
prgId
);
GL_EXTCALL
(
glDeleteObjectARB
(
gl_shaders
[
i
].
prgId
));
checkGLcall
(
"glDeleteObjectARB"
);
}
HeapFree
(
GetProcessHeap
(),
0
,
shader_data
->
gl_shaders
.
vs
);
break
;
}
default:
ERR
(
"Unhandled shader type %#x.
\n
"
,
shader
->
reg_maps
.
shader_version
.
type
);
break
;
}
LEAVE_GL
();
HeapFree
(
GetProcessHeap
(),
0
,
shader_data
->
gl_shaders
.
vs
);
}
HeapFree
(
GetProcessHeap
(),
0
,
shader
->
backend_data
);
...
...
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