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
495fcc72
Commit
495fcc72
authored
Nov 19, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 19, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Avoid using a stack buffer in a few places in shader_hw_map2gl().
parent
9b118cc3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
17 deletions
+14
-17
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+14
-17
No files found.
dlls/wined3d/arb_program_shader.c
View file @
495fcc72
...
@@ -1089,8 +1089,7 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg)
...
@@ -1089,8 +1089,7 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg)
SHADER_BUFFER
*
buffer
=
arg
->
buffer
;
SHADER_BUFFER
*
buffer
=
arg
->
buffer
;
DWORD
dst
=
arg
->
dst
;
DWORD
dst
=
arg
->
dst
;
DWORD
*
src
=
arg
->
src
;
DWORD
*
src
=
arg
->
src
;
char
arguments
[
256
];
char
tmpLine
[
256
];
unsigned
int
i
;
unsigned
int
i
;
if
(
shader_is_pshader_version
(
shader
->
baseShader
.
hex_version
))
if
(
shader_is_pshader_version
(
shader
->
baseShader
.
hex_version
))
...
@@ -1102,6 +1101,7 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg)
...
@@ -1102,6 +1101,7 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg)
BOOL
saturate
=
FALSE
;
BOOL
saturate
=
FALSE
;
BOOL
centroid
=
FALSE
;
BOOL
centroid
=
FALSE
;
BOOL
partialprecision
=
FALSE
;
BOOL
partialprecision
=
FALSE
;
const
char
*
modifier
;
DWORD
shift
;
DWORD
shift
;
if
(
!
curOpcode
->
num_params
)
if
(
!
curOpcode
->
num_params
)
...
@@ -1110,8 +1110,6 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg)
...
@@ -1110,8 +1110,6 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg)
return
;
return
;
}
}
strcpy
(
tmpLine
,
curOpcode
->
glname
);
/* Process modifiers */
/* Process modifiers */
if
(
dst
&
WINED3DSP_DSTMOD_MASK
)
if
(
dst
&
WINED3DSP_DSTMOD_MASK
)
{
{
...
@@ -1128,6 +1126,7 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg)
...
@@ -1128,6 +1126,7 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg)
FIXME
(
"Unhandled modifier(%#x)
\n
"
,
mask
>>
WINED3DSP_DSTMOD_SHIFT
);
FIXME
(
"Unhandled modifier(%#x)
\n
"
,
mask
>>
WINED3DSP_DSTMOD_SHIFT
);
}
}
shift
=
(
dst
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
shift
=
(
dst
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
modifier
=
(
saturate
&&
!
shift
)
?
"_SAT"
:
""
;
/* Generate input register names (with modifiers) */
/* Generate input register names (with modifiers) */
for
(
i
=
1
;
i
<
curOpcode
->
num_params
;
++
i
)
for
(
i
=
1
;
i
<
curOpcode
->
num_params
;
++
i
)
...
@@ -1139,33 +1138,31 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg)
...
@@ -1139,33 +1138,31 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg)
shader_arb_get_write_mask
(
arg
,
dst
,
output_wmask
);
shader_arb_get_write_mask
(
arg
,
dst
,
output_wmask
);
strcat
(
operands
[
0
],
output_wmask
);
strcat
(
operands
[
0
],
output_wmask
);
if
(
saturate
&&
(
shift
==
0
))
arguments
[
0
]
=
'\0'
;
strcat
(
tmpLine
,
"_SAT"
);
strcat
(
arguments
,
operands
[
0
]);
strcat
(
tmpLine
,
" "
);
strcat
(
tmpLine
,
operands
[
0
]);
for
(
i
=
1
;
i
<
curOpcode
->
num_params
;
i
++
)
for
(
i
=
1
;
i
<
curOpcode
->
num_params
;
i
++
)
{
{
strcat
(
tmpLine
,
", "
);
strcat
(
arguments
,
", "
);
strcat
(
tmpLine
,
operands
[
i
]);
strcat
(
arguments
,
operands
[
i
]);
}
}
strcat
(
tmpLine
,
";
\n
"
);
shader_addline
(
buffer
,
"%s%s %s;
\n
"
,
curOpcode
->
glname
,
modifier
,
arguments
);
shader_addline
(
buffer
,
tmpLine
);
/* A shift requires another line. */
/* A shift requires another line. */
if
(
shift
)
pshader_gen_output_modifier_line
(
buffer
,
saturate
,
output_wmask
,
shift
,
output_rname
);
if
(
shift
)
pshader_gen_output_modifier_line
(
buffer
,
saturate
,
output_wmask
,
shift
,
output_rname
);
}
else
{
}
else
{
strcpy
(
tmpLine
,
curOpcode
->
glname
);
/* Note that vshader_program_add_param() adds spaces. */
arguments
[
0
]
=
'\0'
;
if
(
curOpcode
->
num_params
>
0
)
if
(
curOpcode
->
num_params
>
0
)
{
{
vshader_program_add_param
(
arg
,
dst
,
FALSE
,
tmpLine
);
vshader_program_add_param
(
arg
,
dst
,
FALSE
,
arguments
);
for
(
i
=
1
;
i
<
curOpcode
->
num_params
;
++
i
)
for
(
i
=
1
;
i
<
curOpcode
->
num_params
;
++
i
)
{
{
strcat
(
tmpLine
,
","
);
strcat
(
arguments
,
","
);
vshader_program_add_param
(
arg
,
src
[
i
-
1
],
TRUE
,
tmpLine
);
vshader_program_add_param
(
arg
,
src
[
i
-
1
],
TRUE
,
arguments
);
}
}
}
}
shader_addline
(
buffer
,
"%s
;
\n
"
,
tmpLine
);
shader_addline
(
buffer
,
"%s
%s;
\n
"
,
curOpcode
->
glname
,
arguments
);
}
}
}
}
...
...
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