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
0a9ac7e9
Commit
0a9ac7e9
authored
Apr 15, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: COM cleanup for the ID3D10Buffer interface.
parent
bcd85854
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
25 deletions
+40
-25
buffer.c
dlls/d3d10core/buffer.c
+30
-17
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+4
-1
device.c
dlls/d3d10core/device.c
+6
-4
inputlayout.c
dlls/d3d10core/inputlayout.c
+0
-1
shader.c
dlls/d3d10core/shader.c
+0
-1
view.c
dlls/d3d10core/view.c
+0
-1
No files found.
dlls/d3d10core/buffer.c
View file @
0a9ac7e9
...
@@ -24,11 +24,16 @@
...
@@ -24,11 +24,16 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d10core
);
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d10core
);
static
inline
struct
d3d10_buffer
*
impl_from_ID3D10Buffer
(
ID3D10Buffer
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d3d10_buffer
,
ID3D10Buffer_iface
);
}
/* IUnknown methods */
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
d3d10_buffer_QueryInterface
(
ID3D10Buffer
*
iface
,
REFIID
riid
,
void
**
o
bjec
t
)
static
HRESULT
STDMETHODCALLTYPE
d3d10_buffer_QueryInterface
(
ID3D10Buffer
*
iface
,
REFIID
riid
,
void
**
o
u
t
)
{
{
TRACE
(
"iface %p, riid %s, o
bject %p
\n
"
,
iface
,
debugstr_guid
(
riid
),
objec
t
);
TRACE
(
"iface %p, riid %s, o
ut %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
ou
t
);
if
(
IsEqualGUID
(
riid
,
&
IID_ID3D10Buffer
)
if
(
IsEqualGUID
(
riid
,
&
IID_ID3D10Buffer
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D10Resource
)
||
IsEqualGUID
(
riid
,
&
IID_ID3D10Resource
)
...
@@ -36,40 +41,38 @@ static HRESULT STDMETHODCALLTYPE d3d10_buffer_QueryInterface(ID3D10Buffer *iface
...
@@ -36,40 +41,38 @@ static HRESULT STDMETHODCALLTYPE d3d10_buffer_QueryInterface(ID3D10Buffer *iface
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
{
IUnknown_AddRef
(
iface
);
IUnknown_AddRef
(
iface
);
*
o
bjec
t
=
iface
;
*
o
u
t
=
iface
;
return
S_OK
;
return
S_OK
;
}
}
WARN
(
"%s not implemented, returning E_NOINTERFACE
\n
"
,
debugstr_guid
(
riid
));
WARN
(
"%s not implemented, returning E_NOINTERFACE
\n
"
,
debugstr_guid
(
riid
));
*
o
bjec
t
=
NULL
;
*
o
u
t
=
NULL
;
return
E_NOINTERFACE
;
return
E_NOINTERFACE
;
}
}
static
ULONG
STDMETHODCALLTYPE
d3d10_buffer_AddRef
(
ID3D10Buffer
*
iface
)
static
ULONG
STDMETHODCALLTYPE
d3d10_buffer_AddRef
(
ID3D10Buffer
*
iface
)
{
{
struct
d3d10_buffer
*
This
=
(
struct
d3d10_buffer
*
)
iface
;
struct
d3d10_buffer
*
buffer
=
impl_from_ID3D10Buffer
(
iface
)
;
ULONG
refcount
=
InterlockedIncrement
(
&
This
->
refcount
);
ULONG
refcount
=
InterlockedIncrement
(
&
buffer
->
refcount
);
TRACE
(
"%p increasing refcount to %u
\n
"
,
This
,
refcount
);
TRACE
(
"%p increasing refcount to %u
.
\n
"
,
buffer
,
refcount
);
if
(
refcount
==
1
)
if
(
refcount
==
1
)
wined3d_buffer_incref
(
This
->
wined3d_buffer
);
wined3d_buffer_incref
(
buffer
->
wined3d_buffer
);
return
refcount
;
return
refcount
;
}
}
static
ULONG
STDMETHODCALLTYPE
d3d10_buffer_Release
(
ID3D10Buffer
*
iface
)
static
ULONG
STDMETHODCALLTYPE
d3d10_buffer_Release
(
ID3D10Buffer
*
iface
)
{
{
struct
d3d10_buffer
*
This
=
(
struct
d3d10_buffer
*
)
iface
;
struct
d3d10_buffer
*
buffer
=
impl_from_ID3D10Buffer
(
iface
)
;
ULONG
refcount
=
InterlockedDecrement
(
&
This
->
refcount
);
ULONG
refcount
=
InterlockedDecrement
(
&
buffer
->
refcount
);
TRACE
(
"%p decreasing refcount to %u
\n
"
,
This
,
refcount
);
TRACE
(
"%p decreasing refcount to %u
.
\n
"
,
buffer
,
refcount
);
if
(
!
refcount
)
if
(
!
refcount
)
{
wined3d_buffer_decref
(
buffer
->
wined3d_buffer
);
wined3d_buffer_decref
(
This
->
wined3d_buffer
);
}
return
refcount
;
return
refcount
;
}
}
...
@@ -132,7 +135,7 @@ static UINT STDMETHODCALLTYPE d3d10_buffer_GetEvictionPriority(ID3D10Buffer *ifa
...
@@ -132,7 +135,7 @@ static UINT STDMETHODCALLTYPE d3d10_buffer_GetEvictionPriority(ID3D10Buffer *ifa
static
HRESULT
STDMETHODCALLTYPE
d3d10_buffer_Map
(
ID3D10Buffer
*
iface
,
D3D10_MAP
map_type
,
UINT
map_flags
,
void
**
data
)
static
HRESULT
STDMETHODCALLTYPE
d3d10_buffer_Map
(
ID3D10Buffer
*
iface
,
D3D10_MAP
map_type
,
UINT
map_flags
,
void
**
data
)
{
{
struct
d3d10_buffer
*
buffer
=
(
struct
d3d10_buffer
*
)
iface
;
struct
d3d10_buffer
*
buffer
=
impl_from_ID3D10Buffer
(
iface
)
;
TRACE
(
"iface %p, map_type %u, map_flags %#x, data %p.
\n
"
,
iface
,
map_type
,
map_flags
,
data
);
TRACE
(
"iface %p, map_type %u, map_flags %#x, data %p.
\n
"
,
iface
,
map_type
,
map_flags
,
data
);
...
@@ -146,9 +149,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_buffer_Map(ID3D10Buffer *iface, D3D10_MAP
...
@@ -146,9 +149,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_buffer_Map(ID3D10Buffer *iface, D3D10_MAP
static
void
STDMETHODCALLTYPE
d3d10_buffer_Unmap
(
ID3D10Buffer
*
iface
)
static
void
STDMETHODCALLTYPE
d3d10_buffer_Unmap
(
ID3D10Buffer
*
iface
)
{
{
struct
d3d10_buffer
*
buffer
=
impl_from_ID3D10Buffer
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_buffer_unmap
(
((
struct
d3d10_buffer
*
)
iface
)
->
wined3d_buffer
);
wined3d_buffer_unmap
(
buffer
->
wined3d_buffer
);
}
}
static
void
STDMETHODCALLTYPE
d3d10_buffer_GetDesc
(
ID3D10Buffer
*
iface
,
D3D10_BUFFER_DESC
*
desc
)
static
void
STDMETHODCALLTYPE
d3d10_buffer_GetDesc
(
ID3D10Buffer
*
iface
,
D3D10_BUFFER_DESC
*
desc
)
...
@@ -177,6 +182,14 @@ static const struct ID3D10BufferVtbl d3d10_buffer_vtbl =
...
@@ -177,6 +182,14 @@ static const struct ID3D10BufferVtbl d3d10_buffer_vtbl =
d3d10_buffer_GetDesc
,
d3d10_buffer_GetDesc
,
};
};
struct
d3d10_buffer
*
unsafe_impl_from_ID3D10Buffer
(
ID3D10Buffer
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
d3d10_buffer_vtbl
);
return
CONTAINING_RECORD
(
iface
,
struct
d3d10_buffer
,
ID3D10Buffer_iface
);
}
static
void
STDMETHODCALLTYPE
d3d10_buffer_wined3d_object_released
(
void
*
parent
)
static
void
STDMETHODCALLTYPE
d3d10_buffer_wined3d_object_released
(
void
*
parent
)
{
{
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
HeapFree
(
GetProcessHeap
(),
0
,
parent
);
...
@@ -193,7 +206,7 @@ HRESULT d3d10_buffer_init(struct d3d10_buffer *buffer, struct d3d10_device *devi
...
@@ -193,7 +206,7 @@ HRESULT d3d10_buffer_init(struct d3d10_buffer *buffer, struct d3d10_device *devi
struct
wined3d_buffer_desc
wined3d_desc
;
struct
wined3d_buffer_desc
wined3d_desc
;
HRESULT
hr
;
HRESULT
hr
;
buffer
->
v
tbl
=
&
d3d10_buffer_vtbl
;
buffer
->
ID3D10Buffer_iface
.
lpV
tbl
=
&
d3d10_buffer_vtbl
;
buffer
->
refcount
=
1
;
buffer
->
refcount
=
1
;
FIXME
(
"Implement DXGI<->wined3d usage conversion
\n
"
);
FIXME
(
"Implement DXGI<->wined3d usage conversion
\n
"
);
...
...
dlls/d3d10core/d3d10core_private.h
View file @
0a9ac7e9
...
@@ -21,6 +21,8 @@
...
@@ -21,6 +21,8 @@
#include "wine/debug.h"
#include "wine/debug.h"
#include <assert.h>
#define COBJMACROS
#define COBJMACROS
#include "winbase.h"
#include "winbase.h"
#include "wingdi.h"
#include "wingdi.h"
...
@@ -111,7 +113,7 @@ HRESULT d3d10_texture3d_init(struct d3d10_texture3d *texture, struct d3d10_devic
...
@@ -111,7 +113,7 @@ HRESULT d3d10_texture3d_init(struct d3d10_texture3d *texture, struct d3d10_devic
/* ID3D10Buffer */
/* ID3D10Buffer */
struct
d3d10_buffer
struct
d3d10_buffer
{
{
const
struct
ID3D10BufferVtbl
*
vtbl
;
ID3D10Buffer
ID3D10Buffer_iface
;
LONG
refcount
;
LONG
refcount
;
struct
wined3d_buffer
*
wined3d_buffer
;
struct
wined3d_buffer
*
wined3d_buffer
;
...
@@ -119,6 +121,7 @@ struct d3d10_buffer
...
@@ -119,6 +121,7 @@ struct d3d10_buffer
HRESULT
d3d10_buffer_init
(
struct
d3d10_buffer
*
buffer
,
struct
d3d10_device
*
device
,
HRESULT
d3d10_buffer_init
(
struct
d3d10_buffer
*
buffer
,
struct
d3d10_device
*
device
,
const
D3D10_BUFFER_DESC
*
desc
,
const
D3D10_SUBRESOURCE_DATA
*
data
)
DECLSPEC_HIDDEN
;
const
D3D10_BUFFER_DESC
*
desc
,
const
D3D10_SUBRESOURCE_DATA
*
data
)
DECLSPEC_HIDDEN
;
struct
d3d10_buffer
*
unsafe_impl_from_ID3D10Buffer
(
ID3D10Buffer
*
iface
)
DECLSPEC_HIDDEN
;
/* ID3D10DepthStencilView */
/* ID3D10DepthStencilView */
struct
d3d10_depthstencil_view
struct
d3d10_depthstencil_view
...
...
dlls/d3d10core/device.c
View file @
0a9ac7e9
...
@@ -203,9 +203,10 @@ static void STDMETHODCALLTYPE d3d10_device_IASetVertexBuffers(ID3D10Device *ifac
...
@@ -203,9 +203,10 @@ static void STDMETHODCALLTYPE d3d10_device_IASetVertexBuffers(ID3D10Device *ifac
for
(
i
=
0
;
i
<
buffer_count
;
++
i
)
for
(
i
=
0
;
i
<
buffer_count
;
++
i
)
{
{
struct
d3d10_buffer
*
buffer
=
unsafe_impl_from_ID3D10Buffer
(
buffers
[
i
]);
wined3d_device_set_stream_source
(
This
->
wined3d_device
,
start_slot
,
wined3d_device_set_stream_source
(
This
->
wined3d_device
,
start_slot
,
buffers
[
i
]
?
((
struct
d3d10_buffer
*
)
buffers
[
i
])
->
wined3d_buffer
:
NULL
,
buffer
?
buffer
->
wined3d_buffer
:
NULL
,
offsets
[
i
],
strides
[
i
]);
offsets
[
i
],
strides
[
i
]);
}
}
}
}
...
@@ -213,12 +214,13 @@ static void STDMETHODCALLTYPE d3d10_device_IASetIndexBuffer(ID3D10Device *iface,
...
@@ -213,12 +214,13 @@ static void STDMETHODCALLTYPE d3d10_device_IASetIndexBuffer(ID3D10Device *iface,
ID3D10Buffer
*
buffer
,
DXGI_FORMAT
format
,
UINT
offset
)
ID3D10Buffer
*
buffer
,
DXGI_FORMAT
format
,
UINT
offset
)
{
{
struct
d3d10_device
*
This
=
impl_from_ID3D10Device
(
iface
);
struct
d3d10_device
*
This
=
impl_from_ID3D10Device
(
iface
);
struct
d3d10_buffer
*
buffer_impl
=
unsafe_impl_from_ID3D10Buffer
(
buffer
);
TRACE
(
"iface %p, buffer %p, format %s, offset %u.
\n
"
,
TRACE
(
"iface %p, buffer %p, format %s, offset %u.
\n
"
,
iface
,
buffer
,
debug_dxgi_format
(
format
),
offset
);
iface
,
buffer
,
debug_dxgi_format
(
format
),
offset
);
wined3d_device_set_index_buffer
(
This
->
wined3d_device
,
wined3d_device_set_index_buffer
(
This
->
wined3d_device
,
buffer
?
((
struct
d3d10_buffer
*
)
buffer
)
->
wined3d_buffer
:
NULL
,
buffer
_impl
?
buffer_impl
->
wined3d_buffer
:
NULL
,
wined3dformat_from_dxgi_format
(
format
));
wined3dformat_from_dxgi_format
(
format
));
if
(
offset
)
FIXME
(
"offset %u not supported.
\n
"
,
offset
);
if
(
offset
)
FIXME
(
"offset %u not supported.
\n
"
,
offset
);
}
}
...
@@ -644,7 +646,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device *iface,
...
@@ -644,7 +646,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device *iface,
return
hr
;
return
hr
;
}
}
*
buffer
=
(
ID3D10Buffer
*
)
object
;
*
buffer
=
&
object
->
ID3D10Buffer_iface
;
TRACE
(
"Created ID3D10Buffer %p
\n
"
,
object
);
TRACE
(
"Created ID3D10Buffer %p
\n
"
,
object
);
...
...
dlls/d3d10core/inputlayout.c
View file @
0a9ac7e9
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
#include "config.h"
#include "config.h"
#include "wine/port.h"
#include "wine/port.h"
#include <assert.h>
#include "d3d10core_private.h"
#include "d3d10core_private.h"
...
...
dlls/d3d10core/shader.c
View file @
0a9ac7e9
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
#include "config.h"
#include "config.h"
#include "wine/port.h"
#include "wine/port.h"
#include <assert.h>
#include "d3d10core_private.h"
#include "d3d10core_private.h"
...
...
dlls/d3d10core/view.c
View file @
0a9ac7e9
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
#include "config.h"
#include "config.h"
#include "wine/port.h"
#include "wine/port.h"
#include <assert.h>
#define NONAMELESSUNION
#define NONAMELESSUNION
#include "d3d10core_private.h"
#include "d3d10core_private.h"
...
...
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