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
1d0c6723
Commit
1d0c6723
authored
May 09, 2006
by
Ivan Gyurdiev
Committed by
Alexandre Julliard
May 09, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Share get_opcode.
parent
9ff27bf6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
41 deletions
+35
-41
baseshader.c
dlls/wined3d/baseshader.c
+24
-0
pixelshader.c
dlls/wined3d/pixelshader.c
+3
-22
vertexshader.c
dlls/wined3d/vertexshader.c
+4
-19
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-0
No files found.
dlls/wined3d/baseshader.c
View file @
1d0c6723
...
...
@@ -54,4 +54,28 @@ int shader_addline(
return
0
;
}
const
SHADER_OPCODE
*
shader_get_opcode
(
IWineD3DBaseShader
*
iface
,
const
DWORD
code
)
{
IWineD3DBaseShaderImpl
*
This
=
(
IWineD3DBaseShaderImpl
*
)
iface
;
DWORD
i
=
0
;
DWORD
version
=
This
->
baseShader
.
version
;
DWORD
hex_version
=
This
->
baseShader
.
hex_version
;
const
SHADER_OPCODE
*
shader_ins
=
This
->
baseShader
.
shader_ins
;
/** TODO: use dichotomic search */
while
(
NULL
!=
shader_ins
[
i
].
name
)
{
if
(((
code
&
D3DSI_OPCODE_MASK
)
==
shader_ins
[
i
].
opcode
)
&&
(((
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
))))
{
return
&
shader_ins
[
i
];
}
++
i
;
}
FIXME
(
"Unsupported opcode %lx(%ld) masked %lx version %ld
\n
"
,
code
,
code
,
code
&
D3DSI_OPCODE_MASK
,
version
);
return
NULL
;
}
/* TODO: Move other shared code here */
dlls/wined3d/pixelshader.c
View file @
1d0c6723
...
...
@@ -719,25 +719,6 @@ CONST SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[] = {
{
0
,
NULL
,
NULL
,
0
,
NULL
,
0
,
0
}
};
inline
static
const
SHADER_OPCODE
*
pshader_program_get_opcode
(
IWineD3DPixelShaderImpl
*
This
,
const
DWORD
code
)
{
DWORD
i
=
0
;
DWORD
version
=
This
->
baseShader
.
version
;
DWORD
hex_version
=
D3DPS_VERSION
(
version
/
10
,
version
%
10
);
const
SHADER_OPCODE
*
shader_ins
=
This
->
baseShader
.
shader_ins
;
/** TODO: use dichotomic search */
while
(
NULL
!=
shader_ins
[
i
].
name
)
{
if
(((
code
&
D3DSI_OPCODE_MASK
)
==
shader_ins
[
i
].
opcode
)
&&
(((
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
))))
{
return
&
shader_ins
[
i
];
}
++
i
;
}
FIXME
(
"Unsupported opcode %lx(%ld) masked %lx version %ld
\n
"
,
code
,
code
,
code
&
D3DSI_OPCODE_MASK
,
version
);
return
NULL
;
}
inline
static
BOOL
pshader_is_version_token
(
DWORD
token
)
{
return
0xFFFF0000
==
(
token
&
0xFFFF0000
);
}
...
...
@@ -945,7 +926,7 @@ inline static void pshader_program_get_registers_used(
}
/* Fetch opcode */
curOpcode
=
pshader_program_get_opcode
(
This
,
*
pToken
);
curOpcode
=
shader_get_opcode
((
IWineD3DBaseShader
*
)
This
,
*
pToken
);
++
pToken
;
/* Skip declarations (for now) */
...
...
@@ -1134,7 +1115,7 @@ inline static VOID IWineD3DPixelShaderImpl_GenerateProgramArbHW(IWineD3DPixelSha
code = *pToken;
#endif
pInstr
=
pToken
;
curOpcode
=
pshader_program_get_opcode
(
This
,
*
pToken
);
curOpcode
=
shader_get_opcode
((
IWineD3DBaseShader
*
)
This
,
*
pToken
);
++
pToken
;
if
(
NULL
==
curOpcode
)
{
/* unknown current opcode ... (shouldn't be any!) */
...
...
@@ -1779,7 +1760,7 @@ HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *iface, C
if
(
!
This
->
baseShader
.
version
)
{
WARN
(
"(%p) : pixel shader doesn't have a valid version identifier
\n
"
,
This
);
}
curOpcode
=
pshader_program_get_opcode
(
This
,
*
pToken
);
curOpcode
=
shader_get_opcode
((
IWineD3DBaseShader
*
)
This
,
*
pToken
);
++
pToken
;
++
len
;
if
(
NULL
==
curOpcode
)
{
...
...
dlls/wined3d/vertexshader.c
View file @
1d0c6723
...
...
@@ -554,21 +554,6 @@ CONST SHADER_OPCODE IWineD3DVertexShaderImpl_shader_ins[] = {
{
0
,
NULL
,
NULL
,
0
,
NULL
,
0
,
0
}
};
inline
static
const
SHADER_OPCODE
*
vshader_program_get_opcode
(
IWineD3DVertexShaderImpl
*
This
,
const
DWORD
code
)
{
DWORD
i
=
0
;
const
SHADER_OPCODE
*
shader_ins
=
This
->
baseShader
.
shader_ins
;
/** TODO: use dichotomic search or hash table */
while
(
NULL
!=
shader_ins
[
i
].
name
)
{
if
((
code
&
D3DSI_OPCODE_MASK
)
==
shader_ins
[
i
].
opcode
)
{
return
&
shader_ins
[
i
];
}
++
i
;
}
FIXME
(
"Unsupported opcode %lx
\n
"
,
code
);
return
NULL
;
}
inline
static
void
vshader_program_dump_vs_param
(
const
DWORD
param
,
int
input
)
{
static
const
char
*
rastout_reg_names
[]
=
{
"oPos"
,
"oFog"
,
"oPts"
};
static
const
char
swizzle_reg_chars
[]
=
"xyzw"
;
...
...
@@ -1147,7 +1132,7 @@ inline static VOID IWineD3DVertexShaderImpl_GenerateProgramArbHW(IWineD3DVertexS
pToken
+=
comment_len
;
continue
;
}
curOpcode
=
vshader_program_get_opcode
(
This
,
*
pToken
);
curOpcode
=
shader_get_opcode
((
IWineD3DBaseShader
*
)
This
,
*
pToken
);
++
pToken
;
/* TODO: dcl's */
/* TODO: Consts */
...
...
@@ -1274,7 +1259,7 @@ inline static VOID IWineD3DVertexShaderImpl_GenerateProgramArbHW(IWineD3DVertexS
continue
;
}
curOpcode
=
vshader_program_get_opcode
(
This
,
*
pToken
);
curOpcode
=
shader_get_opcode
((
IWineD3DBaseShader
*
)
This
,
*
pToken
);
++
pToken
;
if
(
NULL
==
curOpcode
)
{
/* unknown current opcode ... (shouldn't be any!) */
...
...
@@ -1557,7 +1542,7 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_ExecuteSW(IWineD3DVertexShader* iface, W
pToken
+=
comment_len
;
continue
;
}
curOpcode
=
vshader_program_get_opcode
(
This
,
*
pToken
);
curOpcode
=
shader_get_opcode
((
IWineD3DBaseShader
*
)
This
,
*
pToken
);
++
pToken
;
if
(
NULL
==
curOpcode
)
{
i
=
0
;
...
...
@@ -1907,7 +1892,7 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_SetFunction(IWineD3DVertexShader *iface,
len
+=
comment_len
+
1
;
continue
;
}
curOpcode
=
vshader_program_get_opcode
(
This
,
*
pToken
);
curOpcode
=
shader_get_opcode
((
IWineD3DBaseShader
*
)
This
,
*
pToken
);
++
pToken
;
++
len
;
if
(
NULL
==
curOpcode
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
1d0c6723
...
...
@@ -1220,6 +1220,10 @@ extern int shader_addline(
SHADER_BUFFER
*
buffer
,
const
char
*
fmt
,
...);
extern
const
SHADER_OPCODE
*
shader_get_opcode
(
IWineD3DBaseShader
*
iface
,
const
DWORD
code
);
/*****************************************************************************
* IDirect3DBaseShader implementation structure
*/
...
...
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