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
cdefb5cc
Commit
cdefb5cc
authored
Feb 18, 2016
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Track SFLAG_NONPOW2 per-texture.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e580d748
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
25 deletions
+20
-25
surface.c
dlls/wined3d/surface.c
+3
-14
texture.c
dlls/wined3d/texture.c
+6
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+11
-11
No files found.
dlls/wined3d/surface.c
View file @
cdefb5cc
...
...
@@ -594,7 +594,7 @@ static BOOL surface_use_pbo(const struct wined3d_surface *surface)
&&
gl_info
->
supported
[
ARB_PIXEL_BUFFER_OBJECT
]
&&
!
texture
->
resource
.
format
->
convert
&&
!
(
texture
->
flags
&
WINED3D_TEXTURE_PIN_SYSMEM
)
&&
!
(
surface
->
flags
&
SFLAG_NONPOW2
);
&&
!
(
texture
->
flags
&
WINED3D_TEXTURE_COND_NP2_EMULATED
);
}
static
HRESULT
surface_private_setup
(
struct
wined3d_surface
*
surface
)
...
...
@@ -635,12 +635,6 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
}
}
if
(
pow2Width
!=
surface
->
resource
.
width
||
pow2Height
!=
surface
->
resource
.
height
)
{
surface
->
flags
|=
SFLAG_NONPOW2
;
}
if
((
surface
->
pow2Width
>
gl_info
->
limits
.
texture_size
||
surface
->
pow2Height
>
gl_info
->
limits
.
texture_size
)
&&
!
(
surface
->
resource
.
usage
&
(
WINED3DUSAGE_RENDERTARGET
|
WINED3DUSAGE_DEPTHSTENCIL
)))
{
...
...
@@ -1321,7 +1315,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
GLenum
gl_type
=
format
->
glType
;
void
*
mem
;
if
(
surface
->
flags
&
SFLAG_NONPOW2
)
if
(
surface
->
container
->
flags
&
WINED3D_TEXTURE_COND_NP2_EMULATED
)
{
wined3d_texture_get_pitch
(
surface
->
container
,
surface
->
texture_level
,
&
dst_row_pitch
,
&
dst_slice_pitch
);
wined3d_format_calculate_pitch
(
format
,
surface
->
resource
.
device
->
surface_alignment
,
...
...
@@ -1355,7 +1349,7 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
checkGLcall
(
"glGetTexImage"
);
}
if
(
surface
->
flags
&
SFLAG_NONPOW2
)
if
(
surface
->
container
->
flags
&
WINED3D_TEXTURE_COND_NP2_EMULATED
)
{
const
BYTE
*
src_data
;
BYTE
*
dst_data
;
...
...
@@ -1880,11 +1874,6 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, const struc
surface
->
pow2Height
<<=
1
;
}
if
(
surface
->
pow2Width
!=
width
||
surface
->
pow2Height
!=
height
)
surface
->
flags
|=
SFLAG_NONPOW2
;
else
surface
->
flags
&=
~
SFLAG_NONPOW2
;
if
(
surface
->
container
->
user_memory
)
{
surface
->
resource
.
map_binding
=
WINED3D_LOCATION_USER_MEMORY
;
...
...
dlls/wined3d/texture.c
View file @
cdefb5cc
...
...
@@ -663,6 +663,11 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
wined3d_format_calculate_pitch
(
format
,
1
,
width
,
height
,
&
texture
->
row_pitch
,
&
texture
->
slice_pitch
);
texture
->
flags
&=
~
WINED3D_TEXTURE_COND_NP2_EMULATED
;
if
(((
width
&
(
width
-
1
))
||
(
height
&
(
height
-
1
)))
&&
!
gl_info
->
supported
[
ARB_TEXTURE_NON_POWER_OF_TWO
]
&&
!
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
]
&&
!
gl_info
->
supported
[
WINED3D_GL_NORMALIZED_TEXRECT
])
texture
->
flags
|=
WINED3D_TEXTURE_COND_NP2_EMULATED
;
return
wined3d_surface_update_desc
(
surface
,
gl_info
);
}
...
...
@@ -1074,6 +1079,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
texture
->
pow2_matrix
[
0
]
=
(((
float
)
desc
->
width
)
/
((
float
)
pow2_width
));
texture
->
pow2_matrix
[
5
]
=
(((
float
)
desc
->
height
)
/
((
float
)
pow2_height
));
texture
->
flags
&=
~
WINED3D_TEXTURE_POW2_MAT_IDENT
;
texture
->
flags
|=
WINED3D_TEXTURE_COND_NP2_EMULATED
;
}
texture
->
pow2_matrix
[
10
]
=
1
.
0
f
;
texture
->
pow2_matrix
[
15
]
=
1
.
0
f
;
...
...
dlls/wined3d/wined3d_private.h
View file @
cdefb5cc
...
...
@@ -2336,16 +2336,17 @@ struct wined3d_texture_ops
};
#define WINED3D_TEXTURE_COND_NP2 0x00000001
#define WINED3D_TEXTURE_POW2_MAT_IDENT 0x00000002
#define WINED3D_TEXTURE_IS_SRGB 0x00000004
#define WINED3D_TEXTURE_RGB_ALLOCATED 0x00000008
#define WINED3D_TEXTURE_RGB_VALID 0x00000010
#define WINED3D_TEXTURE_SRGB_ALLOCATED 0x00000020
#define WINED3D_TEXTURE_SRGB_VALID 0x00000040
#define WINED3D_TEXTURE_CONVERTED 0x00000080
#define WINED3D_TEXTURE_PIN_SYSMEM 0x00000100
#define WINED3D_TEXTURE_DYNAMIC_MAP 0x00000200
#define WINED3D_TEXTURE_NORMALIZED_COORDS 0x00000400
#define WINED3D_TEXTURE_COND_NP2_EMULATED 0x00000002
#define WINED3D_TEXTURE_POW2_MAT_IDENT 0x00000004
#define WINED3D_TEXTURE_IS_SRGB 0x00000008
#define WINED3D_TEXTURE_RGB_ALLOCATED 0x00000010
#define WINED3D_TEXTURE_RGB_VALID 0x00000020
#define WINED3D_TEXTURE_SRGB_ALLOCATED 0x00000040
#define WINED3D_TEXTURE_SRGB_VALID 0x00000080
#define WINED3D_TEXTURE_CONVERTED 0x00000100
#define WINED3D_TEXTURE_PIN_SYSMEM 0x00000200
#define WINED3D_TEXTURE_DYNAMIC_MAP 0x00000400
#define WINED3D_TEXTURE_NORMALIZED_COORDS 0x00000800
#define WINED3D_TEXTURE_ASYNC_COLOR_KEY 0x00000001
...
...
@@ -2596,7 +2597,6 @@ void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3
/* Surface flags: */
#define SFLAG_DIBSECTION 0x00000001
/* Has a DIB section attached for GetDC. */
#define SFLAG_DISCARD 0x00000002
/* ??? */
#define SFLAG_NONPOW2 0x00000004
/* Surface sizes are not a power of 2 */
#define SFLAG_DCINUSE 0x00000020
/* Set between GetDC and ReleaseDC calls. */
struct
wined3d_sampler
...
...
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