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
138826b8
Commit
138826b8
authored
Mar 08, 2007
by
H. Verbeet
Committed by
Alexandre Julliard
Mar 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Save the d3d8 vertex declaration.
parent
e879efcc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
d3d8_private.h
dlls/d3d8/d3d8_private.h
+4
-1
device.c
dlls/d3d8/device.c
+13
-1
vertexdeclaration.c
dlls/d3d8/vertexdeclaration.c
+4
-1
No files found.
dlls/d3d8/d3d8_private.h
View file @
138826b8
...
...
@@ -515,6 +515,9 @@ typedef struct {
const
IDirect3DVertexDeclaration8Vtbl
*
lpVtbl
;
LONG
ref_count
;
DWORD
*
elements
;
DWORD
elements_size
;
/* Size of elements, in bytes */
IWineD3DVertexDeclaration
*
wined3d_vertex_declaration
;
}
IDirect3DVertexDeclaration8Impl
;
...
...
@@ -619,7 +622,7 @@ typedef struct IDirect3DPixelShader8Impl {
* to see how not defined it here
*/
void
load_local_constants
(
const
DWORD
*
d3d8_elements
,
IWineD3DVertexShader
*
wined3d_vertex_shader
);
size_t
convert_to_wined3d_declaration
(
const
DWORD
*
d3d8_elements
,
WINED3DVERTEXELEMENT
**
wined3d_elements
);
size_t
convert_to_wined3d_declaration
(
const
DWORD
*
d3d8_elements
,
DWORD
*
d3d8_elements_size
,
WINED3DVERTEXELEMENT
**
wined3d_elements
);
/* Callbacks */
extern
HRESULT
WINAPI
D3D8CB_CreateSurface
(
IUnknown
*
device
,
IUnknown
*
pSuperior
,
UINT
Width
,
UINT
Height
,
...
...
dlls/d3d8/device.c
View file @
138826b8
...
...
@@ -1214,13 +1214,25 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexDeclaration(IDirect3DDevi
object
->
ref_count
=
1
;
object
->
lpVtbl
=
&
Direct3DVertexDeclaration8_Vtbl
;
wined3d_element_count
=
convert_to_wined3d_declaration
(
declaration
,
&
wined3d_elements
);
wined3d_element_count
=
convert_to_wined3d_declaration
(
declaration
,
&
object
->
elements_size
,
&
wined3d_elements
);
object
->
elements
=
HeapAlloc
(
GetProcessHeap
(),
0
,
object
->
elements_size
);
if
(
!
object
->
elements
)
{
ERR
(
"Memory allocation failed
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
wined3d_elements
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
decl_ptr
=
NULL
;
return
D3DERR_OUTOFVIDEOMEMORY
;
}
CopyMemory
(
object
->
elements
,
declaration
,
object
->
elements_size
);
hr
=
IWineD3DDevice_CreateVertexDeclaration
(
This
->
WineD3DDevice
,
&
object
->
wined3d_vertex_declaration
,
(
IUnknown
*
)
object
,
wined3d_elements
,
wined3d_element_count
);
HeapFree
(
GetProcessHeap
(),
0
,
wined3d_elements
);
if
(
FAILED
(
hr
))
{
ERR
(
"(%p) : IWineD3DDevice_CreateVertexDeclaration call failed
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
object
->
elements
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
}
else
{
*
decl_ptr
=
(
IDirect3DVertexDeclaration8
*
)
object
;
...
...
dlls/d3d8/vertexdeclaration.c
View file @
138826b8
...
...
@@ -62,6 +62,7 @@ static ULONG WINAPI IDirect3DVertexDeclaration8Impl_Release(IDirect3DVertexDecla
if
(
!
ref_count
)
{
IWineD3DVertexDeclaration_Release
(
This
->
wined3d_vertex_declaration
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
elements
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -271,7 +272,7 @@ static const wined3d_usage_t wined3d_usage_lookup[] = {
};
/* TODO: find out where rhw (or positionT) is for declaration8 */
size_t
convert_to_wined3d_declaration
(
const
DWORD
*
d3d8_elements
,
WINED3DVERTEXELEMENT
**
wined3d_elements
)
size_t
convert_to_wined3d_declaration
(
const
DWORD
*
d3d8_elements
,
DWORD
*
d3d8_elements_size
,
WINED3DVERTEXELEMENT
**
wined3d_elements
)
{
const
DWORD
*
token
=
d3d8_elements
;
WINED3DVERTEXELEMENT
*
element
;
...
...
@@ -326,6 +327,8 @@ size_t convert_to_wined3d_declaration(const DWORD *d3d8_elements, WINED3DVERTEXE
element
->
Stream
=
0xFF
;
element
->
Type
=
WINED3DDECLTYPE_UNUSED
;
*
d3d8_elements_size
=
(
++
token
-
d3d8_elements
)
*
sizeof
(
DWORD
);
return
element_count
;
}
...
...
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