Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Mayr
wine
Commits
f45684d5
Commit
f45684d5
authored
17 years ago
by
Stefan Dösinger
Committed by
Alexandre Julliard
17 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ddraw: Hold the lock in IDirect3DVertexBuffer methods.
parent
9aab44de
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/ddraw/vertexbuffer.c
+24
-7
24 additions, 7 deletions
dlls/ddraw/vertexbuffer.c
with
24 additions
and
7 deletions
dlls/ddraw/vertexbuffer.c
+
24
−
7
View file @
f45684d5
...
...
@@ -165,6 +165,7 @@ IDirect3DVertexBufferImpl_Release(IDirect3DVertexBuffer7 *iface)
IWineD3DVertexBuffer
*
curVB
=
NULL
;
UINT
offset
,
stride
;
EnterCriticalSection
(
&
ddraw_cs
);
/* D3D7 Vertex buffers don't stay bound in the device, they are passed as a parameter
* to drawPrimitiveVB. DrawPrimitiveVB sets them as the stream source in wined3d,
* and they should get unset there before they are destroyed
...
...
@@ -189,7 +190,9 @@ IDirect3DVertexBufferImpl_Release(IDirect3DVertexBuffer7 *iface)
IWineD3DVertexDeclaration_Release
(
This
->
wineD3DVertexDeclaration
);
IWineD3DVertexBuffer_Release
(
This
->
wineD3DVertexBuffer
);
LeaveCriticalSection
(
&
ddraw_cs
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
}
return
ref
;
...
...
@@ -238,6 +241,7 @@ IDirect3DVertexBufferImpl_Lock(IDirect3DVertexBuffer7 *iface,
HRESULT
hr
;
TRACE
(
"(%p)->(%08x,%p,%p)
\n
"
,
This
,
Flags
,
Data
,
Size
);
EnterCriticalSection
(
&
ddraw_cs
);
if
(
Size
)
{
/* Get the size, for returning it, and for locking */
...
...
@@ -251,11 +255,13 @@ IDirect3DVertexBufferImpl_Lock(IDirect3DVertexBuffer7 *iface,
*
Size
=
Desc
.
Size
;
}
return
IWineD3DVertexBuffer_Lock
(
This
->
wineD3DVertexBuffer
,
0
/* OffsetToLock */
,
0
/* SizeToLock, 0 == Full lock */
,
(
BYTE
**
)
Data
,
Flags
);
hr
=
IWineD3DVertexBuffer_Lock
(
This
->
wineD3DVertexBuffer
,
0
/* OffsetToLock */
,
0
/* SizeToLock, 0 == Full lock */
,
(
BYTE
**
)
Data
,
Flags
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
static
HRESULT
WINAPI
...
...
@@ -286,10 +292,14 @@ static HRESULT WINAPI
IDirect3DVertexBufferImpl_Unlock
(
IDirect3DVertexBuffer7
*
iface
)
{
ICOM_THIS_FROM
(
IDirect3DVertexBufferImpl
,
IDirect3DVertexBuffer7
,
iface
);
HRESULT
hr
;
TRACE
(
"(%p)->()
\n
"
,
This
);
/* This is easy :) */
return
IWineD3DVertexBuffer_Unlock
(
This
->
wineD3DVertexBuffer
);
EnterCriticalSection
(
&
ddraw_cs
);
hr
=
IWineD3DVertexBuffer_Unlock
(
This
->
wineD3DVertexBuffer
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
static
HRESULT
WINAPI
...
...
@@ -355,6 +365,7 @@ IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexBuffer7 *iface,
*/
if
(
!
(
VertexOp
&
D3DVOP_TRANSFORM
)
)
return
DDERR_INVALIDPARAMS
;
EnterCriticalSection
(
&
ddraw_cs
);
/* WineD3D doesn't know d3d7 vertex operation, it uses
* render states instead. Set the render states according to
* the vertex ops
...
...
@@ -392,6 +403,7 @@ IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexBuffer7 *iface,
IWineD3DDevice_SetRenderState
(
D3D
->
wineD3DDevice
,
WINED3DRS_CLIPPING
,
oldClip
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
...
...
@@ -446,11 +458,13 @@ IDirect3DVertexBufferImpl_GetVertexBufferDesc(IDirect3DVertexBuffer7 *iface,
if
(
!
Desc
)
return
DDERR_INVALIDPARAMS
;
EnterCriticalSection
(
&
ddraw_cs
);
hr
=
IWineD3DVertexBuffer_GetDesc
(
This
->
wineD3DVertexBuffer
,
&
WDesc
);
if
(
hr
!=
D3D_OK
)
{
ERR
(
"(%p) IWineD3DVertexBuffer::GetDesc failed with hr=%08x
\n
"
,
This
,
hr
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
...
...
@@ -463,6 +477,7 @@ IDirect3DVertexBufferImpl_GetVertexBufferDesc(IDirect3DVertexBuffer7 *iface,
Desc
->
dwCaps
=
This
->
Caps
;
Desc
->
dwFVF
=
WDesc
.
FVF
;
Desc
->
dwNumVertices
=
WDesc
.
Size
/
get_flexible_vertex_size
(
WDesc
.
FVF
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
D3D_OK
;
}
...
...
@@ -504,7 +519,9 @@ IDirect3DVertexBufferImpl_Optimize(IDirect3DVertexBuffer7 *iface,
/* We could forward this call to WineD3D and take advantage
* of it once we use OpenGL vertex buffers
*/
EnterCriticalSection
(
&
ddraw_cs
);
This
->
Caps
|=
D3DVBCAPS_OPTIMIZED
;
LeaveCriticalSection
(
&
ddraw_cs
);
return
DD_OK
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment