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
55b97245
Commit
55b97245
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: Check for compressed and height scaled formats in texture_init().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ab53ef06
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
21 deletions
+13
-21
surface.c
dlls/wined3d/surface.c
+2
-21
texture.c
dlls/wined3d/texture.c
+11
-0
No files found.
dlls/wined3d/surface.c
View file @
55b97245
...
...
@@ -518,7 +518,7 @@ static void surface_evict_sysmem(struct wined3d_surface *surface)
surface_invalidate_location
(
surface
,
WINED3D_LOCATION_SYSMEM
);
}
static
HRESULT
surface_private_setup
(
struct
wined3d_surface
*
surface
)
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
;
...
...
@@ -546,24 +546,11 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
surface
->
pow2Width
=
pow2Width
;
surface
->
pow2Height
=
pow2Height
;
if
(
pow2Width
>
surface
->
resource
.
width
||
pow2Height
>
surface
->
resource
.
height
)
{
/* TODO: Add support for non power two compressed textures. */
if
(
texture
->
resource
.
format_flags
&
(
WINED3DFMT_FLAG_COMPRESSED
|
WINED3DFMT_FLAG_HEIGHT_SCALE
))
{
FIXME
(
"(%p) Compressed or height scaled non-power-two textures are not supported w(%d) h(%d)
\n
"
,
surface
,
surface
->
resource
.
width
,
surface
->
resource
.
height
);
return
WINED3DERR_NOTAVAILABLE
;
}
}
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
;
return
WINED3D_OK
;
}
static
BOOL
surface_is_full_rect
(
const
struct
wined3d_surface
*
surface
,
const
RECT
*
r
)
...
...
@@ -4627,13 +4614,7 @@ HRESULT wined3d_surface_init(struct wined3d_surface *surface, struct wined3d_tex
surface
->
texture_level
=
level
;
surface
->
texture_layer
=
layer
;
/* Call the private setup routine */
if
(
FAILED
(
hr
=
surface_private_setup
(
surface
)))
{
ERR
(
"Private setup failed, hr %#x.
\n
"
,
hr
);
wined3d_surface_cleanup
(
surface
);
return
hr
;
}
surface_private_setup
(
surface
);
/* Similar to lockable rendertargets above, creating the DIB section
* during surface initialization prevents the sysmem pointer from changing
...
...
dlls/wined3d/texture.c
View file @
55b97245
...
...
@@ -1423,6 +1423,17 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
if
(
!
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
]
&&
!
gl_info
->
supported
[
WINED3D_GL_NORMALIZED_TEXRECT
])
{
const
struct
wined3d_format
*
format
=
wined3d_get_format
(
gl_info
,
desc
->
format
);
/* TODO: Add support for non-power-of-two compressed textures. */
if
(
format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
(
WINED3DFMT_FLAG_COMPRESSED
|
WINED3DFMT_FLAG_HEIGHT_SCALE
))
{
FIXME
(
"Compressed or height scaled non-power-of-two (%ux%u) textures are not supported.
\n
"
,
desc
->
width
,
desc
->
height
);
return
WINED3DERR_NOTAVAILABLE
;
}
/* Find the nearest pow2 match. */
pow2_width
=
pow2_height
=
1
;
while
(
pow2_width
<
desc
->
width
)
...
...
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