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
6f206c75
Commit
6f206c75
authored
Mar 27, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Don't create an END element for wined3d vertex declarations.
Wined3d doesn't need it since it already has the element count.
parent
9f26fed2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
22 deletions
+17
-22
vertexdeclaration.c
dlls/d3d8/vertexdeclaration.c
+0
-5
vertexdeclaration.c
dlls/d3d9/vertexdeclaration.c
+12
-5
device.c
dlls/wined3d/device.c
+5
-8
vertexdeclaration.c
dlls/wined3d/vertexdeclaration.c
+0
-3
wined3d.idl
include/wine/wined3d.idl
+0
-1
No files found.
dlls/d3d8/vertexdeclaration.c
View file @
6f206c75
...
...
@@ -324,11 +324,6 @@ UINT convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3d8_elem
token
+=
parse_token
(
token
);
}
/* END */
element
=
*
wined3d_elements
+
element_count
++
;
element
->
Stream
=
0xFF
;
element
->
Type
=
WINED3DDECLTYPE_UNUSED
;
*
d3d8_elements_size
=
(
++
token
-
d3d8_elements
)
*
sizeof
(
DWORD
);
return
element_count
;
...
...
dlls/d3d9/vertexdeclaration.c
View file @
6f206c75
...
...
@@ -312,13 +312,16 @@ static UINT convert_to_wined3d_declaration(const D3DVERTEXELEMENT9* d3d9_element
while
(
element
++->
Stream
!=
0xff
&&
element_count
++
<
128
);
if
(
element_count
==
128
)
{
return
0
;
return
~
0U
;
}
/* Skip the END element */
--
element_count
;
*
wined3d_elements
=
HeapAlloc
(
GetProcessHeap
(),
0
,
element_count
*
sizeof
(
WINED3DVERTEXELEMENT
));
if
(
!*
wined3d_elements
)
{
FIXME
(
"Memory allocation failed
\n
"
);
return
0
;
return
~
0U
;
}
for
(
i
=
0
;
i
<
element_count
;
++
i
)
{
...
...
@@ -335,6 +338,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(LPDIRECT3DDEVICE9E
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
IDirect3DVertexDeclaration9Impl
*
object
=
NULL
;
WINED3DVERTEXELEMENT
*
wined3d_elements
;
UINT
wined3d_element_count
;
UINT
element_count
;
HRESULT
hr
=
D3D_OK
;
...
...
@@ -344,8 +348,9 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(LPDIRECT3DDEVICE9E
return
D3DERR_INVALIDCALL
;
}
element_count
=
convert_to_wined3d_declaration
(
pVertexElements
,
&
wined3d_elements
);
if
(
!
element_count
)
{
wined3d_element_count
=
convert_to_wined3d_declaration
(
pVertexElements
,
&
wined3d_elements
);
if
(
wined3d_element_count
==
~
0U
)
{
FIXME
(
"(%p) : Error parsing vertex declaration
\n
"
,
This
);
return
D3DERR_INVALIDCALL
;
}
...
...
@@ -361,6 +366,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(LPDIRECT3DDEVICE9E
object
->
lpVtbl
=
&
Direct3DVertexDeclaration9_Vtbl
;
object
->
ref
=
0
;
element_count
=
wined3d_element_count
+
1
;
object
->
elements
=
HeapAlloc
(
GetProcessHeap
(),
0
,
element_count
*
sizeof
(
D3DVERTEXELEMENT9
));
if
(
!
object
->
elements
)
{
HeapFree
(
GetProcessHeap
(),
0
,
wined3d_elements
);
...
...
@@ -372,7 +378,8 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(LPDIRECT3DDEVICE9E
object
->
element_count
=
element_count
;
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DDevice_CreateVertexDeclaration
(
This
->
WineD3DDevice
,
&
object
->
wineD3DVertexDeclaration
,
(
IUnknown
*
)
object
,
wined3d_elements
,
element_count
);
hr
=
IWineD3DDevice_CreateVertexDeclaration
(
This
->
WineD3DDevice
,
&
object
->
wineD3DVertexDeclaration
,
(
IUnknown
*
)
object
,
wined3d_elements
,
wined3d_element_count
);
LeaveCriticalSection
(
&
d3d9_cs
);
HeapFree
(
GetProcessHeap
(),
0
,
wined3d_elements
);
...
...
dlls/wined3d/device.c
View file @
6f206c75
...
...
@@ -2200,8 +2200,6 @@ static unsigned int ConvertFvfToDeclaration(IWineD3DDeviceImpl *This, /* For the
DWORD
num_textures
=
(
fvf
&
WINED3DFVF_TEXCOUNT_MASK
)
>>
WINED3DFVF_TEXCOUNT_SHIFT
;
DWORD
texcoords
=
(
fvf
&
0xFFFF0000
)
>>
16
;
WINED3DVERTEXELEMENT
end_element
=
WINED3DDECL_END
();
WINED3DVERTEXELEMENT
*
elements
=
NULL
;
unsigned
int
size
;
...
...
@@ -2210,14 +2208,12 @@ static unsigned int ConvertFvfToDeclaration(IWineD3DDeviceImpl *This, /* For the
/* Compute declaration size */
size
=
has_pos
+
(
has_blend
&&
num_blends
>
0
)
+
has_blend_idx
+
has_normal
+
has_psize
+
has_diffuse
+
has_specular
+
num_textures
+
1
;
has_psize
+
has_diffuse
+
has_specular
+
num_textures
;
/* convert the declaration */
elements
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WINED3DVERTEXELEMENT
));
if
(
!
elements
)
return
0
;
if
(
!
elements
)
return
~
0U
;
elements
[
size
-
1
]
=
end_element
;
idx
=
0
;
if
(
has_pos
)
{
if
(
!
has_blend
&&
(
fvf
&
WINED3DFVF_XYZRHW
))
{
...
...
@@ -2310,7 +2306,8 @@ static unsigned int ConvertFvfToDeclaration(IWineD3DDeviceImpl *This, /* For the
}
/* Now compute offsets, and initialize the rest of the fields */
for
(
idx
=
0
,
offset
=
0
;
idx
<
size
-
1
;
idx
++
)
{
for
(
idx
=
0
,
offset
=
0
;
idx
<
size
;
++
idx
)
{
elements
[
idx
].
Stream
=
0
;
elements
[
idx
].
Method
=
WINED3DDECLMETHOD_DEFAULT
;
elements
[
idx
].
Offset
=
offset
;
...
...
@@ -2328,7 +2325,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclarationFromFVF(IWineD3D
DWORD
hr
;
size
=
ConvertFvfToDeclaration
(
This
,
Fvf
,
&
elements
);
if
(
size
==
0
)
return
WINED3DERR_OUTOFVIDEOMEMORY
;
if
(
size
==
~
0U
)
return
WINED3DERR_OUTOFVIDEOMEMORY
;
hr
=
IWineD3DDevice_CreateVertexDeclaration
(
iface
,
ppVertexDeclaration
,
Parent
,
elements
,
size
);
HeapFree
(
GetProcessHeap
(),
0
,
elements
);
...
...
dlls/wined3d/vertexdeclaration.c
View file @
6f206c75
...
...
@@ -206,9 +206,6 @@ HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *This,
}
}
/* Skip the END element. */
--
element_count
;
This
->
element_count
=
element_count
;
This
->
elements
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
->
elements
)
*
element_count
);
if
(
!
This
->
elements
)
...
...
include/wine/wined3d.idl
View file @
6f206c75
...
...
@@ -846,7 +846,6 @@ typedef enum _WINED3DDECLTYPE
WINED3DDECLTYPE_FLOAT16_4
=
16
,
WINED3DDECLTYPE_UNUSED
=
17
,
}
WINED3DDECLTYPE
;
cpp_quote
(
"#define WINED3DDECL_END() {0xFF, 0, WINED3DDECLTYPE_UNUSED, 0, 0, 0, -1}"
)
typedef
enum
_WINED3DDECLUSAGE
{
...
...
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