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
ea0b3b42
Commit
ea0b3b42
authored
Apr 17, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a struct wined3d_shader_src_param to shader_arb_add_src_param().
parent
1ae060be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+13
-11
No files found.
dlls/wined3d/arb_program_shader.c
View file @
ea0b3b42
...
...
@@ -551,20 +551,20 @@ static void shader_arb_get_register_name(IWineD3DBaseShader *iface, WINED3DSHADE
}
static
void
shader_arb_add_src_param
(
const
struct
wined3d_shader_instruction
*
ins
,
DWORD
param
,
char
*
str
)
const
struct
wined3d_shader_src_param
*
wined3d_src
,
char
*
str
)
{
char
register_name
[
255
];
char
swizzle
[
6
];
BOOL
is_color
;
if
(
(
param
&
WINED3DSP_SRCMOD_MASK
)
==
WINED3DSPSM_NEG
)
strcat
(
str
,
" -"
);
if
(
wined3d_src
->
modifiers
==
WINED3DSPSM_NEG
)
strcat
(
str
,
" -"
);
else
strcat
(
str
,
" "
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
shader_get_regtype
(
param
),
param
&
WINED3DSP_REGNUM_MASK
,
param
&
WINED3DSHADER_ADDRMODE_RELATIVE
,
register_name
,
&
is_color
);
shader_arb_get_register_name
(
ins
->
ctx
->
shader
,
wined3d_src
->
register_type
,
wined3d_src
->
register_idx
,
!!
wined3d_src
->
rel_addr
,
register_name
,
&
is_color
);
strcat
(
str
,
register_name
);
shader_arb_get_swizzle
(
param
,
is_color
,
swizzle
);
shader_arb_get_swizzle
(
wined3d_src
->
token
,
is_color
,
swizzle
);
strcat
(
str
,
swizzle
);
}
...
...
@@ -1043,7 +1043,7 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins)
for
(
i
=
0
;
i
<
ins
->
src_count
;
++
i
)
{
strcat
(
arguments
,
","
);
shader_arb_add_src_param
(
ins
,
ins
->
src
[
i
].
token
,
arguments
);
shader_arb_add_src_param
(
ins
,
&
ins
->
src
[
i
]
,
arguments
);
}
}
shader_addline
(
buffer
,
"%s%s;
\n
"
,
instruction
,
arguments
);
...
...
@@ -1068,7 +1068,7 @@ static void shader_hw_mov(const struct wined3d_shader_instruction *ins)
src0_param
[
0
]
=
'\0'
;
if
(((
IWineD3DVertexShaderImpl
*
)
shader
)
->
rel_offset
)
{
shader_arb_add_src_param
(
ins
,
ins
->
src
[
0
].
token
,
src0_param
);
shader_arb_add_src_param
(
ins
,
&
ins
->
src
[
0
]
,
src0_param
);
shader_addline
(
buffer
,
"ADD TMP.x, %s, helper_const.z;
\n
"
,
src0_param
);
shader_addline
(
buffer
,
"ARL A0.x, TMP.x;
\n
"
);
}
...
...
@@ -1077,9 +1077,11 @@ static void shader_hw_mov(const struct wined3d_shader_instruction *ins)
/* Apple's ARB_vertex_program implementation does not accept an ARL source argument
* 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) */
DWORD
parm
=
ins
->
src
[
0
].
token
&
~
(
WINED3DSP_SWIZZLE_MASK
);
parm
|=
((
ins
->
src
[
0
].
token
>>
WINED3DSP_SWIZZLE_SHIFT
)
&
0x3
)
*
(
0x55
<<
WINED3DSP_SWIZZLE_SHIFT
);
shader_arb_add_src_param
(
ins
,
parm
,
src0_param
);
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
)
*
(
0x55
<<
WINED3DSP_SWIZZLE_SHIFT
);
shader_arb_add_src_param
(
ins
,
&
tmp_src
,
src0_param
);
shader_addline
(
buffer
,
"ARL A0.x, %s;
\n
"
,
src0_param
);
}
}
...
...
@@ -1651,7 +1653,7 @@ static void vshader_hw_rsq_rcp(const struct wined3d_shader_instruction *ins)
strcpy
(
tmpLine
,
instruction
);
shader_arb_add_dst_param
(
ins
,
&
ins
->
dst
[
0
],
tmpLine
);
/* Destination */
strcat
(
tmpLine
,
","
);
shader_arb_add_src_param
(
ins
,
ins
->
src
[
0
].
token
,
tmpLine
);
shader_arb_add_src_param
(
ins
,
&
ins
->
src
[
0
]
,
tmpLine
);
if
((
WINED3DSP_NOSWIZZLE
>>
WINED3DSP_SWIZZLE_SHIFT
)
==
swizzle
)
{
/* Dx sdk says .x is used if no swizzle is given, but our test shows that
* .w is used
...
...
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