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
f2b5bf26
Commit
f2b5bf26
authored
Mar 24, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Use the private store api for buffers.
parent
96a74e0c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
54 deletions
+81
-54
buffer.c
dlls/d3d9/buffer.c
+6
-54
d3d9_main.c
dlls/d3d9/d3d9_main.c
+69
-0
d3d9_private.h
dlls/d3d9/d3d9_private.h
+6
-0
No files found.
dlls/d3d9/buffer.c
View file @
f2b5bf26
...
...
@@ -105,52 +105,28 @@ static HRESULT WINAPI d3d9_vertexbuffer_SetPrivateData(IDirect3DVertexBuffer9 *i
REFGUID
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
{
struct
d3d9_vertexbuffer
*
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
();
resource
=
wined3d_buffer_get_resource
(
buffer
->
wined3d_buffer
);
hr
=
wined3d_resource_set_private_data
(
resource
,
guid
,
data
,
data_size
,
flags
);
wined3d_mutex_unlock
();
return
hr
;
return
d3d9_resource_set_private_data
(
&
buffer
->
resource
,
guid
,
data
,
data_size
,
flags
);
}
static
HRESULT
WINAPI
d3d9_vertexbuffer_GetPrivateData
(
IDirect3DVertexBuffer9
*
iface
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
{
struct
d3d9_vertexbuffer
*
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
();
resource
=
wined3d_buffer_get_resource
(
buffer
->
wined3d_buffer
);
hr
=
wined3d_resource_get_private_data
(
resource
,
guid
,
data
,
data_size
);
wined3d_mutex_unlock
();
return
hr
;
return
d3d9_resource_get_private_data
(
&
buffer
->
resource
,
guid
,
data
,
data_size
);
}
static
HRESULT
WINAPI
d3d9_vertexbuffer_FreePrivateData
(
IDirect3DVertexBuffer9
*
iface
,
REFGUID
guid
)
{
struct
d3d9_vertexbuffer
*
buffer
=
impl_from_IDirect3DVertexBuffer9
(
iface
);
struct
wined3d_resource
*
resource
;
HRESULT
hr
;
TRACE
(
"iface %p, guid %s.
\n
"
,
iface
,
debugstr_guid
(
guid
));
wined3d_mutex_lock
();
resource
=
wined3d_buffer_get_resource
(
buffer
->
wined3d_buffer
);
hr
=
wined3d_resource_free_private_data
(
resource
,
guid
);
wined3d_mutex_unlock
();
return
hr
;
return
d3d9_resource_free_private_data
(
&
buffer
->
resource
,
guid
);
}
static
DWORD
WINAPI
d3d9_vertexbuffer_SetPriority
(
IDirect3DVertexBuffer9
*
iface
,
DWORD
priority
)
...
...
@@ -401,52 +377,28 @@ static HRESULT WINAPI d3d9_indexbuffer_SetPrivateData(IDirect3DIndexBuffer9 *ifa
REFGUID
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
{
struct
d3d9_indexbuffer
*
buffer
=
impl_from_IDirect3DIndexBuffer9
(
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
();
resource
=
wined3d_buffer_get_resource
(
buffer
->
wined3d_buffer
);
hr
=
wined3d_resource_set_private_data
(
resource
,
guid
,
data
,
data_size
,
flags
);
wined3d_mutex_unlock
();
return
hr
;
return
d3d9_resource_set_private_data
(
&
buffer
->
resource
,
guid
,
data
,
data_size
,
flags
);
}
static
HRESULT
WINAPI
d3d9_indexbuffer_GetPrivateData
(
IDirect3DIndexBuffer9
*
iface
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
{
struct
d3d9_indexbuffer
*
buffer
=
impl_from_IDirect3DIndexBuffer9
(
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
();
resource
=
wined3d_buffer_get_resource
(
buffer
->
wined3d_buffer
);
hr
=
wined3d_resource_get_private_data
(
resource
,
guid
,
data
,
data_size
);
wined3d_mutex_unlock
();
return
hr
;
return
d3d9_resource_get_private_data
(
&
buffer
->
resource
,
guid
,
data
,
data_size
);
}
static
HRESULT
WINAPI
d3d9_indexbuffer_FreePrivateData
(
IDirect3DIndexBuffer9
*
iface
,
REFGUID
guid
)
{
struct
d3d9_indexbuffer
*
buffer
=
impl_from_IDirect3DIndexBuffer9
(
iface
);
struct
wined3d_resource
*
resource
;
HRESULT
hr
;
TRACE
(
"iface %p, guid %s.
\n
"
,
iface
,
debugstr_guid
(
guid
));
wined3d_mutex_lock
();
resource
=
wined3d_buffer_get_resource
(
buffer
->
wined3d_buffer
);
hr
=
wined3d_resource_free_private_data
(
resource
,
guid
);
wined3d_mutex_unlock
();
return
hr
;
return
d3d9_resource_free_private_data
(
&
buffer
->
resource
,
guid
);
}
static
DWORD
WINAPI
d3d9_indexbuffer_SetPriority
(
IDirect3DIndexBuffer9
*
iface
,
DWORD
priority
)
...
...
dlls/d3d9/d3d9_main.c
View file @
f2b5bf26
...
...
@@ -165,9 +165,78 @@ void WINAPI D3DPERF_SetRegion(D3DCOLOR color, const WCHAR *name)
void
d3d9_resource_cleanup
(
struct
d3d9_resource
*
resource
)
{
wined3d_private_store_cleanup
(
&
resource
->
private_store
);
}
HRESULT
d3d9_resource_free_private_data
(
struct
d3d9_resource
*
resource
,
const
GUID
*
guid
)
{
struct
wined3d_private_data
*
entry
;
wined3d_mutex_lock
();
entry
=
wined3d_private_store_get_private_data
(
&
resource
->
private_store
,
guid
);
if
(
!
entry
)
{
wined3d_mutex_unlock
();
return
D3DERR_NOTFOUND
;
}
wined3d_private_store_free_private_data
(
&
resource
->
private_store
,
entry
);
wined3d_mutex_unlock
();
return
D3D_OK
;
}
HRESULT
d3d9_resource_get_private_data
(
struct
d3d9_resource
*
resource
,
const
GUID
*
guid
,
void
*
data
,
DWORD
*
data_size
)
{
const
struct
wined3d_private_data
*
stored_data
;
DWORD
size_in
;
HRESULT
hr
;
wined3d_mutex_lock
();
stored_data
=
wined3d_private_store_get_private_data
(
&
resource
->
private_store
,
guid
);
if
(
!
stored_data
)
{
hr
=
D3DERR_NOTFOUND
;
goto
done
;
}
size_in
=
*
data_size
;
*
data_size
=
stored_data
->
size
;
if
(
!
data
)
{
hr
=
D3D_OK
;
goto
done
;
}
if
(
size_in
<
stored_data
->
size
)
{
hr
=
D3DERR_MOREDATA
;
goto
done
;
}
if
(
stored_data
->
flags
&
WINED3DSPD_IUNKNOWN
)
IUnknown_AddRef
(
stored_data
->
content
.
object
);
memcpy
(
data
,
stored_data
->
content
.
data
,
stored_data
->
size
);
hr
=
D3D_OK
;
done:
wined3d_mutex_unlock
();
return
hr
;
}
void
d3d9_resource_init
(
struct
d3d9_resource
*
resource
)
{
resource
->
refcount
=
1
;
wined3d_private_store_init
(
&
resource
->
private_store
);
}
HRESULT
d3d9_resource_set_private_data
(
struct
d3d9_resource
*
resource
,
const
GUID
*
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
{
HRESULT
hr
;
wined3d_mutex_lock
();
hr
=
wined3d_private_store_set_private_data
(
&
resource
->
private_store
,
guid
,
data
,
data_size
,
flags
);
wined3d_mutex_unlock
();
return
hr
;
}
dlls/d3d9/d3d9_private.h
View file @
f2b5bf26
...
...
@@ -169,10 +169,16 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wine
struct
d3d9_resource
{
LONG
refcount
;
struct
wined3d_private_store
private_store
;
};
void
d3d9_resource_cleanup
(
struct
d3d9_resource
*
resource
)
DECLSPEC_HIDDEN
;
HRESULT
d3d9_resource_free_private_data
(
struct
d3d9_resource
*
resource
,
const
GUID
*
guid
)
DECLSPEC_HIDDEN
;
HRESULT
d3d9_resource_get_private_data
(
struct
d3d9_resource
*
resource
,
const
GUID
*
guid
,
void
*
data
,
DWORD
*
data_size
)
DECLSPEC_HIDDEN
;
void
d3d9_resource_init
(
struct
d3d9_resource
*
resource
)
DECLSPEC_HIDDEN
;
HRESULT
d3d9_resource_set_private_data
(
struct
d3d9_resource
*
resource
,
const
GUID
*
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
struct
d3d9_volume
{
...
...
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