Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
fec1fa93
Commit
fec1fa93
authored
Apr 22, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Handle the swizzle shift in the frontend rather than the backend.
parent
baf2f94b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
17 deletions
+14
-17
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+4
-4
baseshader.c
dlls/wined3d/baseshader.c
+3
-3
glsl_shader.c
dlls/wined3d/glsl_shader.c
+6
-7
wined3d_private_types.h
dlls/wined3d/wined3d_private_types.h
+1
-3
No files found.
dlls/wined3d/arb_program_shader.c
View file @
fec1fa93
...
...
@@ -436,7 +436,7 @@ static void shader_arb_get_swizzle(const struct wined3d_shader_src_param *param,
char
*
ptr
=
swizzle_str
;
/* swizzle bits fields: wwzzyyxx */
DWORD
swizzle
=
param
->
swizzle
>>
WINED3DSP_SWIZZLE_SHIFT
;
DWORD
swizzle
=
param
->
swizzle
;
DWORD
swizzle_x
=
swizzle
&
0x03
;
DWORD
swizzle_y
=
(
swizzle
>>
2
)
&
0x03
;
DWORD
swizzle_z
=
(
swizzle
>>
4
)
&
0x03
;
...
...
@@ -444,7 +444,8 @@ static void shader_arb_get_swizzle(const struct wined3d_shader_src_param *param,
/* If the swizzle is the default swizzle (ie, "xyzw"), we don't need to
* generate a swizzle string. Unless we need to our own swizzling. */
if
((
WINED3DSP_NOSWIZZLE
>>
WINED3DSP_SWIZZLE_SHIFT
)
!=
swizzle
||
fixup
)
{
if
(
swizzle
!=
WINED3DSP_NOSWIZZLE
||
fixup
)
{
*
ptr
++
=
'.'
;
if
(
swizzle_x
==
swizzle_y
&&
swizzle_x
==
swizzle_z
&&
swizzle_x
==
swizzle_w
)
{
*
ptr
++
=
swizzle_chars
[
swizzle_x
];
...
...
@@ -1076,8 +1077,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
=
((
ins
->
src
[
0
].
swizzle
>>
WINED3DSP_SWIZZLE_SHIFT
)
&
0x3
)
*
(
0x55
<<
WINED3DSP_SWIZZLE_SHIFT
);
tmp_src
.
swizzle
=
(
tmp_src
.
swizzle
&
0x3
)
*
0x55
;
shader_arb_add_src_param
(
ins
,
&
tmp_src
,
src0_param
);
shader_addline
(
buffer
,
"ARL A0.x, %s;
\n
"
,
src0_param
);
}
...
...
dlls/wined3d/baseshader.c
View file @
fec1fa93
...
...
@@ -147,7 +147,7 @@ static int shader_get_param(const DWORD *pToken, DWORD shader_version, DWORD *pa
*
addr_token
=
(
1
<<
31
)
|
((
WINED3DSPR_ADDR
<<
WINED3DSP_REGTYPE_SHIFT2
)
&
WINED3DSP_REGTYPE_MASK2
)
|
((
WINED3DSPR_ADDR
<<
WINED3DSP_REGTYPE_SHIFT
)
&
WINED3DSP_REGTYPE_MASK
)
|
WINED3DSP_NOSWIZZLE
;
|
(
WINED3DSP_NOSWIZZLE
<<
WINED3DSP_SWIZZLE_SHIFT
)
;
}
else
{
...
...
@@ -245,7 +245,7 @@ static void shader_parse_src_param(DWORD param, const struct wined3d_shader_src_
src
->
register_type
=
((
param
&
WINED3DSP_REGTYPE_MASK
)
>>
WINED3DSP_REGTYPE_SHIFT
)
|
((
param
&
WINED3DSP_REGTYPE_MASK2
)
>>
WINED3DSP_REGTYPE_SHIFT2
);
src
->
register_idx
=
param
&
WINED3DSP_REGNUM_MASK
;
src
->
swizzle
=
param
&
WINED3DSP_SWIZZLE_MASK
;
src
->
swizzle
=
(
param
&
WINED3DSP_SWIZZLE_MASK
)
>>
WINED3DSP_SWIZZLE_SHIFT
;
src
->
modifiers
=
param
&
WINED3DSP_SRCMOD_MASK
;
src
->
rel_addr
=
rel_addr
;
}
...
...
@@ -789,7 +789,7 @@ static void shader_dump_param(const DWORD param, const DWORD addr_token, int inp
* swizzle bits fields:
* RRGGBBAA
*/
if
(
(
WINED3DSP_NOSWIZZLE
>>
WINED3DSP_SWIZZLE_SHIFT
)
!=
swizzle
)
if
(
swizzle
!=
WINED3DSP_NOSWIZZLE
)
{
if
(
swizzle_x
==
swizzle_y
&&
swizzle_x
==
swizzle_z
&&
...
...
dlls/wined3d/glsl_shader.c
View file @
fec1fa93
...
...
@@ -1246,14 +1246,13 @@ static void shader_glsl_swizzle_to_str(const DWORD swizzle, BOOL fixup, DWORD ma
* but addressed as "rgba". To fix this we need to swap the register's x
* and z components. */
const
char
*
swizzle_chars
=
fixup
?
"zyxw"
:
"xyzw"
;
DWORD
s
=
swizzle
>>
WINED3DSP_SWIZZLE_SHIFT
;
*
str
++
=
'.'
;
/* swizzle bits fields: wwzzyyxx */
if
(
mask
&
WINED3DSP_WRITEMASK_0
)
*
str
++
=
swizzle_chars
[
s
&
0x03
];
if
(
mask
&
WINED3DSP_WRITEMASK_1
)
*
str
++
=
swizzle_chars
[(
s
>>
2
)
&
0x03
];
if
(
mask
&
WINED3DSP_WRITEMASK_2
)
*
str
++
=
swizzle_chars
[(
s
>>
4
)
&
0x03
];
if
(
mask
&
WINED3DSP_WRITEMASK_3
)
*
str
++
=
swizzle_chars
[(
s
>>
6
)
&
0x03
];
if
(
mask
&
WINED3DSP_WRITEMASK_0
)
*
str
++
=
swizzle_chars
[
s
wizzle
&
0x03
];
if
(
mask
&
WINED3DSP_WRITEMASK_1
)
*
str
++
=
swizzle_chars
[(
s
wizzle
>>
2
)
&
0x03
];
if
(
mask
&
WINED3DSP_WRITEMASK_2
)
*
str
++
=
swizzle_chars
[(
s
wizzle
>>
4
)
&
0x03
];
if
(
mask
&
WINED3DSP_WRITEMASK_3
)
*
str
++
=
swizzle_chars
[(
s
wizzle
>>
6
)
&
0x03
];
*
str
=
'\0'
;
}
...
...
@@ -1951,7 +1950,7 @@ static void shader_glsl_cmp(const struct wined3d_shader_instruction *ins)
write_mask
=
0
;
/* Find the destination channels which use the current source0 channel */
for
(
j
=
0
;
j
<
4
;
j
++
)
{
if
(((
ins
->
src
[
0
].
swizzle
>>
(
WINED3DSP_SWIZZLE_SHIFT
+
2
*
j
))
&
0x3
)
==
i
)
if
(((
ins
->
src
[
0
].
swizzle
>>
(
2
*
j
))
&
0x3
)
==
i
)
{
write_mask
|=
WINED3DSP_WRITEMASK_0
<<
j
;
cmp_channel
=
WINED3DSP_WRITEMASK_0
<<
j
;
...
...
@@ -2033,7 +2032,7 @@ static void shader_glsl_cnd(const struct wined3d_shader_instruction *ins)
write_mask
=
0
;
/* Find the destination channels which use the current source0 channel */
for
(
j
=
0
;
j
<
4
;
j
++
)
{
if
(((
ins
->
src
[
0
].
swizzle
>>
(
WINED3DSP_SWIZZLE_SHIFT
+
2
*
j
))
&
0x3
)
==
i
)
if
(((
ins
->
src
[
0
].
swizzle
>>
(
2
*
j
))
&
0x3
)
==
i
)
{
write_mask
|=
WINED3DSP_WRITEMASK_0
<<
j
;
cmp_channel
=
WINED3DSP_WRITEMASK_0
<<
j
;
...
...
dlls/wined3d/wined3d_private_types.h
View file @
fec1fa93
...
...
@@ -101,9 +101,7 @@ typedef enum _WINED3DVS_RASTOUT_OFFSETS {
#define WINED3DSP_SWIZZLE_SHIFT 16
#define WINED3DSP_SWIZZLE_MASK (0xFF << WINED3DSP_SWIZZLE_SHIFT)
#define WINED3DSP_NOSWIZZLE \
((0 << (WINED3DSP_SWIZZLE_SHIFT + 0)) | (1 << (WINED3DSP_SWIZZLE_SHIFT + 2)) | \
(2 << (WINED3DSP_SWIZZLE_SHIFT + 4)) | (3 << (WINED3DSP_SWIZZLE_SHIFT + 6)))
#define WINED3DSP_NOSWIZZLE (0 | (1 << 2) | (2 << 4) | (3 << 6))
#define WINED3DSP_SRCMOD_SHIFT 24
#define WINED3DSP_SRCMOD_MASK (0xF << WINED3DSP_SRCMOD_SHIFT)
...
...
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