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
f20173e5
Commit
f20173e5
authored
Mar 27, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Select the component by editing the swizzle.
parent
2a55f8d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+12
-9
No files found.
dlls/wined3d/arb_program_shader.c
View file @
f20173e5
...
...
@@ -1792,6 +1792,11 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins)
static
void
shader_hw_nop
(
const
struct
wined3d_shader_instruction
*
ins
)
{}
static
DWORD
shader_arb_select_component
(
DWORD
swizzle
,
DWORD
component
)
{
return
((
swizzle
>>
2
*
component
)
&
0x3
)
*
0x55
;
}
static
void
shader_hw_mov
(
const
struct
wined3d_shader_instruction
*
ins
)
{
const
struct
wined3d_shader
*
shader
=
ins
->
ctx
->
shader
;
...
...
@@ -1862,7 +1867,7 @@ static void shader_hw_mov(const struct wined3d_shader_instruction *ins)
* with more than one component. Thus replicate the first source argument over all
* 4 components. For example, .xyzw -> .x (or better: .xxxx), .zwxy -> .z, etc) */
struct
wined3d_shader_src_param
tmp_src
=
ins
->
src
[
0
];
tmp_src
.
swizzle
=
(
tmp_src
.
swizzle
&
0x3
)
*
0x55
;
tmp_src
.
swizzle
=
shader_arb_select_component
(
tmp_src
.
swizzle
,
0
)
;
shader_arb_get_src_param
(
ins
,
&
tmp_src
,
0
,
src0_param
);
shader_addline
(
buffer
,
"ARL A0.x, %s;
\n
"
,
src0_param
);
}
...
...
@@ -2496,6 +2501,7 @@ static void shader_hw_scalar_op(const struct wined3d_shader_instruction *ins)
{
struct
wined3d_shader_buffer
*
buffer
=
ins
->
ctx
->
buffer
;
const
char
*
instruction
;
struct
wined3d_shader_src_param
src0_copy
=
ins
->
src
[
0
];
char
dst
[
50
];
char
src
[
50
];
...
...
@@ -2511,15 +2517,12 @@ static void shader_hw_scalar_op(const struct wined3d_shader_instruction *ins)
break
;
}
/* Dx sdk says .x is used if no swizzle is given, but our test shows that
* .w is used. */
src0_copy
.
swizzle
=
shader_arb_select_component
(
src0_copy
.
swizzle
,
3
);
shader_arb_get_dst_param
(
ins
,
&
ins
->
dst
[
0
],
dst
);
/* Destination */
shader_arb_get_src_param
(
ins
,
&
ins
->
src
[
0
],
0
,
src
);
if
(
ins
->
src
[
0
].
swizzle
==
WINED3DSP_NOSWIZZLE
)
{
/* Dx sdk says .x is used if no swizzle is given, but our test shows that
* .w is used
*/
strcat
(
src
,
".w"
);
}
shader_arb_get_src_param
(
ins
,
&
src0_copy
,
0
,
src
);
shader_addline
(
buffer
,
"%s%s %s, %s;
\n
"
,
instruction
,
shader_arb_get_modifier
(
ins
),
dst
,
src
);
}
...
...
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