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
0e22aea0
Commit
0e22aea0
authored
Mar 28, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Replace "pow2_matrix_identity" in wined3d_texture with a flag.
parent
e111acdf
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
11 deletions
+8
-11
shader.c
dlls/wined3d/shader.c
+1
-1
state.c
dlls/wined3d/state.c
+2
-4
texture.c
dlls/wined3d/texture.c
+4
-5
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/shader.c
View file @
0e22aea0
...
...
@@ -2101,7 +2101,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
args
->
shadow
|=
1
<<
i
;
/* Flag samplers that need NP2 texcoord fixup. */
if
(
!
texture
->
pow2_matrix_identity
)
if
(
!
(
texture
->
flags
&
WINED3D_TEXTURE_POW2_MAT_IDENT
)
)
args
->
np2_fixup
|=
(
1
<<
i
);
}
if
(
shader
->
baseShader
.
reg_maps
.
shader_version
.
major
>=
3
)
...
...
dlls/wined3d/state.c
View file @
0e22aea0
...
...
@@ -3600,7 +3600,7 @@ static void sampler_texmatrix(DWORD state, struct wined3d_stateblock *stateblock
*/
if
(
sampler
<
MAX_TEXTURES
)
{
const
BOOL
texIsPow2
=
!
texture
->
pow2_matrix_identity
;
const
BOOL
texIsPow2
=
!
(
texture
->
flags
&
WINED3D_TEXTURE_POW2_MAT_IDENT
)
;
if
(
texIsPow2
||
(
context
->
lastWasPow2Texture
&
(
1
<<
sampler
)))
{
...
...
@@ -3671,11 +3671,9 @@ static void sampler(DWORD state_id, struct wined3d_stateblock *stateblock, struc
}
/* Trigger shader constant reloading (for NP2 texcoord fixup) */
if
(
!
texture
->
pow2_matrix_identity
)
{
if
(
!
(
texture
->
flags
&
WINED3D_TEXTURE_POW2_MAT_IDENT
))
device
->
shader_backend
->
shader_load_np2fixup_constants
(
device
->
shader_priv
,
gl_info
,
state
);
}
}
else
if
(
mapped_stage
<
gl_info
->
limits
.
textures
)
{
if
(
sampler
<
state
->
lowest_disabled_stage
)
...
...
dlls/wined3d/texture.c
View file @
0e22aea0
...
...
@@ -58,8 +58,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
texture
->
texture_rgb
.
dirty
=
TRUE
;
texture
->
texture_srgb
.
dirty
=
TRUE
;
texture
->
is_srgb
=
FALSE
;
texture
->
pow2_matrix_identity
=
TRUE
;
texture
->
flags
=
0
;
texture
->
flags
=
WINED3D_TEXTURE_POW2_MAT_IDENT
;
if
(
texture
->
resource
.
format
->
flags
&
WINED3DFMT_FLAG_FILTERING
)
{
...
...
@@ -900,7 +899,7 @@ HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_length, UINT
texture
->
pow2_matrix
[
5
]
=
((
float
)
edge_length
)
/
((
float
)
pow2_edge_length
);
texture
->
pow2_matrix
[
10
]
=
((
float
)
edge_length
)
/
((
float
)
pow2_edge_length
);
texture
->
pow2_matrix
[
15
]
=
1
.
0
f
;
texture
->
pow2_matrix_identity
=
FALSE
;
texture
->
flags
&=
~
WINED3D_TEXTURE_POW2_MAT_IDENT
;
}
texture
->
target
=
GL_TEXTURE_CUBE_MAP_ARB
;
...
...
@@ -1037,7 +1036,7 @@ HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT height, U
&&
wined3d_settings
.
rendertargetlock_mode
==
RTL_READTEX
))
{
if
(
width
!=
1
||
height
!=
1
)
texture
->
pow2_matrix_identity
=
FALSE
;
texture
->
flags
&=
~
WINED3D_TEXTURE_POW2_MAT_IDENT
;
texture
->
pow2_matrix
[
0
]
=
(
float
)
width
;
texture
->
pow2_matrix
[
5
]
=
(
float
)
height
;
...
...
@@ -1055,9 +1054,9 @@ HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT height, U
{
if
((
width
!=
pow2_width
)
||
(
height
!=
pow2_height
))
{
texture
->
pow2_matrix_identity
=
FALSE
;
texture
->
pow2_matrix
[
0
]
=
(((
float
)
width
)
/
((
float
)
pow2_width
));
texture
->
pow2_matrix
[
5
]
=
(((
float
)
height
)
/
((
float
)
pow2_height
));
texture
->
flags
&=
~
WINED3D_TEXTURE_POW2_MAT_IDENT
;
}
else
{
...
...
dlls/wined3d/wined3d_private.h
View file @
0e22aea0
...
...
@@ -1889,6 +1889,7 @@ struct wined3d_texture_ops
};
#define WINED3D_TEXTURE_COND_NP2 0x1
#define WINED3D_TEXTURE_POW2_MAT_IDENT 0x2
struct
wined3d_texture
{
...
...
@@ -1905,7 +1906,6 @@ struct wined3d_texture
DWORD
sampler
;
BOOL
is_srgb
;
DWORD
flags
;
BOOL
pow2_matrix_identity
;
const
struct
min_lookup
*
min_mip_lookup
;
const
GLenum
*
mag_lookup
;
GLenum
target
;
...
...
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