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
d4132cf7
Commit
d4132cf7
authored
Mar 28, 2006
by
H. Verbeet
Committed by
Alexandre Julliard
Mar 29, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move the vshader_ins and pshader_ins arrays into their respective objects.
parent
3ee642bb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
15 deletions
+25
-15
device.c
dlls/wined3d/device.c
+2
-0
pixelshader.c
dlls/wined3d/pixelshader.c
+8
-6
vertexshader.c
dlls/wined3d/vertexshader.c
+11
-9
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-0
No files found.
dlls/wined3d/device.c
View file @
d4132cf7
...
...
@@ -1620,6 +1620,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexShader(IWineD3DDevice *iface, CONS
IWineD3DVertexShaderImpl
*
object
;
/* NOTE: impl usage is ok, this is a create */
HRESULT
hr
=
D3D_OK
;
D3DCREATEOBJECTINSTANCE
(
object
,
VertexShader
)
object
->
shader_ins
=
IWineD3DVertexShaderImpl_shader_ins
;
TRACE
(
"(%p) : Created Vertex shader %p
\n
"
,
This
,
*
ppVertexShader
);
...
...
@@ -1664,6 +1665,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice *iface, CONST
HRESULT
hr
=
D3D_OK
;
D3DCREATEOBJECTINSTANCE
(
object
,
PixelShader
)
object
->
shader_ins
=
IWineD3DPixelShaderImpl_shader_ins
;
hr
=
IWineD3DPixelShader_SetFunction
(
*
ppPixelShader
,
pFunction
);
if
(
D3D_OK
==
hr
)
{
TRACE
(
"(%p) : Created Pixel shader %p
\n
"
,
This
,
*
ppPixelShader
);
...
...
dlls/wined3d/pixelshader.c
View file @
d4132cf7
...
...
@@ -629,7 +629,7 @@ void pshader_breakp(WINED3DSHADERVECTOR* d) {
/**
* log, exp, frc, m*x* seems to be macros ins ... to see
*/
static
CONST
SHADER_OPCODE
pshader_ins
[]
=
{
CONST
SHADER_OPCODE
IWineD3DPixelShaderImpl_shader_ins
[]
=
{
{
D3DSIO_NOP
,
"nop"
,
"NOP"
,
0
,
pshader_nop
,
0
,
0
},
{
D3DSIO_MOV
,
"mov"
,
"MOV"
,
2
,
pshader_mov
,
0
,
0
},
{
D3DSIO_ADD
,
"add"
,
"ADD"
,
3
,
pshader_add
,
0
,
0
},
...
...
@@ -746,12 +746,14 @@ inline static const SHADER_OPCODE* pshader_program_get_opcode(IWineD3DPixelShade
DWORD
i
=
0
;
DWORD
version
=
This
->
version
;
DWORD
hex_version
=
D3DPS_VERSION
(
version
/
10
,
version
%
10
);
const
SHADER_OPCODE
*
shader_ins
=
This
->
shader_ins
;
/** TODO: use dichotomic search */
while
(
NULL
!=
p
shader_ins
[
i
].
name
)
{
if
(((
code
&
D3DSI_OPCODE_MASK
)
==
p
shader_ins
[
i
].
opcode
)
&&
(((
hex_version
>=
pshader_ins
[
i
].
min_version
)
&&
(
hex_version
<=
p
shader_ins
[
i
].
max_version
))
||
((
pshader_ins
[
i
].
min_version
==
0
)
&&
(
p
shader_ins
[
i
].
max_version
==
0
))))
{
return
&
p
shader_ins
[
i
];
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
;
}
...
...
dlls/wined3d/vertexshader.c
View file @
d4132cf7
...
...
@@ -582,7 +582,7 @@ void vshader_breakp(WINED3DSHADERVECTOR* d) {
/**
* log, exp, frc, m*x* seems to be macros ins ... to see
*/
static
CONST
SHADER_OPCODE
vshader_ins
[]
=
{
CONST
SHADER_OPCODE
IWineD3DVertexShaderImpl_shader_ins
[]
=
{
{
D3DSIO_NOP
,
"nop"
,
"NOP"
,
0
,
vshader_nop
,
0
,
0
},
{
D3DSIO_MOV
,
"mov"
,
"MOV"
,
2
,
vshader_mov
,
0
,
0
},
{
D3DSIO_ADD
,
"add"
,
"ADD"
,
3
,
vshader_add
,
0
,
0
},
...
...
@@ -691,12 +691,14 @@ static CONST SHADER_OPCODE vshader_ins [] = {
};
inline
static
const
SHADER_OPCODE
*
vshader_program_get_opcode
(
const
DWORD
code
)
{
inline
static
const
SHADER_OPCODE
*
vshader_program_get_opcode
(
IWineD3DVertexShaderImpl
*
This
,
const
DWORD
code
)
{
DWORD
i
=
0
;
const
SHADER_OPCODE
*
shader_ins
=
This
->
shader_ins
;
/** TODO: use dichotomic search or hash table */
while
(
NULL
!=
v
shader_ins
[
i
].
name
)
{
if
((
code
&
D3DSI_OPCODE_MASK
)
==
v
shader_ins
[
i
].
opcode
)
{
return
&
v
shader_ins
[
i
];
while
(
NULL
!=
shader_ins
[
i
].
name
)
{
if
((
code
&
D3DSI_OPCODE_MASK
)
==
shader_ins
[
i
].
opcode
)
{
return
&
shader_ins
[
i
];
}
++
i
;
}
...
...
@@ -1305,7 +1307,7 @@ inline static VOID IWineD3DVertexShaderImpl_GenerateProgramArbHW(IWineD3DVertexS
pToken
+=
comment_len
;
continue
;
}
curOpcode
=
vshader_program_get_opcode
(
*
pToken
);
curOpcode
=
vshader_program_get_opcode
(
This
,
*
pToken
);
++
pToken
;
/* TODO: dcl's */
/* TODO: Consts */
...
...
@@ -1485,7 +1487,7 @@ inline static VOID IWineD3DVertexShaderImpl_GenerateProgramArbHW(IWineD3DVertexS
continue
;
}
curOpcode
=
vshader_program_get_opcode
(
*
pToken
);
curOpcode
=
vshader_program_get_opcode
(
This
,
*
pToken
);
++
pToken
;
if
(
NULL
==
curOpcode
)
{
/* unknown current opcode ... (shouldn't be any!) */
...
...
@@ -1781,7 +1783,7 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_ExecuteSW(IWineD3DVertexShader* iface, W
pToken
+=
comment_len
;
continue
;
}
curOpcode
=
vshader_program_get_opcode
(
*
pToken
);
curOpcode
=
vshader_program_get_opcode
(
This
,
*
pToken
);
++
pToken
;
if
(
NULL
==
curOpcode
)
{
i
=
0
;
...
...
@@ -2129,7 +2131,7 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_SetFunction(IWineD3DVertexShader *iface,
len
+=
comment_len
+
1
;
continue
;
}
curOpcode
=
vshader_program_get_opcode
(
*
pToken
);
curOpcode
=
vshader_program_get_opcode
(
This
,
*
pToken
);
++
pToken
;
++
len
;
if
(
NULL
==
curOpcode
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
d4132cf7
...
...
@@ -1181,6 +1181,7 @@ typedef struct IWineD3DVertexShaderImpl {
IWineD3DDeviceImpl
*
wineD3DDevice
;
/* IWineD3DVertexShaderImpl */
CONST
SHADER_OPCODE
*
shader_ins
;
CONST
DWORD
*
function
;
UINT
functionLength
;
...
...
@@ -1204,6 +1205,7 @@ typedef struct IWineD3DVertexShaderImpl {
VSHADEROUTPUTDATA output;
#endif
}
IWineD3DVertexShaderImpl
;
extern
const
SHADER_OPCODE
IWineD3DVertexShaderImpl_shader_ins
[];
extern
const
IWineD3DVertexShaderVtbl
IWineD3DVertexShader_Vtbl
;
/*****************************************************************************
...
...
@@ -1218,6 +1220,7 @@ typedef struct IWineD3DPixelShaderImpl {
IWineD3DDeviceImpl
*
wineD3DDevice
;
/* IWineD3DPixelShaderImpl */
const
SHADER_OPCODE
*
shader_ins
;
CONST
DWORD
*
function
;
UINT
functionLength
;
DWORD
version
;
...
...
@@ -1233,5 +1236,6 @@ typedef struct IWineD3DPixelShaderImpl {
#endif
}
IWineD3DPixelShaderImpl
;
extern
const
SHADER_OPCODE
IWineD3DPixelShaderImpl_shader_ins
[];
extern
const
IWineD3DPixelShaderVtbl
IWineD3DPixelShader_Vtbl
;
#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