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
9857158a
Commit
9857158a
authored
Jan 15, 2007
by
H. Verbeet
Committed by
Alexandre Julliard
Jan 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Rewrite shader_glsl_expp() to properly take the write mask into account.
parent
2c60906e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
16 deletions
+26
-16
glsl_shader.c
dlls/wined3d/glsl_shader.c
+26
-16
No files found.
dlls/wined3d/glsl_shader.c
View file @
9857158a
...
...
@@ -1093,26 +1093,36 @@ void shader_glsl_map2gl(SHADER_OPCODE_ARG* arg) {
* dst = 2^src; (partial precision is allowed, but optional)
*/
void
shader_glsl_expp
(
SHADER_OPCODE_ARG
*
arg
)
{
IWineD3DBaseShaderImpl
*
shader
=
(
IWineD3DBaseShaderImpl
*
)
arg
->
shader
;
char
src_str
[
100
];
char
src_reg
[
50
];
char
src_mask
[
6
];
char
tmpLine
[
256
];
char
dst_str
[
100
],
src_str
[
100
];
char
dst_reg
[
50
],
src_reg
[
50
];
char
dst_mask
[
6
],
src_mask
[
6
];
IWineD3DPixelShaderImpl
*
This
=
(
IWineD3DPixelShaderImpl
*
)
arg
->
shader
;
DWORD
hex_version
=
This
->
baseShader
.
hex_version
;
shader_glsl_add_dst_param
(
arg
,
arg
->
dst
,
0
,
dst_reg
,
dst_mask
,
dst_str
);
shader_glsl_add_src_param_old
(
arg
,
arg
->
src
[
0
],
arg
->
src_addr
[
0
],
src_reg
,
src_mask
,
src_str
);
shader_glsl_add_dst_old
(
arg
->
dst
,
dst_reg
,
dst_mask
,
tmpLine
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
0
],
arg
->
src_addr
[
0
],
WINED3DSP_WRITEMASK_0
,
src_reg
,
src_mask
,
src_str
);
if
(
hex_version
<
WINED3DPS_VERSION
(
2
,
0
))
{
shader_addline
(
arg
->
buffer
,
"tmp0.x = vec4(exp2(floor(%s))).x;
\n
"
,
src_str
);
shader_addline
(
arg
->
buffer
,
"tmp0.y = vec4(%s - floor(%s)).y;
\n
"
,
src_str
,
src_str
);
shader_addline
(
arg
->
buffer
,
"tmp0.z = vec4(exp2(%s)).x;
\n
"
,
src_str
);
if
(
shader
->
baseShader
.
hex_version
<
WINED3DPS_VERSION
(
2
,
0
))
{
char
dst_mask
[
6
];
shader_addline
(
arg
->
buffer
,
"tmp0.x = exp2(floor(%s));
\n
"
,
src_str
);
shader_addline
(
arg
->
buffer
,
"tmp0.y = %s - floor(%s);
\n
"
,
src_str
,
src_str
);
shader_addline
(
arg
->
buffer
,
"tmp0.z = exp2(%s);
\n
"
,
src_str
);
shader_addline
(
arg
->
buffer
,
"tmp0.w = 1.0;
\n
"
);
shader_addline
(
arg
->
buffer
,
"%svec4(tmp0))%s;
\n
"
,
tmpLine
,
dst_mask
);
shader_glsl_append_dst
(
arg
->
buffer
,
arg
);
shader_glsl_get_write_mask
(
arg
->
dst
,
dst_mask
);
shader_addline
(
arg
->
buffer
,
"tmp0%s);
\n
"
,
dst_mask
);
}
else
{
shader_addline
(
arg
->
buffer
,
"%svec4(exp2(%s)))%s;
\n
"
,
tmpLine
,
src_str
,
dst_mask
);
DWORD
write_mask
;
size_t
mask_size
;
write_mask
=
shader_glsl_append_dst
(
arg
->
buffer
,
arg
);
mask_size
=
shader_glsl_get_write_mask_size
(
write_mask
);
if
(
mask_size
>
1
)
{
shader_addline
(
arg
->
buffer
,
"vec%d(exp2(%s)));
\n
"
,
mask_size
,
src_str
);
}
else
{
shader_addline
(
arg
->
buffer
,
"exp2(%s));
\n
"
,
src_str
);
}
}
}
...
...
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