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
82fc81b6
Commit
82fc81b6
authored
Feb 13, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Implement d3d10_buffer_GetDevice().
parent
6e3619c4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
3 deletions
+32
-3
buffer.c
dlls/d3d10core/buffer.c
+19
-1
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+1
-0
device.c
dlls/d3d10core/tests/device.c
+12
-2
No files found.
dlls/d3d10core/buffer.c
View file @
82fc81b6
...
...
@@ -59,7 +59,10 @@ static ULONG STDMETHODCALLTYPE d3d10_buffer_AddRef(ID3D10Buffer *iface)
TRACE
(
"%p increasing refcount to %u.
\n
"
,
buffer
,
refcount
);
if
(
refcount
==
1
)
{
ID3D10Device1_AddRef
(
buffer
->
device
);
wined3d_buffer_incref
(
buffer
->
wined3d_buffer
);
}
return
refcount
;
}
...
...
@@ -72,7 +75,14 @@ static ULONG STDMETHODCALLTYPE d3d10_buffer_Release(ID3D10Buffer *iface)
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
buffer
,
refcount
);
if
(
!
refcount
)
{
ID3D10Device1
*
device
=
buffer
->
device
;
wined3d_buffer_decref
(
buffer
->
wined3d_buffer
);
/* Release the device last, it may cause the wined3d device to be
* destroyed. */
ID3D10Device1_Release
(
device
);
}
return
refcount
;
}
...
...
@@ -81,7 +91,12 @@ static ULONG STDMETHODCALLTYPE d3d10_buffer_Release(ID3D10Buffer *iface)
static
void
STDMETHODCALLTYPE
d3d10_buffer_GetDevice
(
ID3D10Buffer
*
iface
,
ID3D10Device
**
device
)
{
FIXME
(
"iface %p, device %p stub!
\n
"
,
iface
,
device
);
struct
d3d10_buffer
*
buffer
=
impl_from_ID3D10Buffer
(
iface
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
(
ID3D10Device
*
)
buffer
->
device
;
ID3D10Device_AddRef
(
*
device
);
}
static
HRESULT
STDMETHODCALLTYPE
d3d10_buffer_GetPrivateData
(
ID3D10Buffer
*
iface
,
...
...
@@ -226,5 +241,8 @@ HRESULT d3d10_buffer_init(struct d3d10_buffer *buffer, struct d3d10_device *devi
return
hr
;
}
buffer
->
device
=
&
device
->
ID3D10Device1_iface
;
ID3D10Device1_AddRef
(
buffer
->
device
);
return
S_OK
;
}
dlls/d3d10core/d3d10core_private.h
View file @
82fc81b6
...
...
@@ -108,6 +108,7 @@ struct d3d10_buffer
LONG
refcount
;
struct
wined3d_buffer
*
wined3d_buffer
;
ID3D10Device1
*
device
;
};
HRESULT
d3d10_buffer_init
(
struct
d3d10_buffer
*
buffer
,
struct
d3d10_device
*
device
,
...
...
dlls/d3d10core/tests/device.c
View file @
82fc81b6
...
...
@@ -260,12 +260,12 @@ static void test_create_rendertarget_view(void)
{
D3D10_RENDER_TARGET_VIEW_DESC
rtv_desc
;
D3D10_TEXTURE2D_DESC
texture_desc
;
ULONG
refcount
,
expected_refcount
;
D3D10_BUFFER_DESC
buffer_desc
;
ID3D10RenderTargetView
*
rtview
;
ID3D10Device
*
device
,
*
tmp
;
ID3D10Texture2D
*
texture
;
ID3D10Buffer
*
buffer
;
ID3D10Device
*
device
;
ULONG
refcount
;
HRESULT
hr
;
if
(
!
(
device
=
create_device
()))
...
...
@@ -280,8 +280,18 @@ static void test_create_rendertarget_view(void)
buffer_desc
.
CPUAccessFlags
=
0
;
buffer_desc
.
MiscFlags
=
0
;
expected_refcount
=
get_refcount
((
IUnknown
*
)
device
)
+
1
;
hr
=
ID3D10Device_CreateBuffer
(
device
,
&
buffer_desc
,
NULL
,
&
buffer
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create a buffer, hr %#x
\n
"
,
hr
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
>=
expected_refcount
,
"Got unexpected refcount %u, expected >= %u.
\n
"
,
refcount
,
expected_refcount
);
tmp
=
NULL
;
expected_refcount
=
refcount
+
1
;
ID3D10Buffer_GetDevice
(
buffer
,
&
tmp
);
ok
(
tmp
==
device
,
"Got unexpected device %p, expected %p.
\n
"
,
tmp
,
device
);
refcount
=
get_refcount
((
IUnknown
*
)
device
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
ID3D10Device_Release
(
tmp
);
rtv_desc
.
Format
=
DXGI_FORMAT_R32G32B32A32_FLOAT
;
rtv_desc
.
ViewDimension
=
D3D10_RTV_DIMENSION_BUFFER
;
...
...
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