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
0152b0da
Commit
0152b0da
authored
Apr 26, 2015
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move the ARB_texture_rectangle check to init_format_texture_info.
parent
0d6d64b3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
19 deletions
+35
-19
texture.c
dlls/wined3d/texture.c
+34
-19
utils.c
dlls/wined3d/utils.c
+1
-0
No files found.
dlls/wined3d/texture.c
View file @
0152b0da
...
...
@@ -1076,6 +1076,9 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
UINT
pow2_width
,
pow2_height
;
unsigned
int
i
;
HRESULT
hr
;
enum
wined3d_gl_resource_type
gl_type
;
unsigned
int
required_flags
=
0
,
ds_flags
=
WINED3DFMT_FLAG_DEPTH
|
WINED3DFMT_FLAG_STENCIL
;
const
struct
wined3d_format
*
format
;
/* TODO: It should only be possible to create textures for formats
* that are reported as supported. */
...
...
@@ -1084,6 +1087,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
WARN
(
"(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN.
\n
"
,
texture
);
return
WINED3DERR_INVALIDCALL
;
}
format
=
wined3d_get_format
(
gl_info
,
desc
->
format
);
/* Non-power2 support. */
if
(
gl_info
->
supported
[
ARB_TEXTURE_NON_POWER_OF_TWO
])
...
...
@@ -1134,6 +1138,23 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
}
}
if
(
desc
->
usage
&
WINED3DUSAGE_TEXTURE
)
required_flags
|=
WINED3DFMT_FLAG_TEXTURE
;
if
(
desc
->
usage
&
WINED3DUSAGE_RENDERTARGET
)
required_flags
|=
WINED3DFMT_FLAG_RENDERTARGET
;
/* WINED3DUSAGE_DEPTHSTENCIL needs WINED3DFMT_FLAG_DEPTH or WINED3DFMT_FLAG_STENCIL, not both. */
if
((
format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
required_flags
)
==
required_flags
&&
(
!
(
desc
->
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
||
(
format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
ds_flags
))
&&
(
gl_info
->
supported
[
WINED3D_GL_NORMALIZED_TEXRECT
]
||
(
desc
->
width
==
pow2_width
&&
desc
->
height
==
pow2_height
)))
gl_type
=
WINED3D_GL_RES_TYPE_TEX_2D
;
else
if
((
format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_RECT
]
&
required_flags
)
==
required_flags
&&
(
!
(
desc
->
usage
&
WINED3DUSAGE_DEPTHSTENCIL
)
||
(
format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_RECT
]
&
ds_flags
)))
gl_type
=
WINED3D_GL_RES_TYPE_TEX_RECT
;
else
gl_type
=
WINED3D_GL_RES_TYPE_TEX_2D
;
/* No error, may be SCRATCH pool or emulated conditional np2. */
if
(
FAILED
(
hr
=
wined3d_texture_init
(
texture
,
&
texture2d_ops
,
1
,
levels
,
desc
,
surface_flags
,
WINED3D_GL_RES_TYPE_TEX_2D
,
device
,
parent
,
parent_ops
,
&
texture_resource_ops
)))
{
...
...
@@ -1142,18 +1163,7 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
}
/* Precalculated scaling for 'faked' non power of two texture coords. */
if
(
gl_info
->
supported
[
WINED3D_GL_NORMALIZED_TEXRECT
]
&&
(
desc
->
width
!=
pow2_width
||
desc
->
height
!=
pow2_height
))
{
texture
->
pow2_matrix
[
0
]
=
1
.
0
f
;
texture
->
pow2_matrix
[
5
]
=
1
.
0
f
;
texture
->
pow2_matrix
[
10
]
=
1
.
0
f
;
texture
->
pow2_matrix
[
15
]
=
1
.
0
f
;
texture
->
target
=
GL_TEXTURE_2D
;
texture
->
flags
|=
WINED3D_TEXTURE_COND_NP2
;
}
else
if
(
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
]
&&
(
desc
->
width
!=
pow2_width
||
desc
->
height
!=
pow2_height
))
if
(
gl_type
==
WINED3D_GL_RES_TYPE_TEX_RECT
)
{
texture
->
pow2_matrix
[
0
]
=
(
float
)
desc
->
width
;
texture
->
pow2_matrix
[
5
]
=
(
float
)
desc
->
height
;
...
...
@@ -1165,21 +1175,26 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
}
else
{
if
((
desc
->
width
!=
pow2_width
)
||
(
desc
->
height
!=
pow2_height
))
texture
->
target
=
GL_TEXTURE_2D
;
if
(
desc
->
width
==
pow2_width
&&
desc
->
height
==
pow2_height
)
{
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
->
pow2_matrix
[
0
]
=
1
.
0
f
;
texture
->
pow2_matrix
[
5
]
=
1
.
0
f
;
}
else
else
if
(
gl_info
->
supported
[
WINED3D_GL_NORMALIZED_TEXRECT
])
{
texture
->
pow2_matrix
[
0
]
=
1
.
0
f
;
texture
->
pow2_matrix
[
5
]
=
1
.
0
f
;
texture
->
flags
|=
WINED3D_TEXTURE_COND_NP2
;
}
else
{
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
->
pow2_matrix
[
10
]
=
1
.
0
f
;
texture
->
pow2_matrix
[
15
]
=
1
.
0
f
;
texture
->
target
=
GL_TEXTURE_2D
;
}
TRACE
(
"xf(%f) yf(%f)
\n
"
,
texture
->
pow2_matrix
[
0
],
texture
->
pow2_matrix
[
5
]);
...
...
dlls/wined3d/utils.c
View file @
0152b0da
...
...
@@ -1861,6 +1861,7 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win
format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_3D
]
|=
format_texture_info
[
i
].
flags
;
if
(
gl_info
->
supported
[
ARB_TEXTURE_CUBE_MAP
])
format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_CUBE
]
|=
format_texture_info
[
i
].
flags
;
if
(
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
])
format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_RECT
]
|=
format_texture_info
[
i
].
flags
;
format
->
flags
[
WINED3D_GL_RES_TYPE_BUFFER
]
|=
format_texture_info
[
i
].
flags
;
...
...
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