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
a79654d3
Commit
a79654d3
authored
Apr 12, 2007
by
H. Verbeet
Committed by
Alexandre Julliard
Apr 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix some swizzles on scalars.
parent
5c19285d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
10 deletions
+33
-10
glsl_shader.c
dlls/wined3d/glsl_shader.c
+9
-10
wined3d_private.h
dlls/wined3d/wined3d_private.h
+24
-0
No files found.
dlls/wined3d/glsl_shader.c
View file @
a79654d3
...
@@ -703,11 +703,8 @@ static void shader_glsl_get_register_name(
...
@@ -703,11 +703,8 @@ static void shader_glsl_get_register_name(
static
DWORD
shader_glsl_get_write_mask
(
const
DWORD
param
,
char
*
write_mask
)
{
static
DWORD
shader_glsl_get_write_mask
(
const
DWORD
param
,
char
*
write_mask
)
{
char
*
ptr
=
write_mask
;
char
*
ptr
=
write_mask
;
DWORD
mask
=
param
&
WINED3DSP_WRITEMASK_ALL
;
DWORD
mask
=
param
&
WINED3DSP_WRITEMASK_ALL
;
DWORD
reg_type
=
shader_get_regtype
(
param
);
/* gl_FogFragCoord, gl_PointSize and gl_FragDepth are floats, fixup the write mask. */
if
(
shader_is_scalar
(
param
))
{
if
(((
reg_type
==
WINED3DSPR_RASTOUT
)
&&
((
param
&
WINED3DSP_REGNUM_MASK
)
!=
0
))
||
reg_type
==
WINED3DSPR_DEPTHOUT
)
{
mask
=
WINED3DSP_WRITEMASK_0
;
mask
=
WINED3DSP_WRITEMASK_0
;
}
else
{
}
else
{
*
ptr
++
=
'.'
;
*
ptr
++
=
'.'
;
...
@@ -741,12 +738,14 @@ static void shader_glsl_get_swizzle(const DWORD param, BOOL fixup, DWORD mask, c
...
@@ -741,12 +738,14 @@ static void shader_glsl_get_swizzle(const DWORD param, BOOL fixup, DWORD mask, c
const
char
*
swizzle_chars
=
fixup
?
"zyxw"
:
"xyzw"
;
const
char
*
swizzle_chars
=
fixup
?
"zyxw"
:
"xyzw"
;
char
*
ptr
=
swizzle_str
;
char
*
ptr
=
swizzle_str
;
*
ptr
++
=
'.'
;
if
(
!
shader_is_scalar
(
param
))
{
/* swizzle bits fields: wwzzyyxx */
*
ptr
++
=
'.'
;
if
(
mask
&
WINED3DSP_WRITEMASK_0
)
*
ptr
++
=
swizzle_chars
[
swizzle
&
0x03
];
/* swizzle bits fields: wwzzyyxx */
if
(
mask
&
WINED3DSP_WRITEMASK_1
)
*
ptr
++
=
swizzle_chars
[(
swizzle
>>
2
)
&
0x03
];
if
(
mask
&
WINED3DSP_WRITEMASK_0
)
*
ptr
++
=
swizzle_chars
[
swizzle
&
0x03
];
if
(
mask
&
WINED3DSP_WRITEMASK_2
)
*
ptr
++
=
swizzle_chars
[(
swizzle
>>
4
)
&
0x03
];
if
(
mask
&
WINED3DSP_WRITEMASK_1
)
*
ptr
++
=
swizzle_chars
[(
swizzle
>>
2
)
&
0x03
];
if
(
mask
&
WINED3DSP_WRITEMASK_3
)
*
ptr
++
=
swizzle_chars
[(
swizzle
>>
6
)
&
0x03
];
if
(
mask
&
WINED3DSP_WRITEMASK_2
)
*
ptr
++
=
swizzle_chars
[(
swizzle
>>
4
)
&
0x03
];
if
(
mask
&
WINED3DSP_WRITEMASK_3
)
*
ptr
++
=
swizzle_chars
[(
swizzle
>>
6
)
&
0x03
];
}
*
ptr
=
'\0'
;
*
ptr
=
'\0'
;
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
a79654d3
...
@@ -1847,6 +1847,30 @@ static inline BOOL shader_is_comment(DWORD token) {
...
@@ -1847,6 +1847,30 @@ static inline BOOL shader_is_comment(DWORD token) {
return
WINED3DSIO_COMMENT
==
(
token
&
WINED3DSI_OPCODE_MASK
);
return
WINED3DSIO_COMMENT
==
(
token
&
WINED3DSI_OPCODE_MASK
);
}
}
/* TODO: vFace (ps_3_0) */
static
inline
BOOL
shader_is_scalar
(
DWORD
param
)
{
DWORD
reg_type
=
shader_get_regtype
(
param
);
switch
(
reg_type
)
{
case
WINED3DSPR_RASTOUT
:
if
((
param
&
WINED3DSP_REGNUM_MASK
)
!=
0
)
{
/* oFog & oPts */
return
TRUE
;
}
/* oPos */
return
FALSE
;
case
WINED3DSPR_DEPTHOUT
:
/* oDepth */
case
WINED3DSPR_CONSTBOOL
:
/* b# */
case
WINED3DSPR_LOOP
:
/* aL */
case
WINED3DSPR_PREDICATE
:
/* p0 */
return
TRUE
;
default:
return
FALSE
;
}
}
/* Internally used shader constants. Applications can use constants 0 to GL_LIMITS(vshader_constantsF) - 1,
/* Internally used shader constants. Applications can use constants 0 to GL_LIMITS(vshader_constantsF) - 1,
* so upload them above that
* so upload them above that
*/
*/
...
...
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