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
29aa316d
Commit
29aa316d
authored
Oct 12, 2006
by
Ivan Gyurdiev
Committed by
Alexandre Julliard
Oct 13, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add D3DSI and other opcode masks to the WINED3D namespace.
parent
6f0bb0f6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
12 deletions
+27
-12
baseshader.c
dlls/wined3d/baseshader.c
+10
-10
vertexshader.c
dlls/wined3d/vertexshader.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
wined3d_private_types.h
dlls/wined3d/wined3d_private_types.h
+15
-0
No files found.
dlls/wined3d/baseshader.c
View file @
29aa316d
...
@@ -74,7 +74,7 @@ const SHADER_OPCODE* shader_get_opcode(
...
@@ -74,7 +74,7 @@ const SHADER_OPCODE* shader_get_opcode(
/** TODO: use dichotomic search */
/** TODO: use dichotomic search */
while
(
NULL
!=
shader_ins
[
i
].
name
)
{
while
(
NULL
!=
shader_ins
[
i
].
name
)
{
if
(((
code
&
D3DSI_OPCODE_MASK
)
==
shader_ins
[
i
].
opcode
)
&&
if
(((
code
&
WINE
D3DSI_OPCODE_MASK
)
==
shader_ins
[
i
].
opcode
)
&&
(((
hex_version
>=
shader_ins
[
i
].
min_version
)
&&
(
hex_version
<=
shader_ins
[
i
].
max_version
))
||
(((
hex_version
>=
shader_ins
[
i
].
min_version
)
&&
(
hex_version
<=
shader_ins
[
i
].
max_version
))
||
((
shader_ins
[
i
].
min_version
==
0
)
&&
(
shader_ins
[
i
].
max_version
==
0
))))
{
((
shader_ins
[
i
].
min_version
==
0
)
&&
(
shader_ins
[
i
].
max_version
==
0
))))
{
return
&
shader_ins
[
i
];
return
&
shader_ins
[
i
];
...
@@ -82,7 +82,7 @@ const SHADER_OPCODE* shader_get_opcode(
...
@@ -82,7 +82,7 @@ const SHADER_OPCODE* shader_get_opcode(
++
i
;
++
i
;
}
}
FIXME
(
"Unsupported opcode %#x(%d) masked %#x, shader version %#x
\n
"
,
FIXME
(
"Unsupported opcode %#x(%d) masked %#x, shader version %#x
\n
"
,
code
,
code
,
code
&
D3DSI_OPCODE_MASK
,
hex_version
);
code
,
code
,
code
&
WINE
D3DSI_OPCODE_MASK
,
hex_version
);
return
NULL
;
return
NULL
;
}
}
...
@@ -119,7 +119,7 @@ static inline int shader_skip_opcode(
...
@@ -119,7 +119,7 @@ static inline int shader_skip_opcode(
* have a useful legnth mask - use it here. Shaders 1.0 contain no such tokens */
* have a useful legnth mask - use it here. Shaders 1.0 contain no such tokens */
return
(
D3DSHADER_VERSION_MAJOR
(
This
->
baseShader
.
hex_version
)
>=
2
)
?
return
(
D3DSHADER_VERSION_MAJOR
(
This
->
baseShader
.
hex_version
)
>=
2
)
?
((
opcode_token
&
D3DSI_INSTLENGTH_MASK
)
>>
D3DSI_INSTLENGTH_SHIFT
)
:
((
opcode_token
&
WINED3DSI_INSTLENGTH_MASK
)
>>
WINE
D3DSI_INSTLENGTH_SHIFT
)
:
curOpcode
->
num_params
;
curOpcode
->
num_params
;
}
}
...
@@ -202,7 +202,7 @@ HRESULT shader_get_registers_used(
...
@@ -202,7 +202,7 @@ HRESULT shader_get_registers_used(
/* Skip comments */
/* Skip comments */
}
else
if
(
shader_is_comment
(
*
pToken
))
{
}
else
if
(
shader_is_comment
(
*
pToken
))
{
DWORD
comment_len
=
(
*
pToken
&
D3DSI_COMMENTSIZE_MASK
)
>>
D3DSI_COMMENTSIZE_SHIFT
;
DWORD
comment_len
=
(
*
pToken
&
WINED3DSI_COMMENTSIZE_MASK
)
>>
WINE
D3DSI_COMMENTSIZE_SHIFT
;
++
pToken
;
++
pToken
;
pToken
+=
comment_len
;
pToken
+=
comment_len
;
continue
;
continue
;
...
@@ -354,7 +354,7 @@ HRESULT shader_get_registers_used(
...
@@ -354,7 +354,7 @@ HRESULT shader_get_registers_used(
* okay, since we'll catch any address registers when
* okay, since we'll catch any address registers when
* they are initialized (required by spec) */
* they are initialized (required by spec) */
limit
=
(
opcode_token
&
D3DSHADER_INSTRUCTION_PREDICATED
)
?
limit
=
(
opcode_token
&
WINE
D3DSHADER_INSTRUCTION_PREDICATED
)
?
curOpcode
->
num_params
+
1
:
curOpcode
->
num_params
;
curOpcode
->
num_params
+
1
:
curOpcode
->
num_params
;
for
(
i
=
0
;
i
<
limit
;
++
i
)
{
for
(
i
=
0
;
i
<
limit
;
++
i
)
{
...
@@ -699,7 +699,7 @@ void shader_generate_main(
...
@@ -699,7 +699,7 @@ void shader_generate_main(
/* Skip comment tokens */
/* Skip comment tokens */
if
(
shader_is_comment
(
*
pToken
))
{
if
(
shader_is_comment
(
*
pToken
))
{
DWORD
comment_len
=
(
*
pToken
&
D3DSI_COMMENTSIZE_MASK
)
>>
D3DSI_COMMENTSIZE_SHIFT
;
DWORD
comment_len
=
(
*
pToken
&
WINED3DSI_COMMENTSIZE_MASK
)
>>
WINE
D3DSI_COMMENTSIZE_SHIFT
;
++
pToken
;
++
pToken
;
TRACE
(
"#%s
\n
"
,
(
char
*
)
pToken
);
TRACE
(
"#%s
\n
"
,
(
char
*
)
pToken
);
pToken
+=
comment_len
;
pToken
+=
comment_len
;
...
@@ -749,7 +749,7 @@ void shader_generate_main(
...
@@ -749,7 +749,7 @@ void shader_generate_main(
}
}
/* Predication token */
/* Predication token */
if
(
hw_arg
.
opcode_token
&
D3DSHADER_INSTRUCTION_PREDICATED
)
if
(
hw_arg
.
opcode_token
&
WINE
D3DSHADER_INSTRUCTION_PREDICATED
)
hw_arg
.
predicate
=
*
pToken
++
;
hw_arg
.
predicate
=
*
pToken
++
;
/* Other source tokens */
/* Other source tokens */
...
@@ -832,7 +832,7 @@ void shader_trace_init(
...
@@ -832,7 +832,7 @@ void shader_trace_init(
continue
;
continue
;
}
}
if
(
shader_is_comment
(
*
pToken
))
{
/** comment */
if
(
shader_is_comment
(
*
pToken
))
{
/** comment */
DWORD
comment_len
=
(
*
pToken
&
D3DSI_COMMENTSIZE_MASK
)
>>
D3DSI_COMMENTSIZE_SHIFT
;
DWORD
comment_len
=
(
*
pToken
&
WINED3DSI_COMMENTSIZE_MASK
)
>>
WINE
D3DSI_COMMENTSIZE_SHIFT
;
++
pToken
;
++
pToken
;
TRACE
(
"//%s
\n
"
,
(
char
*
)
pToken
);
TRACE
(
"//%s
\n
"
,
(
char
*
)
pToken
);
pToken
+=
comment_len
;
pToken
+=
comment_len
;
...
@@ -901,7 +901,7 @@ void shader_trace_init(
...
@@ -901,7 +901,7 @@ void shader_trace_init(
/* Print out predication source token first - it follows
/* Print out predication source token first - it follows
* the destination token. */
* the destination token. */
if
(
opcode_token
&
D3DSHADER_INSTRUCTION_PREDICATED
)
{
if
(
opcode_token
&
WINE
D3DSHADER_INSTRUCTION_PREDICATED
)
{
TRACE
(
"("
);
TRACE
(
"("
);
shader_dump_param
(
iface
,
*
(
pToken
+
2
),
0
,
1
);
shader_dump_param
(
iface
,
*
(
pToken
+
2
),
0
,
1
);
TRACE
(
") "
);
TRACE
(
") "
);
...
@@ -939,7 +939,7 @@ void shader_trace_init(
...
@@ -939,7 +939,7 @@ void shader_trace_init(
}
}
/* Predication token - already printed out, just skip it */
/* Predication token - already printed out, just skip it */
if
(
opcode_token
&
D3DSHADER_INSTRUCTION_PREDICATED
)
{
if
(
opcode_token
&
WINE
D3DSHADER_INSTRUCTION_PREDICATED
)
{
pToken
++
;
pToken
++
;
len
++
;
len
++
;
}
}
...
...
dlls/wined3d/vertexshader.c
View file @
29aa316d
...
@@ -895,7 +895,7 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_ExecuteSW(IWineD3DVertexShader* iface, W
...
@@ -895,7 +895,7 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_ExecuteSW(IWineD3DVertexShader* iface, W
}
}
while
(
D3DVS_END
()
!=
*
pToken
)
{
while
(
D3DVS_END
()
!=
*
pToken
)
{
if
(
shader_is_comment
(
*
pToken
))
{
/** comment */
if
(
shader_is_comment
(
*
pToken
))
{
/** comment */
DWORD
comment_len
=
(
*
pToken
&
D3DSI_COMMENTSIZE_MASK
)
>>
D3DSI_COMMENTSIZE_SHIFT
;
DWORD
comment_len
=
(
*
pToken
&
WINED3DSI_COMMENTSIZE_MASK
)
>>
WINE
D3DSI_COMMENTSIZE_SHIFT
;
++
pToken
;
++
pToken
;
pToken
+=
comment_len
;
pToken
+=
comment_len
;
continue
;
continue
;
...
...
dlls/wined3d/wined3d_private.h
View file @
29aa316d
...
@@ -1683,7 +1683,7 @@ inline static BOOL shader_is_vshader_version(DWORD token) {
...
@@ -1683,7 +1683,7 @@ inline static BOOL shader_is_vshader_version(DWORD token) {
}
}
inline
static
BOOL
shader_is_comment
(
DWORD
token
)
{
inline
static
BOOL
shader_is_comment
(
DWORD
token
)
{
return
WINED3DSIO_COMMENT
==
(
token
&
D3DSI_OPCODE_MASK
);
return
WINED3DSIO_COMMENT
==
(
token
&
WINE
D3DSI_OPCODE_MASK
);
}
}
/* 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,
...
...
dlls/wined3d/wined3d_private_types.h
View file @
29aa316d
...
@@ -249,4 +249,19 @@ typedef enum _WINED3DSHADER_INSTRUCTION_OPCODE_TYPE {
...
@@ -249,4 +249,19 @@ typedef enum _WINED3DSHADER_INSTRUCTION_OPCODE_TYPE {
WINED3DSIO_FORCE_DWORD
=
0X7FFFFFFF
/** for 32-bit alignment */
WINED3DSIO_FORCE_DWORD
=
0X7FFFFFFF
/** for 32-bit alignment */
}
WINED3DSHADER_INSTRUCTION_OPCODE_TYPE
;
}
WINED3DSHADER_INSTRUCTION_OPCODE_TYPE
;
/** opcode-related masks **/
#define WINED3DSI_OPCODE_MASK 0x0000FFFF
#define WINED3DSI_INSTLENGTH_MASK 0x0F000000
#define WINED3DSI_INSTLENGTH_SHIFT 24
#define WINED3DSI_COISSUE 0x40000000
#define WINED3DSI_COMMENTSIZE_SHIFT 16
#define WINED3DSI_COMMENTSIZE_MASK (0x7FFF << WINED3DSI_COMMENTSIZE_SHIFT)
#define WINED3DSHADER_COMMENT(commentSize) \
((((commentSize) << WINED3DSI_COMMENTSIZE_SHIFT) & WINED3DSI_COMMENTSIZE_MASK) | WINED3DSIO_COMMENT)
#define WINED3DSHADER_INSTRUCTION_PREDICATED (1 << 28)
#endif
#endif
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