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
484c9ae4
Commit
484c9ae4
authored
Mar 21, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Merge surface_private_setup() into wined3d_surface_init().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
55b97245
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
36 deletions
+24
-36
surface.c
dlls/wined3d/surface.c
+24
-36
No files found.
dlls/wined3d/surface.c
View file @
484c9ae4
...
...
@@ -518,41 +518,6 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
surface_invalidate_location
(
surface
,
WINED3D_LOCATION_SYSMEM
);
}
static
void
surface_private_setup
(
struct
wined3d_surface
*
surface
)
{
/* TODO: Check against the maximum texture sizes supported by the video card. */
struct
wined3d_texture
*
texture
=
surface
->
container
;
const
struct
wined3d_gl_info
*
gl_info
=
&
texture
->
resource
.
device
->
adapter
->
gl_info
;
unsigned
int
pow2Width
,
pow2Height
;
TRACE
(
"surface %p.
\n
"
,
surface
);
/* Non-power2 support */
if
(
gl_info
->
supported
[
ARB_TEXTURE_NON_POWER_OF_TWO
]
||
gl_info
->
supported
[
WINED3D_GL_NORMALIZED_TEXRECT
]
||
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
])
{
pow2Width
=
surface
->
resource
.
width
;
pow2Height
=
surface
->
resource
.
height
;
}
else
{
/* Find the nearest pow2 match */
pow2Width
=
pow2Height
=
1
;
while
(
pow2Width
<
surface
->
resource
.
width
)
pow2Width
<<=
1
;
while
(
pow2Height
<
surface
->
resource
.
height
)
pow2Height
<<=
1
;
}
surface
->
pow2Width
=
pow2Width
;
surface
->
pow2Height
=
pow2Height
;
if
(
texture
->
resource
.
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
surface
->
locations
=
WINED3D_LOCATION_DISCARDED
;
if
(
wined3d_texture_use_pbo
(
texture
,
gl_info
))
surface
->
resource
.
map_binding
=
WINED3D_LOCATION_BUFFER
;
}
static
BOOL
surface_is_full_rect
(
const
struct
wined3d_surface
*
surface
,
const
RECT
*
r
)
{
if
((
r
->
left
&&
r
->
right
)
||
abs
(
r
->
right
-
r
->
left
)
!=
surface
->
resource
.
width
)
...
...
@@ -4556,6 +4521,25 @@ HRESULT wined3d_surface_init(struct wined3d_surface *surface, struct wined3d_tex
unsigned
int
resource_size
;
HRESULT
hr
;
if
(
container
->
flags
&
WINED3D_TEXTURE_COND_NP2_EMULATED
)
{
unsigned
int
pow2_width
=
1
,
pow2_height
=
1
;
/* Find the nearest pow2 match. */
while
(
pow2_width
<
desc
->
width
)
pow2_width
<<=
1
;
while
(
pow2_height
<
desc
->
height
)
pow2_height
<<=
1
;
surface
->
pow2Width
=
pow2_width
;
surface
->
pow2Height
=
pow2_height
;
}
else
{
surface
->
pow2Width
=
desc
->
width
;
surface
->
pow2Height
=
desc
->
height
;
}
/* Quick lockable sanity check.
* TODO: remove this after surfaces, usage and lockability have been debugged properly
* this function is too deep to need to care about things like this.
...
...
@@ -4614,7 +4598,11 @@ HRESULT wined3d_surface_init(struct wined3d_surface *surface, struct wined3d_tex
surface
->
texture_level
=
level
;
surface
->
texture_layer
=
layer
;
surface_private_setup
(
surface
);
if
(
container
->
resource
.
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
surface
->
locations
=
WINED3D_LOCATION_DISCARDED
;
if
(
wined3d_texture_use_pbo
(
container
,
gl_info
))
surface
->
resource
.
map_binding
=
WINED3D_LOCATION_BUFFER
;
/* Similar to lockable rendertargets above, creating the DIB section
* during surface initialization prevents the sysmem pointer from changing
...
...
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