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
53165034
Commit
53165034
authored
Aug 10, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Unify resource preloads.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
850d38ef
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
42 additions
and
33 deletions
+42
-33
buffer.c
dlls/d3d8/buffer.c
+2
-2
texture.c
dlls/d3d8/texture.c
+3
-3
buffer.c
dlls/d3d9/buffer.c
+2
-2
surface.c
dlls/d3d9/surface.c
+1
-1
texture.c
dlls/d3d9/texture.c
+3
-3
device.c
dlls/ddraw/device.c
+1
-1
buffer.c
dlls/wined3d/buffer.c
+11
-9
resource.c
dlls/wined3d/resource.c
+5
-0
texture.c
dlls/wined3d/texture.c
+11
-8
wined3d.spec
dlls/wined3d/wined3d.spec
+1
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
wined3d.h
include/wine/wined3d.h
+1
-2
No files found.
dlls/d3d8/buffer.c
View file @
53165034
...
...
@@ -167,7 +167,7 @@ static void WINAPI d3d8_vertexbuffer_PreLoad(IDirect3DVertexBuffer8 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_
buffer_preload
(
buffer
->
wined3d_buffer
);
wined3d_
resource_preload
(
wined3d_buffer_get_resource
(
buffer
->
wined3d_buffer
)
);
wined3d_mutex_unlock
();
}
...
...
@@ -444,7 +444,7 @@ static void WINAPI d3d8_indexbuffer_PreLoad(IDirect3DIndexBuffer8 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_
buffer_preload
(
buffer
->
wined3d_buffer
);
wined3d_
resource_preload
(
wined3d_buffer_get_resource
(
buffer
->
wined3d_buffer
)
);
wined3d_mutex_unlock
();
}
...
...
dlls/d3d8/texture.c
View file @
53165034
...
...
@@ -187,7 +187,7 @@ static void WINAPI d3d8_texture_2d_PreLoad(IDirect3DTexture8 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_
texture_preload
(
texture
->
wined3d_texture
);
wined3d_
resource_preload
(
wined3d_texture_get_resource
(
texture
->
wined3d_texture
)
);
wined3d_mutex_unlock
();
}
...
...
@@ -533,7 +533,7 @@ static void WINAPI d3d8_texture_cube_PreLoad(IDirect3DCubeTexture8 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_
texture_preload
(
texture
->
wined3d_texture
);
wined3d_
resource_preload
(
wined3d_texture_get_resource
(
texture
->
wined3d_texture
)
);
wined3d_mutex_unlock
();
}
...
...
@@ -889,7 +889,7 @@ static void WINAPI d3d8_texture_3d_PreLoad(IDirect3DVolumeTexture8 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_
texture_preload
(
texture
->
wined3d_texture
);
wined3d_
resource_preload
(
wined3d_texture_get_resource
(
texture
->
wined3d_texture
)
);
wined3d_mutex_unlock
();
}
...
...
dlls/d3d9/buffer.c
View file @
53165034
...
...
@@ -168,7 +168,7 @@ static void WINAPI d3d9_vertexbuffer_PreLoad(IDirect3DVertexBuffer9 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_
buffer_preload
(
buffer
->
wined3d_buffer
);
wined3d_
resource_preload
(
wined3d_buffer_get_resource
(
buffer
->
wined3d_buffer
)
);
wined3d_mutex_unlock
();
}
...
...
@@ -444,7 +444,7 @@ static void WINAPI d3d9_indexbuffer_PreLoad(IDirect3DIndexBuffer9 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_
buffer_preload
(
buffer
->
wined3d_buffer
);
wined3d_
resource_preload
(
wined3d_buffer_get_resource
(
buffer
->
wined3d_buffer
)
);
wined3d_mutex_unlock
();
}
...
...
dlls/d3d9/surface.c
View file @
53165034
...
...
@@ -176,7 +176,7 @@ static void WINAPI d3d9_surface_PreLoad(IDirect3DSurface9 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_
texture_preload
(
surface
->
wined3d_texture
);
wined3d_
resource_preload
(
wined3d_texture_get_resource
(
surface
->
wined3d_texture
)
);
wined3d_mutex_unlock
();
}
...
...
dlls/d3d9/texture.c
View file @
53165034
...
...
@@ -189,7 +189,7 @@ static void WINAPI d3d9_texture_2d_PreLoad(IDirect3DTexture9 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_
texture_preload
(
texture
->
wined3d_texture
);
wined3d_
resource_preload
(
wined3d_texture_get_resource
(
texture
->
wined3d_texture
)
);
wined3d_mutex_unlock
();
}
...
...
@@ -578,7 +578,7 @@ static void WINAPI d3d9_texture_cube_PreLoad(IDirect3DCubeTexture9 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_
texture_preload
(
texture
->
wined3d_texture
);
wined3d_
resource_preload
(
wined3d_texture_get_resource
(
texture
->
wined3d_texture
)
);
wined3d_mutex_unlock
();
}
...
...
@@ -980,7 +980,7 @@ static void WINAPI d3d9_texture_3d_PreLoad(IDirect3DVolumeTexture9 *iface)
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_
texture_preload
(
texture
->
wined3d_texture
);
wined3d_
resource_preload
(
wined3d_texture_get_resource
(
texture
->
wined3d_texture
)
);
wined3d_mutex_unlock
();
}
...
...
dlls/ddraw/device.c
View file @
53165034
...
...
@@ -5656,7 +5656,7 @@ static HRESULT d3d_device7_PreLoad(IDirect3DDevice7 *iface, IDirectDrawSurface7
return
DDERR_INVALIDPARAMS
;
wined3d_mutex_lock
();
wined3d_
texture_preload
(
surface
->
wined3d_texture
);
wined3d_
resource_preload
(
wined3d_texture_get_resource
(
surface
->
wined3d_texture
)
);
wined3d_mutex_unlock
();
return
D3D_OK
;
...
...
dlls/wined3d/buffer.c
View file @
53165034
...
...
@@ -928,14 +928,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte
HeapFree
(
GetProcessHeap
(),
0
,
data
);
}
void
CDECL
wined3d_buffer_preload
(
struct
wined3d_buffer
*
buffer
)
{
struct
wined3d_context
*
context
;
context
=
context_acquire
(
buffer
->
resource
.
device
,
NULL
);
buffer_internal_preload
(
buffer
,
context
,
NULL
);
context_release
(
context
);
}
struct
wined3d_resource
*
CDECL
wined3d_buffer_get_resource
(
struct
wined3d_buffer
*
buffer
)
{
TRACE
(
"buffer %p.
\n
"
,
buffer
);
...
...
@@ -1108,7 +1100,7 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer)
}
else
if
(
buffer
->
flags
&
WINED3D_BUFFER_HASDESC
)
{
wined3d_
buffer_preload
(
buffer
);
wined3d_
resource_preload
(
&
buffer
->
resource
);
}
}
...
...
@@ -1225,6 +1217,15 @@ static ULONG buffer_resource_decref(struct wined3d_resource *resource)
return
wined3d_buffer_decref
(
buffer_from_resource
(
resource
));
}
static
void
buffer_resource_preload
(
struct
wined3d_resource
*
resource
)
{
struct
wined3d_context
*
context
;
context
=
context_acquire
(
resource
->
device
,
NULL
);
buffer_internal_preload
(
buffer_from_resource
(
resource
),
context
,
NULL
);
context_release
(
context
);
}
static
HRESULT
buffer_resource_sub_resource_map
(
struct
wined3d_resource
*
resource
,
unsigned
int
sub_resource_idx
,
struct
wined3d_map_desc
*
map_desc
,
const
struct
wined3d_box
*
box
,
DWORD
flags
)
{
...
...
@@ -1267,6 +1268,7 @@ static const struct wined3d_resource_ops buffer_resource_ops =
{
buffer_resource_incref
,
buffer_resource_decref
,
buffer_resource_preload
,
buffer_unload
,
buffer_resource_sub_resource_map
,
buffer_resource_sub_resource_unmap
,
...
...
dlls/wined3d/resource.c
View file @
53165034
...
...
@@ -327,6 +327,11 @@ HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned
return
resource
->
resource_ops
->
resource_sub_resource_unmap
(
resource
,
sub_resource_idx
);
}
void
CDECL
wined3d_resource_preload
(
struct
wined3d_resource
*
resource
)
{
resource
->
resource_ops
->
resource_preload
(
resource
);
}
BOOL
wined3d_resource_allocate_sysmem
(
struct
wined3d_resource
*
resource
)
{
void
**
p
;
...
...
dlls/wined3d/texture.c
View file @
53165034
...
...
@@ -947,14 +947,6 @@ void wined3d_texture_load(struct wined3d_texture *texture,
texture
->
flags
|=
flag
;
}
void
CDECL
wined3d_texture_preload
(
struct
wined3d_texture
*
texture
)
{
struct
wined3d_context
*
context
;
context
=
context_acquire
(
texture
->
resource
.
device
,
NULL
);
wined3d_texture_load
(
texture
,
context
,
texture
->
flags
&
WINED3D_TEXTURE_IS_SRGB
);
context_release
(
context
);
}
void
*
CDECL
wined3d_texture_get_parent
(
const
struct
wined3d_texture
*
texture
)
{
TRACE
(
"texture %p.
\n
"
,
texture
);
...
...
@@ -1580,6 +1572,16 @@ static ULONG texture_resource_decref(struct wined3d_resource *resource)
return
wined3d_texture_decref
(
texture_from_resource
(
resource
));
}
static
void
texture_resource_preload
(
struct
wined3d_resource
*
resource
)
{
struct
wined3d_texture
*
texture
=
texture_from_resource
(
resource
);
struct
wined3d_context
*
context
;
context
=
context_acquire
(
resource
->
device
,
NULL
);
wined3d_texture_load
(
texture
,
context
,
texture
->
flags
&
WINED3D_TEXTURE_IS_SRGB
);
context_release
(
context
);
}
static
void
wined3d_texture_unload
(
struct
wined3d_resource
*
resource
)
{
struct
wined3d_texture
*
texture
=
texture_from_resource
(
resource
);
...
...
@@ -1849,6 +1851,7 @@ static const struct wined3d_resource_ops texture_resource_ops =
{
texture_resource_incref
,
texture_resource_decref
,
texture_resource_preload
,
wined3d_texture_unload
,
texture_resource_sub_resource_map
,
texture_resource_sub_resource_unmap
,
...
...
dlls/wined3d/wined3d.spec
View file @
53165034
...
...
@@ -29,7 +29,6 @@
@ cdecl wined3d_buffer_get_resource(ptr)
@ cdecl wined3d_buffer_incref(ptr)
@ cdecl wined3d_buffer_map(ptr long long ptr long)
@ cdecl wined3d_buffer_preload(ptr)
@ cdecl wined3d_buffer_unmap(ptr)
@ cdecl wined3d_device_acquire_focus_window(ptr ptr)
...
...
@@ -188,6 +187,7 @@
@ cdecl wined3d_resource_get_parent(ptr)
@ cdecl wined3d_resource_get_priority(ptr)
@ cdecl wined3d_resource_map(ptr long ptr ptr long)
@ cdecl wined3d_resource_preload(ptr)
@ cdecl wined3d_resource_set_parent(ptr ptr)
@ cdecl wined3d_resource_set_priority(ptr long)
@ cdecl wined3d_resource_unmap(ptr long)
...
...
@@ -265,7 +265,6 @@
@ cdecl wined3d_texture_get_sub_resource_desc(ptr long ptr)
@ cdecl wined3d_texture_get_sub_resource_parent(ptr long)
@ cdecl wined3d_texture_incref(ptr)
@ cdecl wined3d_texture_preload(ptr)
@ cdecl wined3d_texture_release_dc(ptr long ptr)
@ cdecl wined3d_texture_set_autogen_filter_type(ptr long)
@ cdecl wined3d_texture_set_color_key(ptr long ptr)
...
...
dlls/wined3d/wined3d_private.h
View file @
53165034
...
...
@@ -2526,6 +2526,7 @@ struct wined3d_resource_ops
{
ULONG
(
*
resource_incref
)(
struct
wined3d_resource
*
resource
);
ULONG
(
*
resource_decref
)(
struct
wined3d_resource
*
resource
);
void
(
*
resource_preload
)(
struct
wined3d_resource
*
resource
);
void
(
*
resource_unload
)(
struct
wined3d_resource
*
resource
);
HRESULT
(
*
resource_sub_resource_map
)(
struct
wined3d_resource
*
resource
,
unsigned
int
sub_resource_idx
,
struct
wined3d_map_desc
*
map_desc
,
const
struct
wined3d_box
*
box
,
DWORD
flags
);
...
...
include/wine/wined3d.h
View file @
53165034
...
...
@@ -2133,7 +2133,6 @@ void * __cdecl wined3d_buffer_get_parent(const struct wined3d_buffer *buffer);
struct
wined3d_resource
*
__cdecl
wined3d_buffer_get_resource
(
struct
wined3d_buffer
*
buffer
);
ULONG
__cdecl
wined3d_buffer_incref
(
struct
wined3d_buffer
*
buffer
);
HRESULT
__cdecl
wined3d_buffer_map
(
struct
wined3d_buffer
*
buffer
,
UINT
offset
,
UINT
size
,
BYTE
**
data
,
DWORD
flags
);
void
__cdecl
wined3d_buffer_preload
(
struct
wined3d_buffer
*
buffer
);
void
__cdecl
wined3d_buffer_unmap
(
struct
wined3d_buffer
*
buffer
);
HRESULT
__cdecl
wined3d_device_acquire_focus_window
(
struct
wined3d_device
*
device
,
HWND
window
);
...
...
@@ -2447,6 +2446,7 @@ void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resour
DWORD
__cdecl
wined3d_resource_get_priority
(
const
struct
wined3d_resource
*
resource
);
HRESULT
__cdecl
wined3d_resource_map
(
struct
wined3d_resource
*
resource
,
unsigned
int
sub_resource_idx
,
struct
wined3d_map_desc
*
map_desc
,
const
struct
wined3d_box
*
box
,
DWORD
flags
);
void
__cdecl
wined3d_resource_preload
(
struct
wined3d_resource
*
resource
);
void
__cdecl
wined3d_resource_set_parent
(
struct
wined3d_resource
*
resource
,
void
*
parent
);
DWORD
__cdecl
wined3d_resource_set_priority
(
struct
wined3d_resource
*
resource
,
DWORD
priority
);
HRESULT
__cdecl
wined3d_resource_unmap
(
struct
wined3d_resource
*
resource
,
unsigned
int
sub_resource_idx
);
...
...
@@ -2561,7 +2561,6 @@ HRESULT __cdecl wined3d_texture_get_sub_resource_desc(const struct wined3d_textu
unsigned
int
sub_resource_idx
,
struct
wined3d_sub_resource_desc
*
desc
);
void
*
__cdecl
wined3d_texture_get_sub_resource_parent
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
);
ULONG
__cdecl
wined3d_texture_incref
(
struct
wined3d_texture
*
texture
);
void
__cdecl
wined3d_texture_preload
(
struct
wined3d_texture
*
texture
);
HRESULT
__cdecl
wined3d_texture_release_dc
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
HDC
dc
);
HRESULT
__cdecl
wined3d_texture_set_autogen_filter_type
(
struct
wined3d_texture
*
texture
,
enum
wined3d_texture_filter_type
filter_type
);
...
...
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