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
c4f8845b
Commit
c4f8845b
authored
Jul 16, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Recognize SM4 arrays.
This is for SM4 constant buffers, which look like cb<x>[<y>]. At some later point we should probably translate pre-SM4 constants to constant buffers.
parent
f24bf3e4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
9 deletions
+47
-9
baseshader.c
dlls/wined3d/baseshader.c
+19
-6
shader_sm1.c
dlls/wined3d/shader_sm1.c
+2
-0
shader_sm4.c
dlls/wined3d/shader_sm4.c
+25
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/baseshader.c
View file @
c4f8845b
...
...
@@ -956,14 +956,27 @@ static void shader_dump_register(const struct wined3d_shader_register *reg,
}
else
if
(
reg
->
type
!=
WINED3DSPR_RASTOUT
&&
reg
->
type
!=
WINED3DSPR_MISCTYPE
)
{
if
(
reg
->
rel_addr
)
if
(
reg
->
array_idx
!=
~
0U
)
{
TRACE
(
"["
);
shader_dump_src_param
(
reg
->
rel_addr
,
shader_version
);
TRACE
(
" + "
);
TRACE
(
"%u[%u"
,
offset
,
reg
->
array_idx
);
if
(
reg
->
rel_addr
)
{
TRACE
(
" + "
);
shader_dump_src_param
(
reg
->
rel_addr
,
shader_version
);
}
TRACE
(
"]"
);
}
else
{
if
(
reg
->
rel_addr
)
{
TRACE
(
"["
);
shader_dump_src_param
(
reg
->
rel_addr
,
shader_version
);
TRACE
(
" + "
);
}
TRACE
(
"%u"
,
offset
);
if
(
reg
->
rel_addr
)
TRACE
(
"]"
);
}
TRACE
(
"%u"
,
offset
);
if
(
reg
->
rel_addr
)
TRACE
(
"]"
);
}
}
...
...
dlls/wined3d/shader_sm1.c
View file @
c4f8845b
...
...
@@ -349,6 +349,7 @@ static void shader_parse_src_param(DWORD param, const struct wined3d_shader_src_
src
->
reg
.
type
=
((
param
&
WINED3DSP_REGTYPE_MASK
)
>>
WINED3DSP_REGTYPE_SHIFT
)
|
((
param
&
WINED3DSP_REGTYPE_MASK2
)
>>
WINED3DSP_REGTYPE_SHIFT2
);
src
->
reg
.
idx
=
param
&
WINED3DSP_REGNUM_MASK
;
src
->
reg
.
array_idx
=
~
0U
;
src
->
swizzle
=
(
param
&
WINED3DSP_SWIZZLE_MASK
)
>>
WINED3DSP_SWIZZLE_SHIFT
;
src
->
modifiers
=
(
param
&
WINED3DSP_SRCMOD_MASK
)
>>
WINED3DSP_SRCMOD_SHIFT
;
src
->
reg
.
rel_addr
=
rel_addr
;
...
...
@@ -360,6 +361,7 @@ static void shader_parse_dst_param(DWORD param, const struct wined3d_shader_src_
dst
->
reg
.
type
=
((
param
&
WINED3DSP_REGTYPE_MASK
)
>>
WINED3DSP_REGTYPE_SHIFT
)
|
((
param
&
WINED3DSP_REGTYPE_MASK2
)
>>
WINED3DSP_REGTYPE_SHIFT2
);
dst
->
reg
.
idx
=
param
&
WINED3DSP_REGNUM_MASK
;
dst
->
reg
.
array_idx
=
~
0U
;
dst
->
write_mask
=
(
param
&
WINED3D_SM1_WRITEMASK_MASK
)
>>
WINED3D_SM1_WRITEMASK_SHIFT
;
dst
->
modifiers
=
(
param
&
WINED3DSP_DSTMOD_MASK
)
>>
WINED3DSP_DSTMOD_SHIFT
;
dst
->
shift
=
(
param
&
WINED3DSP_DSTSHIFT_MASK
)
>>
WINED3DSP_DSTSHIFT_SHIFT
;
...
...
dlls/wined3d/shader_sm4.c
View file @
c4f8845b
...
...
@@ -28,6 +28,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader);
#define WINED3D_SM4_OPCODE_MASK 0xff
#define WINED3D_SM4_REGISTER_ORDER_SHIFT 20
#define WINED3D_SM4_REGISTER_ORDER_MASK (0x3 << WINED3D_SM4_REGISTER_ORDER_SHIFT)
#define WINED3D_SM4_REGISTER_TYPE_SHIFT 12
#define WINED3D_SM4_REGISTER_TYPE_MASK (0xf << WINED3D_SM4_REGISTER_TYPE_SHIFT)
...
...
@@ -265,6 +268,7 @@ static void shader_sm4_read_src_param(void *data, const DWORD **ptr, struct wine
struct
wined3d_sm4_data
*
priv
=
data
;
DWORD
token
=
*
(
*
ptr
)
++
;
enum
wined3d_sm4_register_type
register_type
;
DWORD
order
;
register_type
=
(
token
&
WINED3D_SM4_REGISTER_TYPE_MASK
)
>>
WINED3D_SM4_REGISTER_TYPE_SHIFT
;
if
(
register_type
>=
sizeof
(
register_type_table
)
/
sizeof
(
*
register_type_table
))
...
...
@@ -277,6 +281,16 @@ static void shader_sm4_read_src_param(void *data, const DWORD **ptr, struct wine
src_param
->
reg
.
type
=
register_type_table
[
register_type
];
}
order
=
(
token
&
WINED3D_SM4_REGISTER_ORDER_MASK
)
>>
WINED3D_SM4_REGISTER_ORDER_SHIFT
;
if
(
order
<
1
)
src_param
->
reg
.
idx
=
~
0U
;
else
src_param
->
reg
.
idx
=
*
(
*
ptr
)
++
;
if
(
order
<
2
)
src_param
->
reg
.
array_idx
=
~
0U
;
else
src_param
->
reg
.
array_idx
=
*
(
*
ptr
)
++
;
if
(
order
>
2
)
FIXME
(
"Unhandled order %u.
\n
"
,
order
);
if
(
register_type
==
WINED3D_SM4_RT_IMMCONST
)
{
enum
wined3d_sm4_immconst_type
immconst_type
=
...
...
@@ -304,7 +318,6 @@ static void shader_sm4_read_src_param(void *data, const DWORD **ptr, struct wine
}
else
{
src_param
->
reg
.
idx
=
*
(
*
ptr
)
++
;
src_param
->
swizzle
=
(
token
&
WINED3D_SM4_SWIZZLE_MASK
)
>>
WINED3D_SM4_SWIZZLE_SHIFT
;
}
...
...
@@ -319,8 +332,8 @@ static void shader_sm4_read_dst_param(void *data, const DWORD **ptr, struct wine
{
struct
wined3d_sm4_data
*
priv
=
data
;
DWORD
token
=
*
(
*
ptr
)
++
;
UINT
register_idx
=
*
(
*
ptr
)
++
;
enum
wined3d_sm4_register_type
register_type
;
DWORD
order
;
register_type
=
(
token
&
WINED3D_SM4_REGISTER_TYPE_MASK
)
>>
WINED3D_SM4_REGISTER_TYPE_SHIFT
;
if
(
register_type
>=
sizeof
(
register_type_table
)
/
sizeof
(
*
register_type_table
))
...
...
@@ -333,7 +346,16 @@ static void shader_sm4_read_dst_param(void *data, const DWORD **ptr, struct wine
dst_param
->
reg
.
type
=
register_type_table
[
register_type
];
}
dst_param
->
reg
.
idx
=
register_idx
;
order
=
(
token
&
WINED3D_SM4_REGISTER_ORDER_MASK
)
>>
WINED3D_SM4_REGISTER_ORDER_SHIFT
;
if
(
order
<
1
)
dst_param
->
reg
.
idx
=
~
0U
;
else
dst_param
->
reg
.
idx
=
*
(
*
ptr
)
++
;
if
(
order
<
2
)
dst_param
->
reg
.
array_idx
=
~
0U
;
else
dst_param
->
reg
.
array_idx
=
*
(
*
ptr
)
++
;
if
(
order
>
2
)
FIXME
(
"Unhandled order %u.
\n
"
,
order
);
dst_param
->
write_mask
=
(
token
&
WINED3D_SM4_WRITEMASK_MASK
)
>>
WINED3D_SM4_WRITEMASK_SHIFT
;
dst_param
->
modifiers
=
0
;
dst_param
->
shift
=
0
;
...
...
dlls/wined3d/wined3d_private.h
View file @
c4f8845b
...
...
@@ -670,6 +670,7 @@ struct wined3d_shader_register
{
WINED3DSHADER_PARAM_REGISTER_TYPE
type
;
UINT
idx
;
UINT
array_idx
;
const
struct
wined3d_shader_src_param
*
rel_addr
;
enum
wined3d_immconst_type
immconst_type
;
DWORD
immconst_data
[
4
];
...
...
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