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
bad48492
Commit
bad48492
authored
Mar 14, 2016
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce wined3d_texture_use_pbo().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ef816275
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
18 deletions
+17
-18
surface.c
dlls/wined3d/surface.c
+3
-15
texture.c
dlls/wined3d/texture.c
+11
-0
volume.c
dlls/wined3d/volume.c
+1
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/surface.c
View file @
bad48492
...
@@ -518,19 +518,6 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
...
@@ -518,19 +518,6 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
surface_invalidate_location
(
surface
,
WINED3D_LOCATION_SYSMEM
);
surface_invalidate_location
(
surface
,
WINED3D_LOCATION_SYSMEM
);
}
}
static
BOOL
surface_use_pbo
(
const
struct
wined3d_surface
*
surface
)
{
const
struct
wined3d_gl_info
*
gl_info
=
&
surface
->
resource
.
device
->
adapter
->
gl_info
;
struct
wined3d_texture
*
texture
=
surface
->
container
;
return
texture
->
resource
.
pool
==
WINED3D_POOL_DEFAULT
&&
surface
->
resource
.
access_flags
&
WINED3D_RESOURCE_ACCESS_CPU
&&
gl_info
->
supported
[
ARB_PIXEL_BUFFER_OBJECT
]
&&
!
texture
->
resource
.
format
->
convert
&&
!
(
texture
->
flags
&
WINED3D_TEXTURE_PIN_SYSMEM
)
&&
!
(
texture
->
flags
&
WINED3D_TEXTURE_COND_NP2_EMULATED
);
}
static
HRESULT
surface_private_setup
(
struct
wined3d_surface
*
surface
)
static
HRESULT
surface_private_setup
(
struct
wined3d_surface
*
surface
)
{
{
/* TODO: Check against the maximum texture sizes supported by the video card. */
/* TODO: Check against the maximum texture sizes supported by the video card. */
...
@@ -597,7 +584,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
...
@@ -597,7 +584,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
if
(
texture
->
resource
.
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
if
(
texture
->
resource
.
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
surface
->
locations
=
WINED3D_LOCATION_DISCARDED
;
surface
->
locations
=
WINED3D_LOCATION_DISCARDED
;
if
(
surface_use_pbo
(
surface
))
if
(
wined3d_texture_use_pbo
(
texture
,
gl_info
))
surface
->
resource
.
map_binding
=
WINED3D_LOCATION_BUFFER
;
surface
->
resource
.
map_binding
=
WINED3D_LOCATION_BUFFER
;
return
WINED3D_OK
;
return
WINED3D_OK
;
...
@@ -1743,7 +1730,8 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, const struc
...
@@ -1743,7 +1730,8 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, const struc
* If the surface didn't use PBOs previously but could now, don't
* 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.
* change it - whatever made us not use PBOs might come back, e.g.
* color keys. */
* color keys. */
if
(
surface
->
resource
.
map_binding
==
WINED3D_LOCATION_BUFFER
&&
!
surface_use_pbo
(
surface
))
if
(
surface
->
resource
.
map_binding
==
WINED3D_LOCATION_BUFFER
&&
!
wined3d_texture_use_pbo
(
surface
->
container
,
gl_info
))
surface
->
resource
.
map_binding
=
create_dib
?
WINED3D_LOCATION_DIB
:
WINED3D_LOCATION_SYSMEM
;
surface
->
resource
.
map_binding
=
create_dib
?
WINED3D_LOCATION_DIB
:
WINED3D_LOCATION_SYSMEM
;
if
(
create_dib
)
if
(
create_dib
)
...
...
dlls/wined3d/texture.c
View file @
bad48492
...
@@ -28,6 +28,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture);
...
@@ -28,6 +28,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture);
WINE_DECLARE_DEBUG_CHANNEL
(
d3d_perf
);
WINE_DECLARE_DEBUG_CHANNEL
(
d3d_perf
);
WINE_DECLARE_DEBUG_CHANNEL
(
winediag
);
WINE_DECLARE_DEBUG_CHANNEL
(
winediag
);
BOOL
wined3d_texture_use_pbo
(
const
struct
wined3d_texture
*
texture
,
const
struct
wined3d_gl_info
*
gl_info
)
{
return
texture
->
resource
.
pool
==
WINED3D_POOL_DEFAULT
&&
texture
->
resource
.
access_flags
&
WINED3D_RESOURCE_ACCESS_CPU
&&
gl_info
->
supported
[
ARB_PIXEL_BUFFER_OBJECT
]
&&
!
texture
->
resource
.
format
->
convert
&&
!
(
texture
->
flags
&
(
WINED3D_TEXTURE_PIN_SYSMEM
|
WINED3D_TEXTURE_COND_NP2_EMULATED
));
}
static
HRESULT
wined3d_texture_init
(
struct
wined3d_texture
*
texture
,
const
struct
wined3d_texture_ops
*
texture_ops
,
static
HRESULT
wined3d_texture_init
(
struct
wined3d_texture
*
texture
,
const
struct
wined3d_texture_ops
*
texture_ops
,
UINT
layer_count
,
UINT
level_count
,
const
struct
wined3d_resource_desc
*
desc
,
DWORD
flags
,
UINT
layer_count
,
UINT
level_count
,
const
struct
wined3d_resource_desc
*
desc
,
DWORD
flags
,
struct
wined3d_device
*
device
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_device
*
device
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
...
@@ -61,6 +70,8 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
...
@@ -61,6 +70,8 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
return
hr
;
return
hr
;
}
}
wined3d_resource_update_draw_binding
(
&
texture
->
resource
);
wined3d_resource_update_draw_binding
(
&
texture
->
resource
);
if
((
flags
&
WINED3D_TEXTURE_CREATE_MAPPABLE
)
||
desc
->
format
==
WINED3DFMT_D16_LOCKABLE
)
texture
->
resource
.
access_flags
|=
WINED3D_RESOURCE_ACCESS_CPU
;
texture
->
texture_ops
=
texture_ops
;
texture
->
texture_ops
=
texture_ops
;
...
...
dlls/wined3d/volume.c
View file @
bad48492
...
@@ -489,9 +489,7 @@ HRESULT wined3d_volume_init(struct wined3d_volume *volume, struct wined3d_textur
...
@@ -489,9 +489,7 @@ HRESULT wined3d_volume_init(struct wined3d_volume *volume, struct wined3d_textur
volume
->
texture_level
=
level
;
volume
->
texture_level
=
level
;
volume
->
locations
=
WINED3D_LOCATION_DISCARDED
;
volume
->
locations
=
WINED3D_LOCATION_DISCARDED
;
if
(
desc
->
pool
==
WINED3D_POOL_DEFAULT
&&
desc
->
usage
&
WINED3DUSAGE_DYNAMIC
if
(
wined3d_texture_use_pbo
(
container
,
gl_info
))
&&
gl_info
->
supported
[
ARB_PIXEL_BUFFER_OBJECT
]
&&
!
format
->
convert
)
{
{
wined3d_resource_free_sysmem
(
&
volume
->
resource
);
wined3d_resource_free_sysmem
(
&
volume
->
resource
);
volume
->
resource
.
map_binding
=
WINED3D_LOCATION_BUFFER
;
volume
->
resource
.
map_binding
=
WINED3D_LOCATION_BUFFER
;
...
...
dlls/wined3d/wined3d_private.h
View file @
bad48492
...
@@ -2458,6 +2458,8 @@ void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture,
...
@@ -2458,6 +2458,8 @@ void wined3d_texture_remove_buffer_object(struct wined3d_texture *texture,
void
wined3d_texture_set_dirty
(
struct
wined3d_texture
*
texture
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_set_dirty
(
struct
wined3d_texture
*
texture
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_set_swapchain
(
struct
wined3d_texture
*
texture
,
void
wined3d_texture_set_swapchain
(
struct
wined3d_texture
*
texture
,
struct
wined3d_swapchain
*
swapchain
)
DECLSPEC_HIDDEN
;
struct
wined3d_swapchain
*
swapchain
)
DECLSPEC_HIDDEN
;
BOOL
wined3d_texture_use_pbo
(
const
struct
wined3d_texture
*
texture
,
const
struct
wined3d_gl_info
*
gl_info
)
DECLSPEC_HIDDEN
;
#define WINED3D_LOCATION_DISCARDED 0x00000001
#define WINED3D_LOCATION_DISCARDED 0x00000001
#define WINED3D_LOCATION_SYSMEM 0x00000002
#define WINED3D_LOCATION_SYSMEM 0x00000002
...
...
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