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
1db2bdcf
Commit
1db2bdcf
authored
Mar 21, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Use the private store api for buffers.
parent
97b55258
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
54 deletions
+81
-54
buffer.c
dlls/d3d8/buffer.c
+6
-54
d3d8_main.c
dlls/d3d8/d3d8_main.c
+69
-0
d3d8_private.h
dlls/d3d8/d3d8_private.h
+6
-0
No files found.
dlls/d3d8/buffer.c
View file @
1db2bdcf
...
...
@@ -104,52 +104,28 @@ static HRESULT WINAPI d3d8_vertexbuffer_SetPrivateData(IDirect3DVertexBuffer8 *i
REFGUID
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
{
struct
d3d8_vertexbuffer
*
buffer
=
impl_from_IDirect3DVertexBuffer8
(
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
d3d8_resource_set_private_data
(
&
buffer
->
resource
,
guid
,
data
,
data_size
,
flags
);
}
static
HRESULT
WINAPI
d3d8_vertexbuffer_GetPrivateData
(
IDirect3DVertexBuffer8
*
iface
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
{
struct
d3d8_vertexbuffer
*
buffer
=
impl_from_IDirect3DVertexBuffer8
(
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
d3d8_resource_get_private_data
(
&
buffer
->
resource
,
guid
,
data
,
data_size
);
}
static
HRESULT
WINAPI
d3d8_vertexbuffer_FreePrivateData
(
IDirect3DVertexBuffer8
*
iface
,
REFGUID
guid
)
{
struct
d3d8_vertexbuffer
*
buffer
=
impl_from_IDirect3DVertexBuffer8
(
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
d3d8_resource_free_private_data
(
&
buffer
->
resource
,
guid
);
}
static
DWORD
WINAPI
d3d8_vertexbuffer_SetPriority
(
IDirect3DVertexBuffer8
*
iface
,
DWORD
priority
)
...
...
@@ -401,52 +377,28 @@ static HRESULT WINAPI d3d8_indexbuffer_SetPrivateData(IDirect3DIndexBuffer8 *ifa
REFGUID
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
{
struct
d3d8_indexbuffer
*
buffer
=
impl_from_IDirect3DIndexBuffer8
(
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
d3d8_resource_set_private_data
(
&
buffer
->
resource
,
guid
,
data
,
data_size
,
flags
);
}
static
HRESULT
WINAPI
d3d8_indexbuffer_GetPrivateData
(
IDirect3DIndexBuffer8
*
iface
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
{
struct
d3d8_indexbuffer
*
buffer
=
impl_from_IDirect3DIndexBuffer8
(
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
d3d8_resource_get_private_data
(
&
buffer
->
resource
,
guid
,
data
,
data_size
);
}
static
HRESULT
WINAPI
d3d8_indexbuffer_FreePrivateData
(
IDirect3DIndexBuffer8
*
iface
,
REFGUID
guid
)
{
struct
d3d8_indexbuffer
*
buffer
=
impl_from_IDirect3DIndexBuffer8
(
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
d3d8_resource_free_private_data
(
&
buffer
->
resource
,
guid
);
}
static
DWORD
WINAPI
d3d8_indexbuffer_SetPriority
(
IDirect3DIndexBuffer8
*
iface
,
DWORD
priority
)
...
...
dlls/d3d8/d3d8_main.c
View file @
1db2bdcf
...
...
@@ -140,9 +140,78 @@ HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL bo
void
d3d8_resource_cleanup
(
struct
d3d8_resource
*
resource
)
{
wined3d_private_store_cleanup
(
&
resource
->
private_store
);
}
HRESULT
d3d8_resource_free_private_data
(
struct
d3d8_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
d3d8_resource_get_private_data
(
struct
d3d8_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
d3d8_resource_init
(
struct
d3d8_resource
*
resource
)
{
resource
->
refcount
=
1
;
wined3d_private_store_init
(
&
resource
->
private_store
);
}
HRESULT
d3d8_resource_set_private_data
(
struct
d3d8_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/d3d8/d3d8_private.h
View file @
1db2bdcf
...
...
@@ -177,10 +177,16 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wine
struct
d3d8_resource
{
LONG
refcount
;
struct
wined3d_private_store
private_store
;
};
void
d3d8_resource_cleanup
(
struct
d3d8_resource
*
resource
)
DECLSPEC_HIDDEN
;
HRESULT
d3d8_resource_free_private_data
(
struct
d3d8_resource
*
resource
,
const
GUID
*
guid
)
DECLSPEC_HIDDEN
;
HRESULT
d3d8_resource_get_private_data
(
struct
d3d8_resource
*
resource
,
const
GUID
*
guid
,
void
*
data
,
DWORD
*
data_size
)
DECLSPEC_HIDDEN
;
void
d3d8_resource_init
(
struct
d3d8_resource
*
resource
)
DECLSPEC_HIDDEN
;
HRESULT
d3d8_resource_set_private_data
(
struct
d3d8_resource
*
resource
,
const
GUID
*
guid
,
const
void
*
data
,
DWORD
data_size
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
struct
d3d8_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