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
b9468a89
Commit
b9468a89
authored
Dec 15, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 15, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Create a d3d8 declaration as parent for FVF based declarations.
parent
90114522
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
14 deletions
+30
-14
d3d8_private.h
dlls/d3d8/d3d8_private.h
+1
-1
device.c
dlls/d3d8/device.c
+29
-13
No files found.
dlls/d3d8/d3d8_private.h
View file @
b9468a89
...
...
@@ -170,7 +170,7 @@ typedef void * shader_handle;
struct
FvfToDecl
{
DWORD
fvf
;
IWineD3DVertexDeclaration
*
decl
;
struct
IDirect3DVertexDeclaration8
*
decl
;
};
struct
IDirect3DDevice8Impl
...
...
dlls/d3d8/device.c
View file @
b9468a89
...
...
@@ -107,7 +107,7 @@ static ULONG WINAPI IDirect3DDevice8Impl_Release(LPDIRECT3DDEVICE8 iface) {
This
->
inDestruction
=
TRUE
;
for
(
i
=
0
;
i
<
This
->
numConvertedDecls
;
i
++
)
{
I
WineD3DVertexDeclaration
_Release
(
This
->
decls
[
i
].
decl
);
I
Direct3DVertexDeclaration8
_Release
(
This
->
decls
[
i
].
decl
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
decls
);
...
...
@@ -1609,10 +1609,10 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexShader(LPDIRECT3DDEVICE8
return
hrc
;
}
static
I
WineD3DVertexDeclaration
*
IDirect3DDevice8Impl_FindDecl
(
IDirect3DDevice8Impl
*
This
,
DWORD
fvf
)
static
I
Direct3DVertexDeclaration8Impl
*
IDirect3DDevice8Impl_FindDecl
(
IDirect3DDevice8Impl
*
This
,
DWORD
fvf
)
{
IDirect3DVertexDeclaration8Impl
*
d3d8_declaration
;
HRESULT
hr
;
IWineD3DVertexDeclaration
*
pDecl
=
NULL
;
int
p
,
low
,
high
;
/* deliberately signed */
struct
FvfToDecl
*
convertedDecls
=
This
->
decls
;
...
...
@@ -1625,7 +1625,7 @@ static IWineD3DVertexDeclaration *IDirect3DDevice8Impl_FindDecl(IDirect3DDevice8
TRACE
(
"%d "
,
p
);
if
(
convertedDecls
[
p
].
fvf
==
fvf
)
{
TRACE
(
"found %p
\n
"
,
convertedDecls
[
p
].
decl
);
return
convertedDecls
[
p
].
decl
;
return
(
IDirect3DVertexDeclaration8Impl
*
)
convertedDecls
[
p
].
decl
;
}
else
if
(
convertedDecls
[
p
].
fvf
<
fvf
)
{
low
=
p
+
1
;
}
else
{
...
...
@@ -1634,11 +1634,26 @@ static IWineD3DVertexDeclaration *IDirect3DDevice8Impl_FindDecl(IDirect3DDevice8
}
TRACE
(
"not found. Creating and inserting at position %d.
\n
"
,
low
);
d3d8_declaration
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
d3d8_declaration
));
if
(
!
d3d8_declaration
)
{
ERR
(
"Memory allocation failed.
\n
"
);
return
NULL
;
}
d3d8_declaration
->
ref_count
=
1
;
d3d8_declaration
->
lpVtbl
=
&
Direct3DVertexDeclaration8_Vtbl
;
d3d8_declaration
->
elements
=
NULL
;
d3d8_declaration
->
elements_size
=
0
;
hr
=
IWineD3DDevice_CreateVertexDeclarationFromFVF
(
This
->
WineD3DDevice
,
&
pDecl
,
(
IUnknown
*
)
This
,
fvf
);
if
(
FAILED
(
hr
))
return
NULL
;
&
d3d8_declaration
->
wined3d_vertex_declaration
,
(
IUnknown
*
)
d3d8_declaration
,
fvf
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to create wined3d vertex declaration.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
d3d8_declaration
);
return
NULL
;
}
if
(
This
->
declArraySize
==
This
->
numConvertedDecls
)
{
int
grow
=
This
->
declArraySize
/
2
;
...
...
@@ -1646,7 +1661,7 @@ static IWineD3DVertexDeclaration *IDirect3DDevice8Impl_FindDecl(IDirect3DDevice8
sizeof
(
convertedDecls
[
0
])
*
(
This
->
numConvertedDecls
+
grow
));
if
(
!
convertedDecls
)
{
/* This will destroy it */
I
WineD3DVertexDeclaration_Release
(
pDecl
);
I
Direct3DVertexDeclaration8_Release
((
IDirect3DVertexDeclaration8
*
)
d3d8_declaration
);
return
NULL
;
}
This
->
decls
=
convertedDecls
;
...
...
@@ -1654,12 +1669,12 @@ static IWineD3DVertexDeclaration *IDirect3DDevice8Impl_FindDecl(IDirect3DDevice8
}
memmove
(
convertedDecls
+
low
+
1
,
convertedDecls
+
low
,
sizeof
(
convertedDecls
[
0
])
*
(
This
->
numConvertedDecls
-
low
));
convertedDecls
[
low
].
decl
=
pDecl
;
convertedDecls
[
low
].
decl
=
(
IDirect3DVertexDeclaration8
*
)
d3d8_declaration
;
convertedDecls
[
low
].
fvf
=
fvf
;
This
->
numConvertedDecls
++
;
TRACE
(
"Returning %p. %
d decls in array
\n
"
,
pDecl
,
This
->
numConvertedDecls
);
return
pDecl
;
TRACE
(
"Returning %p. %
u decls in array
\n
"
,
d3d8_declaration
,
This
->
numConvertedDecls
);
return
d3d8_declaration
;
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_SetVertexShader
(
LPDIRECT3DDEVICE8
iface
,
DWORD
pShader
)
{
...
...
@@ -1671,7 +1686,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShader(LPDIRECT3DDEVICE8 ifa
if
(
VS_HIGHESTFIXEDFXF
>=
pShader
)
{
TRACE
(
"Setting FVF, %d %d
\n
"
,
VS_HIGHESTFIXEDFXF
,
pShader
);
IWineD3DDevice_SetFVF
(
This
->
WineD3DDevice
,
pShader
);
IWineD3DDevice_SetVertexDeclaration
(
This
->
WineD3DDevice
,
IDirect3DDevice8Impl_FindDecl
(
This
,
pShader
));
IWineD3DDevice_SetVertexDeclaration
(
This
->
WineD3DDevice
,
IDirect3DDevice8Impl_FindDecl
(
This
,
pShader
)
->
wined3d_vertex_declaration
);
IWineD3DDevice_SetVertexShader
(
This
->
WineD3DDevice
,
NULL
);
}
else
{
TRACE
(
"Setting shader
\n
"
);
...
...
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