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
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
Alexey Alyaev
wine
Commits
5194ce19
Commit
5194ce19
authored
17 years ago
by
Stefan Dösinger
Committed by
Alexandre Julliard
17 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3d9: Hold the lock in Pixelshader functions.
parent
896568f2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/d3d9/pixelshader.c
+47
-6
47 additions, 6 deletions
dlls/d3d9/pixelshader.c
with
47 additions
and
6 deletions
dlls/d3d9/pixelshader.c
+
47
−
6
View file @
5194ce19
...
...
@@ -56,7 +56,9 @@ static ULONG WINAPI IDirect3DPixelShader9Impl_Release(LPDIRECT3DPIXELSHADER9 ifa
TRACE
(
"(%p) : ReleaseRef to %d
\n
"
,
This
,
ref
);
if
(
ref
==
0
)
{
EnterCriticalSection
(
&
d3d9_cs
);
IWineD3DPixelShader_Release
(
This
->
wineD3DPixelShader
);
LeaveCriticalSection
(
&
d3d9_cs
);
IUnknown_Release
(
This
->
parentDevice
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -70,17 +72,24 @@ static HRESULT WINAPI IDirect3DPixelShader9Impl_GetDevice(LPDIRECT3DPIXELSHADER9
TRACE
(
"(%p) : Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
IWineD3DPixelShader_GetDevice
(
This
->
wineD3DPixelShader
,
&
myDevice
);
IWineD3DDevice_GetParent
(
myDevice
,
(
IUnknown
**
)
ppDevice
);
IWineD3DDevice_Release
(
myDevice
);
LeaveCriticalSection
(
&
d3d9_cs
);
TRACE
(
"(%p) returning (%p)
\n
"
,
This
,
*
ppDevice
);
return
D3D_OK
;
}
static
HRESULT
WINAPI
IDirect3DPixelShader9Impl_GetFunction
(
LPDIRECT3DPIXELSHADER9
iface
,
VOID
*
pData
,
UINT
*
pSizeOfData
)
{
IDirect3DPixelShader9Impl
*
This
=
(
IDirect3DPixelShader9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DPixelShader_GetFunction
(
This
->
wineD3DPixelShader
,
pData
,
pSizeOfData
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DPixelShader_GetFunction
(
This
->
wineD3DPixelShader
,
pData
,
pSizeOfData
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
...
...
@@ -118,7 +127,9 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreatePixelShader(LPDIRECT3DDEVICE9 iface, C
object
->
ref
=
1
;
object
->
lpVtbl
=
&
Direct3DPixelShader9_Vtbl
;
EnterCriticalSection
(
&
d3d9_cs
);
hrc
=
IWineD3DDevice_CreatePixelShader
(
This
->
WineD3DDevice
,
pFunction
,
&
object
->
wineD3DPixelShader
,
(
IUnknown
*
)
object
);
LeaveCriticalSection
(
&
d3d9_cs
);
if
(
hrc
!=
D3D_OK
)
{
/* free up object */
...
...
@@ -139,7 +150,10 @@ HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShader(LPDIRECT3DDEVICE9 iface, IDir
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
IDirect3DPixelShader9Impl
*
shader
=
(
IDirect3DPixelShader9Impl
*
)
pShader
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
IWineD3DDevice_SetPixelShader
(
This
->
WineD3DDevice
,
shader
==
NULL
?
NULL
:
shader
->
wineD3DPixelShader
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
D3D_OK
;
}
...
...
@@ -154,6 +168,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShader(LPDIRECT3DDEVICE9 iface, IDir
return
D3DERR_INVALIDCALL
;
}
EnterCriticalSection
(
&
d3d9_cs
);
hrc
=
IWineD3DDevice_GetPixelShader
(
This
->
WineD3DDevice
,
&
object
);
if
(
hrc
==
D3D_OK
&&
object
!=
NULL
)
{
hrc
=
IWineD3DPixelShader_GetParent
(
object
,
(
IUnknown
**
)
ppShader
);
...
...
@@ -161,6 +176,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShader(LPDIRECT3DDEVICE9 iface, IDir
}
else
{
*
ppShader
=
NULL
;
}
LeaveCriticalSection
(
&
d3d9_cs
);
TRACE
(
"(%p) : returning %p
\n
"
,
This
,
*
ppShader
);
return
hrc
;
...
...
@@ -168,8 +184,13 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShader(LPDIRECT3DDEVICE9 iface, IDir
HRESULT
WINAPI
IDirect3DDevice9Impl_SetPixelShaderConstantF
(
LPDIRECT3DDEVICE9
iface
,
UINT
Register
,
CONST
float
*
pConstantData
,
UINT
Vector4fCount
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DDevice_SetPixelShaderConstantF
(
This
->
WineD3DDevice
,
Register
,
pConstantData
,
Vector4fCount
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DDevice_SetPixelShaderConstantF
(
This
->
WineD3DDevice
,
Register
,
pConstantData
,
Vector4fCount
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
HRESULT
WINAPI
IDirect3DDevice9Impl_GetPixelShaderConstantF
(
LPDIRECT3DDEVICE9
iface
,
UINT
Register
,
float
*
pConstantData
,
UINT
Vector4fCount
)
{
...
...
@@ -180,24 +201,44 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetPixelShaderConstantF(LPDIRECT3DDEVICE9 if
HRESULT
WINAPI
IDirect3DDevice9Impl_SetPixelShaderConstantI
(
LPDIRECT3DDEVICE9
iface
,
UINT
Register
,
CONST
int
*
pConstantData
,
UINT
Vector4iCount
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DDevice_SetPixelShaderConstantI
(
This
->
WineD3DDevice
,
Register
,
pConstantData
,
Vector4iCount
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DDevice_SetPixelShaderConstantI
(
This
->
WineD3DDevice
,
Register
,
pConstantData
,
Vector4iCount
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
HRESULT
WINAPI
IDirect3DDevice9Impl_GetPixelShaderConstantI
(
LPDIRECT3DDEVICE9
iface
,
UINT
Register
,
int
*
pConstantData
,
UINT
Vector4iCount
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DDevice_GetPixelShaderConstantI
(
This
->
WineD3DDevice
,
Register
,
pConstantData
,
Vector4iCount
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DDevice_GetPixelShaderConstantI
(
This
->
WineD3DDevice
,
Register
,
pConstantData
,
Vector4iCount
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
HRESULT
WINAPI
IDirect3DDevice9Impl_SetPixelShaderConstantB
(
LPDIRECT3DDEVICE9
iface
,
UINT
Register
,
CONST
BOOL
*
pConstantData
,
UINT
BoolCount
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DDevice_SetPixelShaderConstantB
(
This
->
WineD3DDevice
,
Register
,
pConstantData
,
BoolCount
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DDevice_SetPixelShaderConstantB
(
This
->
WineD3DDevice
,
Register
,
pConstantData
,
BoolCount
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
HRESULT
WINAPI
IDirect3DDevice9Impl_GetPixelShaderConstantB
(
LPDIRECT3DDEVICE9
iface
,
UINT
Register
,
BOOL
*
pConstantData
,
UINT
BoolCount
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
HRESULT
hr
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
return
IWineD3DDevice_GetPixelShaderConstantB
(
This
->
WineD3DDevice
,
Register
,
pConstantData
,
BoolCount
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3DDevice_GetPixelShaderConstantB
(
This
->
WineD3DDevice
,
Register
,
pConstantData
,
BoolCount
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
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