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
4e97e430
Commit
4e97e430
authored
Apr 27, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add a function to read a source parameter from SM1-3 bytecode.
parent
15953b94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
22 deletions
+29
-22
baseshader.c
dlls/wined3d/baseshader.c
+29
-22
No files found.
dlls/wined3d/baseshader.c
View file @
4e97e430
...
...
@@ -180,6 +180,17 @@ static int shader_skip_unrecognized(const DWORD *ptr, DWORD shader_version)
return
tokens_read
;
}
static
void
shader_parse_src_param
(
DWORD
param
,
const
struct
wined3d_shader_src_param
*
rel_addr
,
struct
wined3d_shader_src_param
*
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
)
>>
WINED3DSP_SWIZZLE_SHIFT
;
src
->
modifiers
=
(
param
&
WINED3DSP_SRCMOD_MASK
)
>>
WINED3DSP_SRCMOD_SHIFT
;
src
->
rel_addr
=
rel_addr
;
}
static
void
shader_sm1_read_opcode
(
const
DWORD
**
ptr
,
struct
wined3d_shader_instruction
*
ins
,
UINT
*
param_size
,
const
SHADER_OPCODE
*
opcode_table
,
DWORD
shader_version
)
{
...
...
@@ -205,6 +216,23 @@ static void shader_sm1_read_opcode(const DWORD **ptr, struct wined3d_shader_inst
*
param_size
=
shader_skip_opcode
(
opcode_info
,
opcode_token
,
shader_version
);
}
static
void
shader_sm1_read_src_param
(
const
DWORD
**
ptr
,
struct
wined3d_shader_src_param
*
src_param
,
struct
wined3d_shader_src_param
*
src_rel_addr
,
DWORD
shader_version
)
{
DWORD
token
,
addr_token
;
*
ptr
+=
shader_get_param
(
*
ptr
,
shader_version
,
&
token
,
&
addr_token
);
if
(
token
&
WINED3DSHADER_ADDRMODE_RELATIVE
)
{
shader_parse_src_param
(
addr_token
,
NULL
,
src_rel_addr
);
shader_parse_src_param
(
token
,
src_rel_addr
,
src_param
);
}
else
{
shader_parse_src_param
(
token
,
NULL
,
src_param
);
}
}
static
const
char
*
shader_opcode_names
[]
=
{
/* WINED3DSIH_ABS */
"abs"
,
...
...
@@ -423,17 +451,6 @@ static void shader_parse_dst_param(DWORD param, const struct wined3d_shader_src_
dst
->
rel_addr
=
rel_addr
;
}
static
void
shader_parse_src_param
(
DWORD
param
,
const
struct
wined3d_shader_src_param
*
rel_addr
,
struct
wined3d_shader_src_param
*
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
)
>>
WINED3DSP_SWIZZLE_SHIFT
;
src
->
modifiers
=
(
param
&
WINED3DSP_SRCMOD_MASK
)
>>
WINED3DSP_SRCMOD_SHIFT
;
src
->
rel_addr
=
rel_addr
;
}
/* Note that this does not count the loop register
* as an address register. */
...
...
@@ -1120,17 +1137,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
/* Other source tokens */
for
(
i
=
0
;
i
<
ins
.
src_count
;
++
i
)
{
DWORD
param
,
addr_param
;
pToken
+=
shader_get_param
(
pToken
,
shader_version
,
&
param
,
&
addr_param
);
if
(
param
&
WINED3DSHADER_ADDRMODE_RELATIVE
)
{
shader_parse_src_param
(
addr_param
,
NULL
,
&
src_rel_addr
[
i
]);
shader_parse_src_param
(
param
,
&
src_rel_addr
[
i
],
&
src_param
[
i
]);
}
else
{
shader_parse_src_param
(
param
,
NULL
,
&
src_param
[
i
]);
}
shader_sm1_read_src_param
(
&
pToken
,
&
src_param
[
i
],
&
src_rel_addr
[
i
],
shader_version
);
}
/* Call appropriate function for output target */
...
...
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