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
fd9b574e
Commit
fd9b574e
authored
Apr 06, 2009
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Store the fvf in the ddraw buffer.
WineD3D buffer FVFs will go away soon.
parent
825354af
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
33 deletions
+11
-33
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-0
device.c
dlls/ddraw/device.c
+6
-28
direct3d.c
dlls/ddraw/direct3d.c
+1
-0
vertexbuffer.c
dlls/ddraw/vertexbuffer.c
+3
-5
No files found.
dlls/ddraw/ddraw_private.h
View file @
fd9b574e
...
...
@@ -687,6 +687,7 @@ struct IDirect3DVertexBufferImpl
/*** Storage for D3D7 specific things ***/
DWORD
Caps
;
DWORD
fvf
;
};
/* The Vtables */
...
...
dlls/ddraw/device.c
View file @
fd9b574e
...
...
@@ -4104,7 +4104,6 @@ IDirect3DDeviceImpl_7_DrawPrimitiveVB(IDirect3DDevice7 *iface,
IDirect3DVertexBufferImpl
*
vb
=
(
IDirect3DVertexBufferImpl
*
)
D3DVertexBuf
;
HRESULT
hr
;
DWORD
stride
;
WINED3DBUFFER_DESC
Desc
;
TRACE
(
"(%p)->(%08x,%p,%08x,%08x,%08x)
\n
"
,
This
,
PrimitiveType
,
D3DVertexBuf
,
StartVertex
,
NumVertices
,
Flags
);
...
...
@@ -4114,18 +4113,9 @@ IDirect3DDeviceImpl_7_DrawPrimitiveVB(IDirect3DDevice7 *iface,
ERR
(
"(%p) No Vertex buffer specified
\n
"
,
This
);
return
DDERR_INVALIDPARAMS
;
}
stride
=
get_flexible_vertex_size
(
vb
->
fvf
);
/* Get the FVF of the vertex buffer, and its stride */
EnterCriticalSection
(
&
ddraw_cs
);
hr
=
IWineD3DBuffer_GetDesc
(
vb
->
wineD3DVertexBuffer
,
&
Desc
);
if
(
hr
!=
D3D_OK
)
{
ERR
(
"(%p) IWineD3DVertexBuffer::GetDesc failed with hr = %08x
\n
"
,
This
,
hr
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
stride
=
get_flexible_vertex_size
(
Desc
.
FVF
);
hr
=
IWineD3DDevice_SetVertexDeclaration
(
This
->
wineD3DDevice
,
vb
->
wineD3DVertexDeclaration
);
if
(
FAILED
(
hr
))
...
...
@@ -4229,32 +4219,20 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
{
IDirect3DDeviceImpl
*
This
=
(
IDirect3DDeviceImpl
*
)
iface
;
IDirect3DVertexBufferImpl
*
vb
=
(
IDirect3DVertexBufferImpl
*
)
D3DVertexBuf
;
DWORD
stride
;
DWORD
stride
=
get_flexible_vertex_size
(
vb
->
fvf
)
;
WORD
*
LockedIndices
;
HRESULT
hr
;
WINED3DBUFFER_DESC
Desc
;
TRACE
(
"(%p)->(%08x,%p,%d,%d,%p,%d,%08x)
\n
"
,
This
,
PrimitiveType
,
vb
,
StartVertex
,
NumVertices
,
Indices
,
IndexCount
,
Flags
);
/* Steps:
* 1) Calculate some things: stride, ...
* 2) Upload the Indices to the index buffer
* 3) Set the index source
* 4) Set the Vertex Buffer as the Stream source
* 5) Call IWineD3DDevice::DrawIndexedPrimitive
* 1) Upload the Indices to the index buffer
* 2) Set the index source
* 3) Set the Vertex Buffer as the Stream source
* 4) Call IWineD3DDevice::DrawIndexedPrimitive
*/
EnterCriticalSection
(
&
ddraw_cs
);
/* Get the FVF of the vertex buffer, and its stride */
hr
=
IWineD3DBuffer_GetDesc
(
vb
->
wineD3DVertexBuffer
,
&
Desc
);
if
(
hr
!=
D3D_OK
)
{
ERR
(
"(%p) IWineD3DVertexBuffer::GetDesc failed with hr = %08x
\n
"
,
This
,
hr
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
stride
=
get_flexible_vertex_size
(
Desc
.
FVF
);
TRACE
(
"Vertex buffer FVF = %08x, stride=%d
\n
"
,
Desc
.
FVF
,
stride
);
hr
=
IWineD3DDevice_SetVertexDeclaration
(
This
->
wineD3DDevice
,
vb
->
wineD3DVertexDeclaration
);
...
...
dlls/ddraw/direct3d.c
View file @
fd9b574e
...
...
@@ -1017,6 +1017,7 @@ IDirect3DImpl_7_CreateVertexBuffer(IDirect3D7 *iface,
object
->
Caps
=
Desc
->
dwCaps
;
object
->
ddraw
=
This
;
object
->
fvf
=
Desc
->
dwFVF
;
EnterCriticalSection
(
&
ddraw_cs
);
hr
=
IWineD3DDevice_CreateVertexBuffer
(
This
->
wineD3DDevice
,
...
...
dlls/ddraw/vertexbuffer.c
View file @
fd9b574e
...
...
@@ -340,7 +340,6 @@ IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexBuffer7 *iface,
IDirect3DDeviceImpl
*
D3D
=
(
IDirect3DDeviceImpl
*
)
D3DDevice
;
BOOL
oldClip
,
doClip
;
HRESULT
hr
;
WINED3DBUFFER_DESC
Desc
;
TRACE
(
"(%p)->(%08x,%d,%d,%p,%d,%p,%08x)
\n
"
,
This
,
VertexOp
,
DestIndex
,
Count
,
Src
,
SrcIndex
,
D3D
,
Flags
);
...
...
@@ -372,12 +371,11 @@ IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexBuffer7 *iface,
doClip
);
}
IWineD3DBuffer_GetDesc
(
Src
->
wineD3DVertexBuffer
,
&
Desc
);
IWineD3DDevice_SetStreamSource
(
D3D
->
wineD3DDevice
,
0
,
/* Stream No */
Src
->
wineD3DVertexBuffer
,
0
,
/* Offset */
get_flexible_vertex_size
(
Desc
.
FVF
));
get_flexible_vertex_size
(
Src
->
fvf
));
IWineD3DDevice_SetVertexDeclaration
(
D3D
->
wineD3DDevice
,
Src
->
wineD3DVertexDeclaration
);
hr
=
IWineD3DDevice_ProcessVertices
(
D3D
->
wineD3DDevice
,
...
...
@@ -452,8 +450,8 @@ IDirect3DVertexBufferImpl_GetVertexBufferDesc(IDirect3DVertexBuffer7 *iface,
/* Now fill the Desc structure */
Desc
->
dwCaps
=
This
->
Caps
;
Desc
->
dwFVF
=
WDesc
.
FVF
;
Desc
->
dwNumVertices
=
WDesc
.
Size
/
get_flexible_vertex_size
(
WDesc
.
FVF
);
Desc
->
dwFVF
=
This
->
fvf
;
Desc
->
dwNumVertices
=
WDesc
.
Size
/
get_flexible_vertex_size
(
This
->
fvf
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
D3D_OK
;
...
...
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