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
5141c082
Commit
5141c082
authored
Mar 02, 2016
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Merge surface_remove_pbo() and wined3d_volume_free_pbo().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
87143e60
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
40 deletions
+30
-40
surface.c
dlls/wined3d/surface.c
+1
-18
texture.c
dlls/wined3d/texture.c
+27
-0
volume.c
dlls/wined3d/volume.c
+0
-22
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/surface.c
View file @
5141c082
...
...
@@ -996,19 +996,6 @@ static HRESULT wined3d_surface_depth_blt(struct wined3d_surface *src_surface, DW
return
WINED3D_OK
;
}
/* Context activation is done by the caller. */
static
void
surface_remove_pbo
(
struct
wined3d_surface
*
surface
,
const
struct
wined3d_gl_info
*
gl_info
)
{
GLuint
*
buffer_object
;
buffer_object
=
&
surface
->
container
->
sub_resources
[
surface_get_sub_resource_idx
(
surface
)].
buffer_object
;
GL_EXTCALL
(
glDeleteBuffers
(
1
,
buffer_object
));
checkGLcall
(
"glDeleteBuffers(1, buffer_object)"
);
*
buffer_object
=
0
;
surface_invalidate_location
(
surface
,
WINED3D_LOCATION_BUFFER
);
}
static
ULONG
surface_resource_incref
(
struct
wined3d_resource
*
resource
)
{
struct
wined3d_surface
*
surface
=
surface_from_resource
(
resource
);
...
...
@@ -1071,10 +1058,6 @@ static void surface_unload(struct wined3d_resource *resource)
surface_invalidate_location
(
surface
,
~
surface
->
resource
.
map_binding
);
}
/* Destroy PBOs, but load them into real sysmem before */
if
(
surface
->
container
->
sub_resources
[
surface_get_sub_resource_idx
(
surface
)].
buffer_object
)
surface_remove_pbo
(
surface
,
gl_info
);
/* Destroy fbo render buffers. This is needed for implicit render targets, for
* all application-created targets the application has to release the surface
* before calling _Reset
...
...
@@ -3681,7 +3664,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
surface_prepare_map_memory
(
surface
);
surface_load_location
(
surface
,
context
,
surface
->
resource
.
map_binding
);
surface_remove_pbo
(
surface
,
gl_info
);
wined3d_texture_remove_buffer_object
(
texture
,
surface_get_sub_resource_idx
(
surface
)
,
gl_info
);
}
surface_get_memory
(
surface
,
&
data
,
surface
->
locations
);
...
...
dlls/wined3d/texture.c
View file @
5141c082
...
...
@@ -74,6 +74,23 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
return
WINED3D_OK
;
}
/* Context activation is done by the caller. */
void
wined3d_texture_remove_buffer_object
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
const
struct
wined3d_gl_info
*
gl_info
)
{
GLuint
*
buffer_object
;
buffer_object
=
&
texture
->
sub_resources
[
sub_resource_idx
].
buffer_object
;
GL_EXTCALL
(
glDeleteBuffers
(
1
,
buffer_object
));
checkGLcall
(
"glDeleteBuffers"
);
texture
->
texture_ops
->
texture_sub_resource_invalidate_location
(
texture
->
sub_resources
[
sub_resource_idx
].
resource
,
WINED3D_LOCATION_BUFFER
);
*
buffer_object
=
0
;
TRACE
(
"Deleted buffer object %u for texture %p, sub-resource %u.
\n
"
,
*
buffer_object
,
texture
,
sub_resource_idx
);
}
/* A GL context is provided by the caller */
static
void
gltexture_delete
(
struct
wined3d_device
*
device
,
const
struct
wined3d_gl_info
*
gl_info
,
struct
gl_texture
*
tex
)
...
...
@@ -979,6 +996,7 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
{
struct
wined3d_texture
*
texture
=
wined3d_texture_from_resource
(
resource
);
UINT
sub_count
=
texture
->
level_count
*
texture
->
layer_count
;
struct
wined3d_context
*
context
=
NULL
;
UINT
i
;
TRACE
(
"texture %p.
\n
"
,
texture
);
...
...
@@ -988,7 +1006,16 @@ static void wined3d_texture_unload(struct wined3d_resource *resource)
struct
wined3d_resource
*
sub_resource
=
texture
->
sub_resources
[
i
].
resource
;
sub_resource
->
resource_ops
->
resource_unload
(
sub_resource
);
if
(
texture
->
sub_resources
[
i
].
buffer_object
)
{
if
(
!
context
)
context
=
context_acquire
(
texture
->
resource
.
device
,
NULL
);
wined3d_texture_remove_buffer_object
(
texture
,
i
,
context
->
gl_info
);
}
}
if
(
context
)
context_release
(
context
);
wined3d_texture_force_reload
(
texture
);
wined3d_texture_unload_gl_texture
(
texture
);
...
...
dlls/wined3d/volume.c
View file @
5141c082
...
...
@@ -362,19 +362,6 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *
srgb_mode
?
WINED3D_LOCATION_TEXTURE_SRGB
:
WINED3D_LOCATION_TEXTURE_RGB
);
}
static
void
wined3d_volume_free_pbo
(
struct
wined3d_volume
*
volume
)
{
GLuint
*
buffer_object
=
&
volume
->
container
->
sub_resources
[
volume
->
texture_level
].
buffer_object
;
struct
wined3d_context
*
context
=
context_acquire
(
volume
->
resource
.
device
,
NULL
);
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
TRACE
(
"Deleting PBO %u belonging to volume %p.
\n
"
,
*
buffer_object
,
volume
);
GL_EXTCALL
(
glDeleteBuffers
(
1
,
buffer_object
));
checkGLcall
(
"glDeleteBuffers"
);
*
buffer_object
=
0
;
context_release
(
context
);
}
void
wined3d_volume_cleanup
(
struct
wined3d_volume
*
volume
)
{
TRACE
(
"volume %p.
\n
"
,
volume
);
...
...
@@ -407,15 +394,6 @@ static void volume_unload(struct wined3d_resource *resource)
wined3d_volume_invalidate_location
(
volume
,
~
WINED3D_LOCATION_DISCARDED
);
}
if
(
volume
->
container
->
sub_resources
[
volume
->
texture_level
].
buffer_object
)
{
/* Should not happen because only dynamic default pool volumes
* have a buffer, and those are not evicted by device_evit_managed_resources
* and must be freed before a non-ex device reset. */
ERR
(
"Unloading a volume with a buffer
\n
"
);
wined3d_volume_free_pbo
(
volume
);
}
/* The texture name is managed by the container. */
resource_unload
(
resource
);
...
...
dlls/wined3d/wined3d_private.h
View file @
5141c082
...
...
@@ -2424,6 +2424,8 @@ void wined3d_texture_prepare_buffer_object(struct wined3d_texture *texture,
unsigned
int
sub_resource_idx
,
const
struct
wined3d_gl_info
*
gl_info
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_prepare_texture
(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_remove_buffer_object
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
const
struct
wined3d_gl_info
*
gl_info
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_set_dirty
(
struct
wined3d_texture
*
texture
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_set_swapchain
(
struct
wined3d_texture
*
texture
,
struct
wined3d_swapchain
*
swapchain
)
DECLSPEC_HIDDEN
;
...
...
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