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
321cd8e8
Commit
321cd8e8
authored
Jan 15, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Decide about PBO use at surface creation time.
parent
7c052171
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
17 deletions
+25
-17
surface.c
dlls/wined3d/surface.c
+24
-17
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/surface.c
View file @
321cd8e8
...
...
@@ -538,20 +538,6 @@ static void surface_get_memory(const struct wined3d_surface *surface, struct win
data
->
buffer_object
=
0
;
}
static
BOOL
surface_need_pbo
(
const
struct
wined3d_surface
*
surface
,
const
struct
wined3d_gl_info
*
gl_info
)
{
if
(
surface
->
resource
.
pool
==
WINED3D_POOL_SYSTEM_MEM
)
return
FALSE
;
if
(
!
(
surface
->
flags
&
SFLAG_DYNLOCK
))
return
FALSE
;
if
(
surface
->
flags
&
(
SFLAG_CONVERTED
|
SFLAG_NONPOW2
|
SFLAG_PIN_SYSMEM
))
return
FALSE
;
if
(
!
gl_info
->
supported
[
ARB_PIXEL_BUFFER_OBJECT
])
return
FALSE
;
return
TRUE
;
}
static
void
surface_create_pbo
(
struct
wined3d_surface
*
surface
,
const
struct
wined3d_gl_info
*
gl_info
)
{
struct
wined3d_context
*
context
;
...
...
@@ -591,7 +577,7 @@ static void surface_prepare_system_memory(struct wined3d_surface *surface)
TRACE
(
"surface %p.
\n
"
,
surface
);
if
(
!
surface
->
pbo
&&
surface
_need_pbo
(
surface
,
gl_info
)
)
if
(
!
surface
->
pbo
&&
surface
->
flags
&
SFLAG_PBO
)
surface_create_pbo
(
surface
,
gl_info
);
else
if
(
!
(
surface
->
resource
.
heap_memory
||
surface
->
pbo
))
{
...
...
@@ -666,6 +652,17 @@ static void surface_release_client_storage(struct wined3d_surface *surface)
surface_force_reload
(
surface
);
}
static
BOOL
surface_use_pbo
(
const
struct
wined3d_surface
*
surface
)
{
const
struct
wined3d_gl_info
*
gl_info
=
&
surface
->
resource
.
device
->
adapter
->
gl_info
;
return
surface
->
resource
.
pool
==
WINED3D_POOL_DEFAULT
&&
surface
->
resource
.
access_flags
&
WINED3D_RESOURCE_ACCESS_CPU
&&
gl_info
->
supported
[
ARB_PIXEL_BUFFER_OBJECT
]
&&
!
surface
->
resource
.
format
->
convert
&&
!
(
surface
->
flags
&
(
SFLAG_NONPOW2
|
SFLAG_PIN_SYSMEM
));
}
static
HRESULT
surface_private_setup
(
struct
wined3d_surface
*
surface
)
{
/* TODO: Check against the maximum texture sizes supported by the video card. */
...
...
@@ -753,6 +750,9 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
if
(
surface
->
resource
.
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
surface
->
flags
|=
SFLAG_DISCARDED
;
if
(
surface_use_pbo
(
surface
))
surface
->
flags
|=
SFLAG_PBO
;
return
WINED3D_OK
;
}
...
...
@@ -2791,6 +2791,13 @@ HRESULT CDECL wined3d_surface_update_desc(struct wined3d_surface *surface,
else
surface
->
resource
.
size
=
resource_size
;
/* The format might be changed to a format that needs conversion.
* If the surface didn't use PBOs previously but could now, don't
* change it - whatever made us not use PBOs might come back, e.g.
* color keys. */
if
(
!
surface_use_pbo
(
surface
))
surface
->
flags
&=
~
SFLAG_PBO
;
if
(
create_dib
)
{
if
(
FAILED
(
hr
=
surface_create_dib_section
(
surface
)))
...
...
@@ -5109,6 +5116,7 @@ static HRESULT surface_load_texture(struct wined3d_surface *surface,
{
TRACE
(
"Removing the pbo attached to surface %p.
\n
"
,
surface
);
surface_remove_pbo
(
surface
,
gl_info
);
surface
->
flags
&=
~
SFLAG_PBO
;
}
surface_get_memory
(
surface
,
&
data
,
surface
->
flags
);
...
...
@@ -5209,8 +5217,7 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location)
{
TRACE
(
"Location already up to date.
\n
"
);
if
(
location
==
SFLAG_INSYSMEM
&&
!
surface
->
pbo
&&
surface_need_pbo
(
surface
,
gl_info
))
if
(
location
==
SFLAG_INSYSMEM
&&
!
surface
->
pbo
&&
surface
->
flags
&
SFLAG_PBO
)
surface_create_pbo
(
surface
,
gl_info
);
return
WINED3D_OK
;
...
...
dlls/wined3d/wined3d_private.h
View file @
321cd8e8
...
...
@@ -2305,6 +2305,7 @@ void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) D
#define SFLAG_INRB_MULTISAMPLE 0x00080000
/* The multisample renderbuffer is current. */
#define SFLAG_INRB_RESOLVED 0x00100000
/* The resolved renderbuffer is current. */
#define SFLAG_DISCARDED 0x00200000
/* Surface was discarded, allocating new location is enough. */
#define SFLAG_PBO 0x00400000
/* Use a PBO for mapping. */
/* In some conditions the surface memory must not be freed:
* SFLAG_CONVERTED: Converting the data back would take too long
...
...
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