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
db5ab971
Commit
db5ab971
authored
Apr 21, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store the source swizzle in struct wined3d_shader_src_param.
parent
7f58b906
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+4
-4
baseshader.c
dlls/wined3d/baseshader.c
+1
-0
glsl_shader.c
dlls/wined3d/glsl_shader.c
+4
-4
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
db5ab971
...
...
@@ -1075,9 +1075,9 @@ 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
.
token
&=
~
WINED3DSP_SWIZZLE_MASK
;
tmp_src
.
token
|=
((
ins
->
src
[
0
].
token
>>
WINED3DSP_SWIZZLE_SHIFT
)
&
0x3
)
tmp_src
.
swizzle
=
((
ins
->
src
[
0
].
swizzle
>>
WINED3DSP_SWIZZLE_SHIFT
)
&
0x3
)
*
(
0x55
<<
WINED3DSP_SWIZZLE_SHIFT
);
tmp_src
.
token
=
(
tmp_src
.
token
&
~
WINED3DSP_SWIZZLE_MASK
)
|
tmp_src
.
swizzle
;
shader_arb_add_src_param
(
ins
,
&
tmp_src
,
src0_param
);
shader_addline
(
buffer
,
"ARL A0.x, %s;
\n
"
,
src0_param
);
}
...
...
@@ -1633,7 +1633,6 @@ static void shader_hw_mnxn(const struct wined3d_shader_instruction *ins)
static
void
vshader_hw_rsq_rcp
(
const
struct
wined3d_shader_instruction
*
ins
)
{
SHADER_BUFFER
*
buffer
=
ins
->
ctx
->
buffer
;
DWORD
swizzle
=
(
ins
->
src
[
0
].
token
&
WINED3DSP_SWIZZLE_MASK
)
>>
WINED3DSP_SWIZZLE_SHIFT
;
const
char
*
instruction
;
char
tmpLine
[
256
];
...
...
@@ -1651,7 +1650,8 @@ static void vshader_hw_rsq_rcp(const struct wined3d_shader_instruction *ins)
shader_arb_add_dst_param
(
ins
,
&
ins
->
dst
[
0
],
tmpLine
);
/* Destination */
strcat
(
tmpLine
,
","
);
shader_arb_add_src_param
(
ins
,
&
ins
->
src
[
0
],
tmpLine
);
if
((
WINED3DSP_NOSWIZZLE
>>
WINED3DSP_SWIZZLE_SHIFT
)
==
swizzle
)
{
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
*/
...
...
dlls/wined3d/baseshader.c
View file @
db5ab971
...
...
@@ -245,6 +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
->
modifiers
=
param
&
WINED3DSP_SRCMOD_MASK
;
src
->
rel_addr
=
rel_addr
;
src
->
token
=
param
;
...
...
dlls/wined3d/glsl_shader.c
View file @
db5ab971
...
...
@@ -1946,7 +1946,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
].
token
>>
(
WINED3DSP_SWIZZLE_SHIFT
+
2
*
j
))
&
0x3
)
==
i
)
if
(((
ins
->
src
[
0
].
swizzle
>>
(
WINED3DSP_SWIZZLE_SHIFT
+
2
*
j
))
&
0x3
)
==
i
)
{
write_mask
|=
WINED3DSP_WRITEMASK_0
<<
j
;
cmp_channel
=
WINED3DSP_WRITEMASK_0
<<
j
;
...
...
@@ -2028,7 +2028,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
].
token
>>
(
WINED3DSP_SWIZZLE_SHIFT
+
2
*
j
))
&
0x3
)
==
i
)
if
(((
ins
->
src
[
0
].
swizzle
>>
(
WINED3DSP_SWIZZLE_SHIFT
+
2
*
j
))
&
0x3
)
==
i
)
{
write_mask
|=
WINED3DSP_WRITEMASK_0
<<
j
;
cmp_channel
=
WINED3DSP_WRITEMASK_0
<<
j
;
...
...
@@ -2469,7 +2469,7 @@ static void pshader_glsl_tex(const struct wined3d_shader_instruction *ins)
mask
|=
sample_function
.
coord_mask
;
if
(
shader_version
<
WINED3DPS_VERSION
(
2
,
0
))
swizzle
=
WINED3DVS_NOSWIZZLE
;
else
swizzle
=
ins
->
src
[
1
].
token
&
WINED3DSP_SWIZZLE_MASK
;
else
swizzle
=
ins
->
src
[
1
].
swizzle
;
/* 1.0-1.3: Use destination register as coordinate source.
1.4+: Use provided coordinate source register. */
...
...
@@ -2504,7 +2504,7 @@ static void shader_glsl_texldl(const struct wined3d_shader_instruction *ins)
DWORD
sample_flags
=
WINED3D_GLSL_SAMPLE_LOD
;
DWORD
sampler_type
;
DWORD
sampler_idx
;
DWORD
swizzle
=
ins
->
src
[
1
].
token
&
WINED3DSP_SWIZZLE_MASK
;
DWORD
swizzle
=
ins
->
src
[
1
].
swizzle
;
sampler_idx
=
ins
->
src
[
1
].
register_idx
;
sampler_type
=
ins
->
ctx
->
reg_maps
->
samplers
[
sampler_idx
]
&
WINED3DSP_TEXTURETYPE_MASK
;
...
...
dlls/wined3d/wined3d_private.h
View file @
db5ab971
...
...
@@ -465,6 +465,7 @@ struct wined3d_shader_src_param
{
WINED3DSHADER_PARAM_REGISTER_TYPE
register_type
;
UINT
register_idx
;
DWORD
swizzle
;
DWORD
modifiers
;
const
struct
wined3d_shader_src_param
*
rel_addr
;
DWORD
token
;
...
...
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