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
a7956c4c
Commit
a7956c4c
authored
Nov 09, 2012
by
Matteo Bruni
Committed by
Alexandre Julliard
Nov 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pop control frames in disabled if branches (ARB shader backend).
parent
b532284a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
18 deletions
+34
-18
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+34
-18
No files found.
dlls/wined3d/arb_program_shader.c
View file @
a7956c4c
...
...
@@ -5395,6 +5395,29 @@ static void free_recorded_instruction(struct list *list)
}
}
static
void
pop_control_frame
(
const
struct
wined3d_shader_instruction
*
ins
)
{
struct
shader_arb_ctx_priv
*
priv
=
ins
->
ctx
->
backend_data
;
struct
control_frame
*
control_frame
;
if
(
ins
->
handler_idx
==
WINED3DSIH_ENDLOOP
||
ins
->
handler_idx
==
WINED3DSIH_ENDREP
)
{
struct
list
*
e
=
list_head
(
&
priv
->
control_frames
);
control_frame
=
LIST_ENTRY
(
e
,
struct
control_frame
,
entry
);
list_remove
(
&
control_frame
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
control_frame
);
priv
->
loop_depth
--
;
}
else
if
(
ins
->
handler_idx
==
WINED3DSIH_ENDIF
)
{
/* Non-ifc ENDIFs were already handled previously. */
struct
list
*
e
=
list_head
(
&
priv
->
control_frames
);
control_frame
=
LIST_ENTRY
(
e
,
struct
control_frame
,
entry
);
list_remove
(
&
control_frame
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
control_frame
);
}
}
static
void
shader_arb_handle_instruction
(
const
struct
wined3d_shader_instruction
*
ins
)
{
SHADER_HANDLER
hw_fct
;
struct
shader_arb_ctx_priv
*
priv
=
ins
->
ctx
->
backend_data
;
...
...
@@ -5564,6 +5587,8 @@ static void shader_arb_handle_instruction(const struct wined3d_shader_instructio
return
;
/* Instruction is handled. */
}
/* In case of an ifc, generate a HW shader instruction */
if
(
control_frame
->
type
!=
IFC
)
ERR
(
"Control frame does not match.
\n
"
);
}
else
if
(
ins
->
handler_idx
==
WINED3DSIH_ENDIF
)
{
...
...
@@ -5578,9 +5603,16 @@ static void shader_arb_handle_instruction(const struct wined3d_shader_instructio
HeapFree
(
GetProcessHeap
(),
0
,
control_frame
);
return
;
/* Instruction is handled */
}
/* In case of an ifc, generate a HW shader instruction */
if
(
control_frame
->
type
!=
IFC
)
ERR
(
"Control frame does not match.
\n
"
);
}
if
(
priv
->
muted
)
return
;
if
(
priv
->
muted
)
{
pop_control_frame
(
ins
);
return
;
}
/* Select handler */
hw_fct
=
shader_arb_instruction_handler_table
[
ins
->
handler_idx
];
...
...
@@ -5593,23 +5625,7 @@ static void shader_arb_handle_instruction(const struct wined3d_shader_instructio
}
hw_fct
(
ins
);
if
(
ins
->
handler_idx
==
WINED3DSIH_ENDLOOP
||
ins
->
handler_idx
==
WINED3DSIH_ENDREP
)
{
struct
list
*
e
=
list_head
(
&
priv
->
control_frames
);
control_frame
=
LIST_ENTRY
(
e
,
struct
control_frame
,
entry
);
list_remove
(
&
control_frame
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
control_frame
);
priv
->
loop_depth
--
;
}
else
if
(
ins
->
handler_idx
==
WINED3DSIH_ENDIF
)
{
/* Non-ifc ENDIFs don't reach that place because of the return in the if block above */
struct
list
*
e
=
list_head
(
&
priv
->
control_frames
);
control_frame
=
LIST_ENTRY
(
e
,
struct
control_frame
,
entry
);
list_remove
(
&
control_frame
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
control_frame
);
}
pop_control_frame
(
ins
);
shader_arb_add_instruction_modifiers
(
ins
);
}
...
...
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