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
44521200
Commit
44521200
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_sincos() to properly take the write mask into account.
The write mask can only be one of .x, .y, .xy
parent
dc0d2a27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
11 deletions
+24
-11
glsl_shader.c
dlls/wined3d/glsl_shader.c
+24
-11
No files found.
dlls/wined3d/glsl_shader.c
View file @
44521200
...
...
@@ -821,7 +821,6 @@ static DWORD shader_glsl_add_dst_param(SHADER_OPCODE_ARG* arg, const DWORD param
return
mask
;
}
#if 0
/* Append the destination part of the instruction to the buffer, return the effective write mask */
static
DWORD
shader_glsl_append_dst
(
SHADER_BUFFER
*
buffer
,
SHADER_OPCODE_ARG
*
arg
)
{
char
reg_name
[
50
],
write_mask
[
6
],
reg_str
[
100
];
...
...
@@ -834,7 +833,6 @@ static DWORD shader_glsl_append_dst(SHADER_BUFFER *buffer, SHADER_OPCODE_ARG *ar
return
mask
;
}
#endif
/** Process GLSL instruction modifiers */
void
shader_glsl_add_instruction_modifiers
(
SHADER_OPCODE_ARG
*
arg
)
{
...
...
@@ -1306,16 +1304,31 @@ void shader_glsl_dst(SHADER_OPCODE_ARG* arg) {
* dst.w = dst.w
*/
void
shader_glsl_sincos
(
SHADER_OPCODE_ARG
*
arg
)
{
char
dst_str
[
100
],
src0_str
[
100
];
char
dst_reg
[
50
],
src0_reg
[
50
];
char
dst_mask
[
6
],
src0_mask
[
6
];
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
],
src0_reg
,
src0_mask
,
src0_str
);
char
src0_str
[
100
];
char
src0_reg
[
50
];
char
src0_mask
[
6
];
DWORD
write_mask
;
shader_addline
(
arg
->
buffer
,
"%s = vec4(cos(%s), sin(%s), %s.z, %s.w)%s;
\n
"
,
dst_str
,
src0_str
,
src0_str
,
dst_reg
,
dst_reg
,
dst_mask
);
write_mask
=
shader_glsl_append_dst
(
arg
->
buffer
,
arg
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
0
],
arg
->
src_addr
[
0
],
WINED3DSP_WRITEMASK_0
,
src0_reg
,
src0_mask
,
src0_str
);
switch
(
write_mask
)
{
case
WINED3DSP_WRITEMASK_0
:
shader_addline
(
arg
->
buffer
,
"cos(%s));
\n
"
,
src0_str
);
break
;
case
WINED3DSP_WRITEMASK_1
:
shader_addline
(
arg
->
buffer
,
"sin(%s));
\n
"
,
src0_str
);
break
;
case
(
WINED3DSP_WRITEMASK_0
|
WINED3DSP_WRITEMASK_1
):
shader_addline
(
arg
->
buffer
,
"vec2(cos(%s), sin(%s)));
\n
"
,
src0_str
,
src0_str
);
break
;
default:
ERR
(
"Write mask should be .x, .y or .xy
\n
"
);
break
;
}
}
/** Process the WINED3DSIO_LOOP instruction in GLSL:
...
...
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