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
469eba24
Commit
469eba24
authored
Jun 16, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Implement IDirect3DVertexBuffer9 private data handling on top of wined3d_resource.
parent
45a0e959
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
43 additions
and
27 deletions
+43
-27
buffer.c
dlls/d3d9/buffer.c
+17
-5
buffer.c
dlls/wined3d/buffer.c
+3
-3
resource.c
dlls/wined3d/resource.c
+6
-5
surface.c
dlls/wined3d/surface.c
+3
-3
texture.c
dlls/wined3d/texture.c
+3
-3
volume.c
dlls/wined3d/volume.c
+3
-3
wined3d.spec
dlls/wined3d/wined3d.spec
+3
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-5
wined3d.h
include/wine/wined3d.h
+5
-0
No files found.
dlls/d3d9/buffer.c
View file @
469eba24
...
...
@@ -23,6 +23,11 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d9
);
static
inline
IDirect3DVertexBuffer9Impl
*
impl_from_IDirect3DVertexBuffer9
(
IDirect3DVertexBuffer9
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DVertexBuffer9Impl
,
lpVtbl
);
}
static
HRESULT
WINAPI
d3d9_vertexbuffer_QueryInterface
(
IDirect3DVertexBuffer9
*
iface
,
REFIID
riid
,
void
**
object
)
{
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
...
...
@@ -97,14 +102,16 @@ static HRESULT WINAPI d3d9_vertexbuffer_GetDevice(IDirect3DVertexBuffer9 *iface,
static
HRESULT
WINAPI
d3d9_vertexbuffer_SetPrivateData
(
IDirect3DVertexBuffer9
*
iface
,
REFGUID
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
{
IDirect3DVertexBuffer9Impl
*
buffer
=
impl_from_IDirect3DVertexBuffer9
(
iface
);
struct
wined3d_resource
*
resource
;
HRESULT
hr
;
TRACE
(
"iface %p, guid %s, data %p, data_size %u, flags %#x.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data
,
data_size
,
flags
);
wined3d_mutex_lock
();
hr
=
wined3d_buffer_set_private_data
(((
IDirect3DVertexBuffer9Impl
*
)
iface
)
->
wineD3DVertexBuffer
,
guid
,
data
,
data_size
,
flags
);
resource
=
wined3d_buffer_get_resource
(
buffer
->
wineD3DVertexBuffer
);
hr
=
wined3d_resource_set_private_data
(
resource
,
guid
,
data
,
data_size
,
flags
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -113,14 +120,16 @@ static HRESULT WINAPI d3d9_vertexbuffer_SetPrivateData(IDirect3DVertexBuffer9 *i
static
HRESULT
WINAPI
d3d9_vertexbuffer_GetPrivateData
(
IDirect3DVertexBuffer9
*
iface
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
{
IDirect3DVertexBuffer9Impl
*
buffer
=
impl_from_IDirect3DVertexBuffer9
(
iface
);
struct
wined3d_resource
*
resource
;
HRESULT
hr
;
TRACE
(
"iface %p, guid %s, data %p, data_size %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data
,
data_size
);
wined3d_mutex_lock
();
hr
=
wined3d_buffer_get_private_data
(((
IDirect3DVertexBuffer9Impl
*
)
iface
)
->
wineD3DVertexBuffer
,
guid
,
data
,
data_size
);
resource
=
wined3d_buffer_get_resource
(
buffer
->
wineD3DVertexBuffer
);
hr
=
wined3d_resource_get_private_data
(
resource
,
guid
,
data
,
data_size
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -128,12 +137,15 @@ static HRESULT WINAPI d3d9_vertexbuffer_GetPrivateData(IDirect3DVertexBuffer9 *i
static
HRESULT
WINAPI
d3d9_vertexbuffer_FreePrivateData
(
IDirect3DVertexBuffer9
*
iface
,
REFGUID
guid
)
{
IDirect3DVertexBuffer9Impl
*
buffer
=
impl_from_IDirect3DVertexBuffer9
(
iface
);
struct
wined3d_resource
*
resource
;
HRESULT
hr
;
TRACE
(
"iface %p, guid %s.
\n
"
,
iface
,
debugstr_guid
(
guid
));
wined3d_mutex_lock
();
hr
=
wined3d_buffer_free_private_data
(((
IDirect3DVertexBuffer9Impl
*
)
iface
)
->
wineD3DVertexBuffer
,
guid
);
resource
=
wined3d_buffer_get_resource
(
buffer
->
wineD3DVertexBuffer
);
hr
=
wined3d_resource_free_private_data
(
resource
,
guid
);
wined3d_mutex_unlock
();
return
hr
;
...
...
dlls/wined3d/buffer.c
View file @
469eba24
...
...
@@ -588,18 +588,18 @@ void * CDECL wined3d_buffer_get_parent(const struct wined3d_buffer *buffer)
HRESULT
CDECL
wined3d_buffer_set_private_data
(
struct
wined3d_buffer
*
buffer
,
REFGUID
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
{
return
resource_set_private_data
(
&
buffer
->
resource
,
guid
,
data
,
data_size
,
flags
);
return
wined3d_
resource_set_private_data
(
&
buffer
->
resource
,
guid
,
data
,
data_size
,
flags
);
}
HRESULT
CDECL
wined3d_buffer_get_private_data
(
const
struct
wined3d_buffer
*
buffer
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
{
return
resource_get_private_data
(
&
buffer
->
resource
,
guid
,
data
,
data_size
);
return
wined3d_
resource_get_private_data
(
&
buffer
->
resource
,
guid
,
data
,
data_size
);
}
HRESULT
CDECL
wined3d_buffer_free_private_data
(
struct
wined3d_buffer
*
buffer
,
REFGUID
guid
)
{
return
resource_free_private_data
(
&
buffer
->
resource
,
guid
);
return
wined3d_
resource_free_private_data
(
&
buffer
->
resource
,
guid
);
}
DWORD
CDECL
wined3d_buffer_set_priority
(
struct
wined3d_buffer
*
buffer
,
DWORD
priority
)
...
...
dlls/wined3d/resource.c
View file @
469eba24
...
...
@@ -158,7 +158,7 @@ void resource_cleanup(struct wined3d_resource *resource)
LIST_FOR_EACH_SAFE
(
e1
,
e2
,
&
resource
->
privateData
)
{
data
=
LIST_ENTRY
(
e1
,
struct
private_data
,
entry
);
hr
=
resource_free_private_data
(
resource
,
&
data
->
tag
);
hr
=
wined3d_
resource_free_private_data
(
resource
,
&
data
->
tag
);
if
(
FAILED
(
hr
))
ERR
(
"Failed to free private data when destroying resource %p, hr = %#x.
\n
"
,
resource
,
hr
);
}
...
...
@@ -195,7 +195,7 @@ static struct private_data *resource_find_private_data(const struct wined3d_reso
return
NULL
;
}
HRESULT
resource_set_private_data
(
struct
wined3d_resource
*
resource
,
REFGUID
guid
,
HRESULT
CDECL
wined3d_
resource_set_private_data
(
struct
wined3d_resource
*
resource
,
REFGUID
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
{
struct
private_data
*
d
;
...
...
@@ -203,7 +203,7 @@ HRESULT resource_set_private_data(struct wined3d_resource *resource, REFGUID gui
TRACE
(
"resource %p, riid %s, data %p, data_size %u, flags %#x.
\n
"
,
resource
,
debugstr_guid
(
guid
),
data
,
data_size
,
flags
);
resource_free_private_data
(
resource
,
guid
);
wined3d_
resource_free_private_data
(
resource
,
guid
);
d
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
d
));
if
(
!
d
)
return
E_OUTOFMEMORY
;
...
...
@@ -239,7 +239,8 @@ HRESULT resource_set_private_data(struct wined3d_resource *resource, REFGUID gui
return
WINED3D_OK
;
}
HRESULT
resource_get_private_data
(
const
struct
wined3d_resource
*
resource
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
HRESULT
CDECL
wined3d_resource_get_private_data
(
const
struct
wined3d_resource
*
resource
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
{
const
struct
private_data
*
d
;
...
...
@@ -273,7 +274,7 @@ HRESULT resource_get_private_data(const struct wined3d_resource *resource, REFGU
return
WINED3D_OK
;
}
HRESULT
resource_free_private_data
(
struct
wined3d_resource
*
resource
,
REFGUID
guid
)
HRESULT
CDECL
wined3d_
resource_free_private_data
(
struct
wined3d_resource
*
resource
,
REFGUID
guid
)
{
struct
private_data
*
data
;
...
...
dlls/wined3d/surface.c
View file @
469eba24
...
...
@@ -2707,18 +2707,18 @@ ULONG CDECL wined3d_surface_decref(struct wined3d_surface *surface)
HRESULT
CDECL
wined3d_surface_set_private_data
(
struct
wined3d_surface
*
surface
,
REFGUID
riid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
{
return
resource_set_private_data
(
&
surface
->
resource
,
riid
,
data
,
data_size
,
flags
);
return
wined3d_
resource_set_private_data
(
&
surface
->
resource
,
riid
,
data
,
data_size
,
flags
);
}
HRESULT
CDECL
wined3d_surface_get_private_data
(
const
struct
wined3d_surface
*
surface
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
{
return
resource_get_private_data
(
&
surface
->
resource
,
guid
,
data
,
data_size
);
return
wined3d_
resource_get_private_data
(
&
surface
->
resource
,
guid
,
data
,
data_size
);
}
HRESULT
CDECL
wined3d_surface_free_private_data
(
struct
wined3d_surface
*
surface
,
REFGUID
refguid
)
{
return
resource_free_private_data
(
&
surface
->
resource
,
refguid
);
return
wined3d_
resource_free_private_data
(
&
surface
->
resource
,
refguid
);
}
DWORD
CDECL
wined3d_surface_set_priority
(
struct
wined3d_surface
*
surface
,
DWORD
priority
)
...
...
dlls/wined3d/texture.c
View file @
469eba24
...
...
@@ -453,18 +453,18 @@ ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
HRESULT
CDECL
wined3d_texture_set_private_data
(
struct
wined3d_texture
*
texture
,
REFGUID
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
{
return
resource_set_private_data
(
&
texture
->
resource
,
guid
,
data
,
data_size
,
flags
);
return
wined3d_
resource_set_private_data
(
&
texture
->
resource
,
guid
,
data
,
data_size
,
flags
);
}
HRESULT
CDECL
wined3d_texture_get_private_data
(
const
struct
wined3d_texture
*
texture
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
{
return
resource_get_private_data
(
&
texture
->
resource
,
guid
,
data
,
data_size
);
return
wined3d_
resource_get_private_data
(
&
texture
->
resource
,
guid
,
data
,
data_size
);
}
HRESULT
CDECL
wined3d_texture_free_private_data
(
struct
wined3d_texture
*
texture
,
REFGUID
guid
)
{
return
resource_free_private_data
(
&
texture
->
resource
,
guid
);
return
wined3d_
resource_free_private_data
(
&
texture
->
resource
,
guid
);
}
DWORD
CDECL
wined3d_texture_set_priority
(
struct
wined3d_texture
*
texture
,
DWORD
priority
)
...
...
dlls/wined3d/volume.c
View file @
469eba24
...
...
@@ -176,18 +176,18 @@ void * CDECL wined3d_volume_get_parent(const struct wined3d_volume *volume)
HRESULT
CDECL
wined3d_volume_set_private_data
(
struct
wined3d_volume
*
volume
,
REFGUID
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
{
return
resource_set_private_data
(
&
volume
->
resource
,
guid
,
data
,
data_size
,
flags
);
return
wined3d_
resource_set_private_data
(
&
volume
->
resource
,
guid
,
data
,
data_size
,
flags
);
}
HRESULT
CDECL
wined3d_volume_get_private_data
(
const
struct
wined3d_volume
*
volume
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
{
return
resource_get_private_data
(
&
volume
->
resource
,
guid
,
data
,
data_size
);
return
wined3d_
resource_get_private_data
(
&
volume
->
resource
,
guid
,
data
,
data_size
);
}
HRESULT
CDECL
wined3d_volume_free_private_data
(
struct
wined3d_volume
*
volume
,
REFGUID
guid
)
{
return
resource_free_private_data
(
&
volume
->
resource
,
guid
);
return
wined3d_
resource_free_private_data
(
&
volume
->
resource
,
guid
);
}
DWORD
CDECL
wined3d_volume_set_priority
(
struct
wined3d_volume
*
volume
,
DWORD
priority
)
...
...
dlls/wined3d/wined3d.spec
View file @
469eba24
...
...
@@ -180,8 +180,11 @@
@ cdecl wined3d_query_incref(ptr)
@ cdecl wined3d_query_issue(ptr long)
@ cdecl wined3d_resource_free_private_data(ptr ptr)
@ cdecl wined3d_resource_get_desc(ptr ptr)
@ cdecl wined3d_resource_get_parent(ptr)
@ cdecl wined3d_resource_get_private_data(ptr ptr ptr ptr)
@ cdecl wined3d_resource_set_private_data(ptr ptr ptr long long)
@ cdecl wined3d_rendertarget_view_create(ptr ptr ptr)
@ cdecl wined3d_rendertarget_view_decref(ptr)
...
...
dlls/wined3d/wined3d_private.h
View file @
469eba24
...
...
@@ -1850,10 +1850,7 @@ struct wined3d_resource
};
void
resource_cleanup
(
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
HRESULT
resource_free_private_data
(
struct
wined3d_resource
*
resource
,
REFGUID
guid
)
DECLSPEC_HIDDEN
;
DWORD
resource_get_priority
(
const
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
HRESULT
resource_get_private_data
(
const
struct
wined3d_resource
*
resource
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
DECLSPEC_HIDDEN
;
HRESULT
resource_init
(
struct
wined3d_resource
*
resource
,
struct
wined3d_device
*
device
,
WINED3DRESOURCETYPE
resource_type
,
const
struct
wined3d_format
*
format
,
WINED3DMULTISAMPLE_TYPE
multisample_type
,
UINT
multisample_quality
,
...
...
@@ -1861,8 +1858,6 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
const
struct
wined3d_resource_ops
*
resource_ops
)
DECLSPEC_HIDDEN
;
DWORD
resource_set_priority
(
struct
wined3d_resource
*
resource
,
DWORD
priority
)
DECLSPEC_HIDDEN
;
HRESULT
resource_set_private_data
(
struct
wined3d_resource
*
resource
,
REFGUID
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
void
resource_unload
(
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
/* Tests show that the start address of resources is 32 byte aligned */
...
...
include/wine/wined3d.h
View file @
469eba24
...
...
@@ -2375,9 +2375,14 @@ WINED3DQUERYTYPE __cdecl wined3d_query_get_type(const struct wined3d_query *quer
ULONG
__cdecl
wined3d_query_incref
(
struct
wined3d_query
*
query
);
HRESULT
__cdecl
wined3d_query_issue
(
struct
wined3d_query
*
query
,
DWORD
flags
);
HRESULT
__cdecl
wined3d_resource_free_private_data
(
struct
wined3d_resource
*
resource
,
REFGUID
guid
);
void
__cdecl
wined3d_resource_get_desc
(
const
struct
wined3d_resource
*
resource
,
struct
wined3d_resource_desc
*
desc
);
void
*
__cdecl
wined3d_resource_get_parent
(
const
struct
wined3d_resource
*
resource
);
HRESULT
__cdecl
wined3d_resource_get_private_data
(
const
struct
wined3d_resource
*
resource
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
);
HRESULT
__cdecl
wined3d_resource_set_private_data
(
struct
wined3d_resource
*
resource
,
REFGUID
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
);
HRESULT
__cdecl
wined3d_rendertarget_view_create
(
struct
wined3d_resource
*
resource
,
void
*
parent
,
struct
wined3d_rendertarget_view
**
rendertarget_view
);
...
...
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