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
515c1acf
Commit
515c1acf
authored
Aug 12, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Volumes are always part of a texture.
parent
ff694bf4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
80 deletions
+15
-80
d3d8_private.h
dlls/d3d8/d3d8_private.h
+3
-4
device.c
dlls/d3d8/device.c
+1
-6
volume.c
dlls/d3d8/volume.c
+11
-70
No files found.
dlls/d3d8/d3d8_private.h
View file @
515c1acf
...
...
@@ -205,12 +205,11 @@ struct d3d8_volume
IDirect3DVolume8
IDirect3DVolume8_iface
;
struct
d3d8_resource
resource
;
struct
wined3d_volume
*
wined3d_volume
;
IUnknown
*
container
;
IUnknown
*
forwardReference
;
struct
d3d8_texture
*
texture
;
};
void
volume_init
(
struct
d3d8_volume
*
volume
,
struct
wined3d_volume
*
wined3d_volum
e
,
const
struct
wined3d_parent_ops
**
parent_ops
)
DECLSPEC_HIDDEN
;
void
volume_init
(
struct
d3d8_volume
*
volume
,
struct
d3d8_texture
*
textur
e
,
struct
wined3d_volume
*
wined3d_volume
,
const
struct
wined3d_parent_ops
**
parent_ops
)
DECLSPEC_HIDDEN
;
struct
d3d8_swapchain
{
...
...
dlls/d3d8/device.c
View file @
515c1acf
...
...
@@ -2975,15 +2975,10 @@ static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *
if
(
!
(
d3d_volume
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
d3d_volume
))))
return
E_OUTOFMEMORY
;
volume_init
(
d3d_volume
,
volume
,
parent_ops
);
volume_init
(
d3d_volume
,
container_parent
,
volume
,
parent_ops
);
*
parent
=
d3d_volume
;
TRACE
(
"Created volume %p.
\n
"
,
d3d_volume
);
d3d_volume
->
container
=
container_parent
;
IDirect3DVolume8_Release
(
&
d3d_volume
->
IDirect3DVolume8_iface
);
d3d_volume
->
forwardReference
=
container_parent
;
return
D3D_OK
;
}
...
...
dlls/d3d8/volume.c
View file @
515c1acf
...
...
@@ -51,29 +51,9 @@ static ULONG WINAPI d3d8_volume_AddRef(IDirect3DVolume8 *iface)
struct
d3d8_volume
*
volume
=
impl_from_IDirect3DVolume8
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
TRACE
(
"Forwarding to %p.
\n
"
,
volume
->
texture
);
if
(
volume
->
forwardReference
)
{
/* Forward to the containerParent */
TRACE
(
"Forwarding to %p,
\n
"
,
volume
->
forwardReference
);
return
IUnknown_AddRef
(
volume
->
forwardReference
);
}
else
{
/* No container, handle our own refcounting */
ULONG
ref
=
InterlockedIncrement
(
&
volume
->
resource
.
refcount
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
ref
);
if
(
ref
==
1
)
{
wined3d_mutex_lock
();
wined3d_volume_incref
(
volume
->
wined3d_volume
);
wined3d_mutex_unlock
();
}
return
ref
;
}
return
IDirect3DBaseTexture8_AddRef
(
&
volume
->
texture
->
IDirect3DBaseTexture8_iface
);
}
static
ULONG
WINAPI
d3d8_volume_Release
(
IDirect3DVolume8
*
iface
)
...
...
@@ -81,49 +61,18 @@ static ULONG WINAPI d3d8_volume_Release(IDirect3DVolume8 *iface)
struct
d3d8_volume
*
volume
=
impl_from_IDirect3DVolume8
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
TRACE
(
"Forwarding to %p.
\n
"
,
volume
->
texture
);
if
(
volume
->
forwardReference
)
{
/* Forward to the containerParent */
TRACE
(
"Forwarding to %p.
\n
"
,
volume
->
forwardReference
);
return
IUnknown_Release
(
volume
->
forwardReference
);
}
else
{
/* No container, handle our own refcounting */
ULONG
ref
=
InterlockedDecrement
(
&
volume
->
resource
.
refcount
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
ref
);
if
(
!
ref
)
{
wined3d_mutex_lock
();
wined3d_volume_decref
(
volume
->
wined3d_volume
);
wined3d_mutex_unlock
();
}
return
ref
;
}
return
IDirect3DBaseTexture8_Release
(
&
volume
->
texture
->
IDirect3DBaseTexture8_iface
);
}
static
HRESULT
WINAPI
d3d8_volume_GetDevice
(
IDirect3DVolume8
*
iface
,
IDirect3DDevice8
**
device
)
{
struct
d3d8_volume
*
volume
=
impl_from_IDirect3DVolume8
(
iface
);
IDirect3DResource8
*
resource
;
HRESULT
hr
;
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
hr
=
IUnknown_QueryInterface
(
volume
->
forwardReference
,
&
IID_IDirect3DResource8
,
(
void
**
)
&
resource
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IDirect3DResource8_GetDevice
(
resource
,
device
);
IDirect3DResource8_Release
(
resource
);
TRACE
(
"Returning device %p.
\n
"
,
*
device
);
}
return
hr
;
return
IDirect3DBaseTexture8_GetDevice
(
&
volume
->
texture
->
IDirect3DBaseTexture8_iface
,
device
);
}
static
HRESULT
WINAPI
d3d8_volume_SetPrivateData
(
IDirect3DVolume8
*
iface
,
REFGUID
guid
,
...
...
@@ -157,19 +106,10 @@ static HRESULT WINAPI d3d8_volume_FreePrivateData(IDirect3DVolume8 *iface, REFGU
static
HRESULT
WINAPI
d3d8_volume_GetContainer
(
IDirect3DVolume8
*
iface
,
REFIID
riid
,
void
**
container
)
{
struct
d3d8_volume
*
volume
=
impl_from_IDirect3DVolume8
(
iface
);
HRESULT
res
;
TRACE
(
"iface %p, riid %s, container %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
container
);
if
(
!
volume
->
container
)
return
E_NOINTERFACE
;
res
=
IUnknown_QueryInterface
(
volume
->
container
,
riid
,
container
);
TRACE
(
"
Returning %p.
\n
"
,
*
container
);
TRACE
(
"
iface %p, riid %s, container %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
container
);
return
res
;
return
IDirect3DBaseTexture8_QueryInterface
(
&
volume
->
texture
->
IDirect3DBaseTexture8_iface
,
riid
,
container
)
;
}
static
HRESULT
WINAPI
d3d8_volume_GetDesc
(
IDirect3DVolume8
*
iface
,
D3DVOLUME_DESC
*
desc
)
...
...
@@ -261,13 +201,14 @@ static const struct wined3d_parent_ops d3d8_volume_wined3d_parent_ops =
volume_wined3d_object_destroyed
,
};
void
volume_init
(
struct
d3d8_volume
*
volume
,
struct
wined3d_volume
*
wined3d_volum
e
,
const
struct
wined3d_parent_ops
**
parent_ops
)
void
volume_init
(
struct
d3d8_volume
*
volume
,
struct
d3d8_texture
*
textur
e
,
struct
wined3d_volume
*
wined3d_volume
,
const
struct
wined3d_parent_ops
**
parent_ops
)
{
volume
->
IDirect3DVolume8_iface
.
lpVtbl
=
&
d3d8_volume_vtbl
;
d3d8_resource_init
(
&
volume
->
resource
);
wined3d_volume_incref
(
wined3d_volume
)
;
volume
->
resource
.
refcount
=
0
;
volume
->
wined3d_volume
=
wined3d_volume
;
volume
->
texture
=
texture
;
*
parent_ops
=
&
d3d8_volume_wined3d_parent_ops
;
}
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