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
fcbe8b7a
Commit
fcbe8b7a
authored
Mar 14, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get resource info from the texture in surface_private_setup().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fc868cb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
surface.c
dlls/wined3d/surface.c
+6
-5
No files found.
dlls/wined3d/surface.c
View file @
fcbe8b7a
...
@@ -534,7 +534,8 @@ static BOOL surface_use_pbo(const struct wined3d_surface *surface)
...
@@ -534,7 +534,8 @@ static BOOL surface_use_pbo(const struct wined3d_surface *surface)
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. */
const
struct
wined3d_gl_info
*
gl_info
=
&
surface
->
resource
.
device
->
adapter
->
gl_info
;
struct
wined3d_texture
*
texture
=
surface
->
container
;
const
struct
wined3d_gl_info
*
gl_info
=
&
texture
->
resource
.
device
->
adapter
->
gl_info
;
unsigned
int
pow2Width
,
pow2Height
;
unsigned
int
pow2Width
,
pow2Height
;
TRACE
(
"surface %p.
\n
"
,
surface
);
TRACE
(
"surface %p.
\n
"
,
surface
);
...
@@ -561,7 +562,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
...
@@ -561,7 +562,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
if
(
pow2Width
>
surface
->
resource
.
width
||
pow2Height
>
surface
->
resource
.
height
)
if
(
pow2Width
>
surface
->
resource
.
width
||
pow2Height
>
surface
->
resource
.
height
)
{
{
/* TODO: Add support for non power two compressed textures. */
/* TODO: Add support for non power two compressed textures. */
if
(
surface
->
container
->
resource
.
format_flags
&
(
WINED3DFMT_FLAG_COMPRESSED
|
WINED3DFMT_FLAG_HEIGHT_SCALE
))
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
"
,
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
);
surface
,
surface
->
resource
.
width
,
surface
->
resource
.
height
);
...
@@ -570,7 +571,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
...
@@ -570,7 +571,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
}
}
if
((
surface
->
pow2Width
>
gl_info
->
limits
.
texture_size
||
surface
->
pow2Height
>
gl_info
->
limits
.
texture_size
)
if
((
surface
->
pow2Width
>
gl_info
->
limits
.
texture_size
||
surface
->
pow2Height
>
gl_info
->
limits
.
texture_size
)
&&
!
(
surfac
e
->
resource
.
usage
&
(
WINED3DUSAGE_RENDERTARGET
|
WINED3DUSAGE_DEPTHSTENCIL
)))
&&
!
(
textur
e
->
resource
.
usage
&
(
WINED3DUSAGE_RENDERTARGET
|
WINED3DUSAGE_DEPTHSTENCIL
)))
{
{
/* One of three options:
/* One of three options:
* 1: Do the same as we do with NPOT and scale the texture, (any
* 1: Do the same as we do with NPOT and scale the texture, (any
...
@@ -582,7 +583,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
...
@@ -582,7 +583,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
* Blts. Some apps (e.g. Swat 3) create textures with a Height of
* Blts. Some apps (e.g. Swat 3) create textures with a Height of
* 16 and a Width > 3000 and blt 16x16 letter areas from them to
* 16 and a Width > 3000 and blt 16x16 letter areas from them to
* the render target. */
* the render target. */
if
(
surface
->
resource
.
pool
==
WINED3D_POOL_DEFAULT
||
surfac
e
->
resource
.
pool
==
WINED3D_POOL_MANAGED
)
if
(
texture
->
resource
.
pool
==
WINED3D_POOL_DEFAULT
||
textur
e
->
resource
.
pool
==
WINED3D_POOL_MANAGED
)
{
{
WARN
(
"Unable to allocate a surface which exceeds the maximum OpenGL texture size.
\n
"
);
WARN
(
"Unable to allocate a surface which exceeds the maximum OpenGL texture size.
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
return
WINED3DERR_NOTAVAILABLE
;
...
@@ -593,7 +594,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
...
@@ -593,7 +594,7 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface)
surface
->
pow2Width
,
surface
->
pow2Height
);
surface
->
pow2Width
,
surface
->
pow2Height
);
}
}
if
(
surfac
e
->
resource
.
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
if
(
textur
e
->
resource
.
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
surface
->
locations
=
WINED3D_LOCATION_DISCARDED
;
surface
->
locations
=
WINED3D_LOCATION_DISCARDED
;
if
(
surface_use_pbo
(
surface
))
if
(
surface_use_pbo
(
surface
))
...
...
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