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
8d746c31
Commit
8d746c31
authored
Aug 10, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Properly handle negative loop step in shader_glsl_loop().
parent
3bc4e67f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
24 deletions
+35
-24
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+2
-9
glsl_shader.c
dlls/wined3d/glsl_shader.c
+26
-15
wined3d_private.h
dlls/wined3d/wined3d_private.h
+7
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
8d746c31
...
...
@@ -91,13 +91,6 @@ static inline BOOL ffp_clip_emul(IWineD3DStateBlockImpl *stateblock)
/* ARB_program_shader private data */
struct
loop_control
{
unsigned
int
count
;
unsigned
int
start
;
int
step
;
};
struct
control_frame
{
struct
list
entry
;
...
...
@@ -115,7 +108,7 @@ struct control_frame
unsigned
int
loop_no
;
unsigned
int
ifc_no
;
};
struct
loop_control
loop_control
;
struct
wined3d_shader_loop_control
loop_control
;
BOOL
had_else
;
};
...
...
@@ -4686,7 +4679,7 @@ static inline BOOL get_bool_const(const struct wined3d_shader_instruction *ins,
}
static
void
get_loop_control_const
(
const
struct
wined3d_shader_instruction
*
ins
,
IWineD3DBaseShaderImpl
*
This
,
UINT
idx
,
struct
loop_control
*
loop_control
)
IWineD3DBaseShaderImpl
*
This
,
UINT
idx
,
struct
wined3d_shader_
loop_control
*
loop_control
)
{
struct
shader_arb_ctx_priv
*
priv
=
ins
->
ctx
->
backend_data
;
...
...
dlls/wined3d/glsl_shader.c
View file @
8d746c31
...
...
@@ -2485,22 +2485,33 @@ static void shader_glsl_loop(const struct wined3d_shader_instruction *ins)
}
}
if
(
control_values
)
{
if
(
control_values
[
2
]
>
0
)
{
shader_addline
(
ins
->
ctx
->
buffer
,
"for (aL%u = %d; aL%u < (%d * %d + %d); aL%u += %d) {
\n
"
,
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
1
],
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
0
],
control_values
[
2
],
control_values
[
1
],
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
2
]);
}
else
if
(
control_values
[
2
]
==
0
)
{
shader_addline
(
ins
->
ctx
->
buffer
,
"for (aL%u = %d, tmpInt%u = 0; tmpInt%u < %d; tmpInt%u++) {
\n
"
,
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
1
],
shader
->
baseShader
.
cur_loop_depth
,
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
0
],
if
(
control_values
)
{
struct
wined3d_shader_loop_control
loop_control
;
loop_control
.
count
=
control_values
[
0
];
loop_control
.
start
=
control_values
[
1
];
loop_control
.
step
=
(
int
)
control_values
[
2
];
if
(
loop_control
.
step
>
0
)
{
shader_addline
(
ins
->
ctx
->
buffer
,
"for (aL%u = %u; aL%u < (%u * %d + %u); aL%u += %d) {
\n
"
,
shader
->
baseShader
.
cur_loop_depth
,
loop_control
.
start
,
shader
->
baseShader
.
cur_loop_depth
,
loop_control
.
count
,
loop_control
.
step
,
loop_control
.
start
,
shader
->
baseShader
.
cur_loop_depth
,
loop_control
.
step
);
}
else
if
(
loop_control
.
step
<
0
)
{
shader_addline
(
ins
->
ctx
->
buffer
,
"for (aL%u = %u; aL%u > (%u * %d + %u); aL%u += %d) {
\n
"
,
shader
->
baseShader
.
cur_loop_depth
,
loop_control
.
start
,
shader
->
baseShader
.
cur_loop_depth
,
loop_control
.
count
,
loop_control
.
step
,
loop_control
.
start
,
shader
->
baseShader
.
cur_loop_depth
,
loop_control
.
step
);
}
else
{
shader_addline
(
ins
->
ctx
->
buffer
,
"for (aL%u = %u, tmpInt%u = 0; tmpInt%u < %u; tmpInt%u++) {
\n
"
,
shader
->
baseShader
.
cur_loop_depth
,
loop_control
.
start
,
shader
->
baseShader
.
cur_loop_depth
,
shader
->
baseShader
.
cur_loop_depth
,
loop_control
.
count
,
shader
->
baseShader
.
cur_loop_depth
);
}
else
{
shader_addline
(
ins
->
ctx
->
buffer
,
"for (aL%u = %d; aL%u > (%d * %d + %d); aL%u += %d) {
\n
"
,
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
1
],
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
0
],
control_values
[
2
],
control_values
[
1
],
shader
->
baseShader
.
cur_loop_depth
,
control_values
[
2
]);
}
}
else
{
shader_addline
(
ins
->
ctx
->
buffer
,
...
...
dlls/wined3d/wined3d_private.h
View file @
8d746c31
...
...
@@ -725,6 +725,13 @@ struct wined3d_shader_attribute
UINT
usage_idx
;
};
struct
wined3d_shader_loop_control
{
unsigned
int
count
;
unsigned
int
start
;
int
step
;
};
struct
wined3d_shader_frontend
{
void
*
(
*
shader_init
)(
const
DWORD
*
ptr
,
const
struct
wined3d_shader_signature
*
output_signature
);
...
...
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