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
bc6786d0
Commit
bc6786d0
authored
Mar 14, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Mar 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: COM cleanup in shader.c.
parent
1d9354f6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
d3d8_private.h
dlls/d3d8/d3d8_private.h
+2
-2
device.c
dlls/d3d8/device.c
+2
-2
shader.c
dlls/d3d8/shader.c
+16
-6
No files found.
dlls/d3d8/d3d8_private.h
View file @
bc6786d0
...
...
@@ -484,7 +484,7 @@ DECLARE_INTERFACE_(IDirect3DPixelShader8,IUnknown)
*/
struct
IDirect3DVertexShader8Impl
{
const
IDirect3DVertexShader8Vtbl
*
lpVtbl
;
IDirect3DVertexShader8
IDirect3DVertexShader8_iface
;
LONG
ref
;
IDirect3DVertexDeclaration8
*
vertex_declaration
;
...
...
@@ -500,7 +500,7 @@ HRESULT vertexshader_init(IDirect3DVertexShader8Impl *shader, IDirect3DDevice8Im
* IDirect3DPixelShader implementation structure
*/
typedef
struct
IDirect3DPixelShader8Impl
{
const
IDirect3DPixelShader8Vtbl
*
lpVtbl
;
IDirect3DPixelShader8
IDirect3DPixelShader8_iface
;
LONG
ref
;
DWORD
handle
;
...
...
dlls/d3d8/device.c
View file @
bc6786d0
...
...
@@ -2146,7 +2146,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_DeleteVertexShader(IDirect3DDevice8
wined3d_mutex_unlock
();
if
(
I
Unknown_Release
((
IUnknown
*
)
shader
))
if
(
I
Direct3DVertexShader8_Release
(
&
shader
->
IDirect3DVertexShader8_iface
))
{
ERR
(
"Shader %p has references left, this shouldn't happen.
\n
"
,
shader
);
}
...
...
@@ -2471,7 +2471,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_DeletePixelShader(IDirect3DDevice8 *i
wined3d_mutex_unlock
();
if
(
I
Unknown_Release
((
IUnknown
*
)
shader
))
if
(
I
Direct3DPixelShader8_Release
(
&
shader
->
IDirect3DPixelShader8_iface
))
{
ERR
(
"Shader %p has references left, this shouldn't happen.
\n
"
,
shader
);
}
...
...
dlls/d3d8/shader.c
View file @
bc6786d0
...
...
@@ -22,6 +22,11 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d8
);
static
inline
IDirect3DVertexShader8Impl
*
impl_from_IDirect3DVertexShader8
(
IDirect3DVertexShader8
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DVertexShader8Impl
,
IDirect3DVertexShader8_iface
);
}
static
HRESULT
WINAPI
d3d8_vertexshader_QueryInterface
(
IDirect3DVertexShader8
*
iface
,
REFIID
riid
,
void
**
object
)
{
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
...
...
@@ -42,7 +47,7 @@ static HRESULT WINAPI d3d8_vertexshader_QueryInterface(IDirect3DVertexShader8 *i
static
ULONG
WINAPI
d3d8_vertexshader_AddRef
(
IDirect3DVertexShader8
*
iface
)
{
IDirect3DVertexShader8Impl
*
shader
=
(
IDirect3DVertexShader8Impl
*
)
iface
;
IDirect3DVertexShader8Impl
*
shader
=
impl_from_IDirect3DVertexShader8
(
iface
)
;
ULONG
refcount
=
InterlockedIncrement
(
&
shader
->
ref
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
...
...
@@ -66,7 +71,7 @@ static void STDMETHODCALLTYPE d3d8_vertexshader_wined3d_object_destroyed(void *p
static
ULONG
WINAPI
d3d8_vertexshader_Release
(
IDirect3DVertexShader8
*
iface
)
{
IDirect3DVertexShader8Impl
*
shader
=
(
IDirect3DVertexShader8Impl
*
)
iface
;
IDirect3DVertexShader8Impl
*
shader
=
impl_from_IDirect3DVertexShader8
(
iface
)
;
ULONG
refcount
=
InterlockedDecrement
(
&
shader
->
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
...
...
@@ -157,7 +162,7 @@ HRESULT vertexshader_init(IDirect3DVertexShader8Impl *shader, IDirect3DDevice8Im
}
shader
->
ref
=
1
;
shader
->
lpVtbl
=
&
d3d8_vertexshader_vtbl
;
shader
->
IDirect3DVertexShader8_iface
.
lpVtbl
=
&
d3d8_vertexshader_vtbl
;
hr
=
d3d8_vertexshader_create_vertexdeclaration
(
device
,
declaration
,
shader_handle
,
&
shader
->
vertex_declaration
);
if
(
FAILED
(
hr
))
...
...
@@ -187,6 +192,11 @@ HRESULT vertexshader_init(IDirect3DVertexShader8Impl *shader, IDirect3DDevice8Im
return
D3D_OK
;
}
static
inline
IDirect3DPixelShader8Impl
*
impl_from_IDirect3DPixelShader8
(
IDirect3DPixelShader8
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DPixelShader8Impl
,
IDirect3DPixelShader8_iface
);
}
static
HRESULT
WINAPI
d3d8_pixelshader_QueryInterface
(
IDirect3DPixelShader8
*
iface
,
REFIID
riid
,
void
**
object
)
{
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
...
...
@@ -207,7 +217,7 @@ static HRESULT WINAPI d3d8_pixelshader_QueryInterface(IDirect3DPixelShader8 *ifa
static
ULONG
WINAPI
d3d8_pixelshader_AddRef
(
IDirect3DPixelShader8
*
iface
)
{
IDirect3DPixelShader8Impl
*
shader
=
(
IDirect3DPixelShader8Impl
*
)
iface
;
IDirect3DPixelShader8Impl
*
shader
=
impl_from_IDirect3DPixelShader8
(
iface
)
;
ULONG
refcount
=
InterlockedIncrement
(
&
shader
->
ref
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
...
...
@@ -224,7 +234,7 @@ static ULONG WINAPI d3d8_pixelshader_AddRef(IDirect3DPixelShader8 *iface)
static
ULONG
WINAPI
d3d8_pixelshader_Release
(
IDirect3DPixelShader8
*
iface
)
{
IDirect3DPixelShader8Impl
*
shader
=
(
IDirect3DPixelShader8Impl
*
)
iface
;
IDirect3DPixelShader8Impl
*
shader
=
impl_from_IDirect3DPixelShader8
(
iface
)
;
ULONG
refcount
=
InterlockedDecrement
(
&
shader
->
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
...
...
@@ -263,7 +273,7 @@ HRESULT pixelshader_init(IDirect3DPixelShader8Impl *shader, IDirect3DDevice8Impl
HRESULT
hr
;
shader
->
ref
=
1
;
shader
->
lpVtbl
=
&
d3d8_pixelshader_vtbl
;
shader
->
IDirect3DPixelShader8_iface
.
lpVtbl
=
&
d3d8_pixelshader_vtbl
;
shader
->
handle
=
shader_handle
;
wined3d_mutex_lock
();
...
...
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