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
556e3e0c
Commit
556e3e0c
authored
Sep 23, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use GL_APPLE_client_storage for volumes if available.
parent
993c9778
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
17 deletions
+37
-17
volume.c
dlls/wined3d/volume.c
+36
-17
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/volume.c
View file @
556e3e0c
...
...
@@ -57,18 +57,48 @@ void volume_set_container(struct wined3d_volume *volume, struct wined3d_texture
volume
->
container
=
container
;
}
static
BOOL
volume_prepare_system_memory
(
struct
wined3d_volume
*
volume
)
{
if
(
volume
->
resource
.
heap_memory
)
return
TRUE
;
if
(
!
wined3d_resource_allocate_sysmem
(
&
volume
->
resource
))
{
ERR
(
"Failed to allocate system memory.
\n
"
);
return
FALSE
;
}
return
TRUE
;
}
/* Context activation is done by the caller. */
static
void
wined3d_volume_allocate_texture
(
const
struct
wined3d_volume
*
volume
,
static
void
wined3d_volume_allocate_texture
(
struct
wined3d_volume
*
volume
,
const
struct
wined3d_context
*
context
,
BOOL
srgb
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
struct
wined3d_format
*
format
=
volume
->
resource
.
format
;
void
*
mem
=
NULL
;
if
(
gl_info
->
supported
[
APPLE_CLIENT_STORAGE
]
&&
!
format
->
convert
&&
volume_prepare_system_memory
(
volume
))
{
TRACE
(
"Enabling GL_UNPACK_CLIENT_STORAGE_APPLE for volume %p
\n
"
,
volume
);
gl_info
->
gl_ops
.
gl
.
p_glPixelStorei
(
GL_UNPACK_CLIENT_STORAGE_APPLE
,
GL_TRUE
);
checkGLcall
(
"glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE)"
);
mem
=
volume
->
resource
.
heap_memory
;
volume
->
flags
|=
WINED3D_VFLAG_CLIENT_STORAGE
;
}
GL_EXTCALL
(
glTexImage3DEXT
(
GL_TEXTURE_3D
,
volume
->
texture_level
,
srgb
?
format
->
glGammaInternal
:
format
->
glInternal
,
volume
->
resource
.
width
,
volume
->
resource
.
height
,
volume
->
resource
.
depth
,
0
,
format
->
glFormat
,
format
->
glType
,
NULL
));
0
,
format
->
glFormat
,
format
->
glType
,
mem
));
checkGLcall
(
"glTexImage3D"
);
if
(
mem
)
{
gl_info
->
gl_ops
.
gl
.
p_glPixelStorei
(
GL_UNPACK_CLIENT_STORAGE_APPLE
,
GL_FALSE
);
checkGLcall
(
"glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_FALSE)"
);
}
}
static
void
wined3d_volume_get_pitch
(
const
struct
wined3d_volume
*
volume
,
UINT
*
row_pitch
,
...
...
@@ -261,6 +291,8 @@ static BOOL wined3d_volume_can_evict(const struct wined3d_volume *volume)
return
FALSE
;
if
(
volume
->
resource
.
format
->
convert
)
return
FALSE
;
if
(
volume
->
flags
&
WINED3D_VFLAG_CLIENT_STORAGE
)
return
FALSE
;
return
TRUE
;
}
...
...
@@ -452,20 +484,6 @@ static void wined3d_volume_free_pbo(struct wined3d_volume *volume)
context_release
(
context
);
}
static
BOOL
volume_prepare_system_memory
(
struct
wined3d_volume
*
volume
)
{
if
(
volume
->
resource
.
heap_memory
)
return
TRUE
;
if
(
!
wined3d_resource_allocate_sysmem
(
&
volume
->
resource
))
{
ERR
(
"Failed to allocate system memory.
\n
"
);
return
FALSE
;
}
return
TRUE
;
}
static
void
volume_unload
(
struct
wined3d_resource
*
resource
)
{
struct
wined3d_volume
*
volume
=
volume_from_resource
(
resource
);
...
...
@@ -501,7 +519,8 @@ static void volume_unload(struct wined3d_resource *resource)
}
/* The texture name is managed by the container. */
volume
->
flags
&=
~
(
WINED3D_VFLAG_ALLOCATED
|
WINED3D_VFLAG_SRGB_ALLOCATED
);
volume
->
flags
&=
~
(
WINED3D_VFLAG_ALLOCATED
|
WINED3D_VFLAG_SRGB_ALLOCATED
|
WINED3D_VFLAG_CLIENT_STORAGE
);
resource_unload
(
resource
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
556e3e0c
...
...
@@ -2114,6 +2114,7 @@ void wined3d_texture_set_dirty(struct wined3d_texture *texture) DECLSPEC_HIDDEN;
#define WINED3D_VFLAG_ALLOCATED 0x00000001
#define WINED3D_VFLAG_SRGB_ALLOCATED 0x00000002
#define WINED3D_VFLAG_PBO 0x00000004
#define WINED3D_VFLAG_CLIENT_STORAGE 0x00000008
#define WINED3D_LOCATION_DISCARDED 0x00000001
#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