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
a2c81ada
Commit
a2c81ada
authored
Jan 03, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 04, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass an IWineD3DBaseTextureImpl pointer to basetexture_apply_state_changes().
parent
32779a22
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
23 deletions
+21
-23
basetexture.c
dlls/wined3d/basetexture.c
+17
-19
state.c
dlls/wined3d/state.c
+3
-3
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/basetexture.c
View file @
a2c81ada
...
...
@@ -370,24 +370,22 @@ static void apply_wrap(const struct wined3d_gl_info *gl_info, GLenum target,
}
/* GL locking is done by the caller (state handler) */
void
basetexture_apply_state_changes
(
IWineD3DBaseTexture
*
ifac
e
,
void
basetexture_apply_state_changes
(
IWineD3DBaseTexture
Impl
*
textur
e
,
const
DWORD
samplerStates
[
WINED3D_HIGHEST_SAMPLER_STATE
+
1
],
const
struct
wined3d_gl_info
*
gl_info
)
{
IWineD3DBaseTextureImpl
*
This
=
(
IWineD3DBaseTextureImpl
*
)
iface
;
GLenum
textureDimensions
=
This
->
baseTexture
.
target
;
BOOL
cond_np2
=
IWineD3DBaseTexture_IsCondNP2
((
IWineD3DBaseTexture
*
)
texture
)
;
GLenum
textureDimensions
=
texture
->
baseTexture
.
target
;
DWORD
state
;
BOOL
cond_np2
=
IWineD3DBaseTexture_IsCondNP2
(
iface
);
DWORD
aniso
;
struct
gl_texture
*
gl_tex
;
TRACE
(
"
iface %p, samplerStates %p
\n
"
,
ifac
e
,
samplerStates
);
TRACE
(
"
texture %p, samplerStates %p
\n
"
,
textur
e
,
samplerStates
);
if
(
This
->
baseTexture
.
is_srgb
)
{
gl_tex
=
&
This
->
baseTexture
.
texture_srgb
;
}
else
{
gl_tex
=
&
This
->
baseTexture
.
texture_rgb
;
}
if
(
texture
->
baseTexture
.
is_srgb
)
gl_tex
=
&
texture
->
baseTexture
.
texture_srgb
;
else
gl_tex
=
&
texture
->
baseTexture
.
texture_rgb
;
/* This function relies on the correct texture being bound and loaded. */
...
...
@@ -427,7 +425,7 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
FIXME
(
"Unrecognized or unsupported MAGFILTER* value %d
\n
"
,
state
);
}
glValue
=
wined3d_gl_mag_filter
(
This
->
baseTexture
.
magLookup
,
glValue
=
wined3d_gl_mag_filter
(
texture
->
baseTexture
.
magLookup
,
min
(
max
(
state
,
WINED3DTEXF_POINT
),
WINED3DTEXF_LINEAR
));
TRACE
(
"ValueMAG=%d setting MAGFILTER to %x
\n
"
,
state
,
glValue
);
glTexParameteri
(
textureDimensions
,
GL_TEXTURE_MAG_FILTER
,
glValue
);
...
...
@@ -452,7 +450,7 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
gl_tex
->
states
[
WINED3DTEXSTA_MINFILTER
],
gl_tex
->
states
[
WINED3DTEXSTA_MIPFILTER
]);
}
glValue
=
wined3d_gl_min_mip_filter
(
This
->
baseTexture
.
minMipLookup
,
glValue
=
wined3d_gl_min_mip_filter
(
texture
->
baseTexture
.
minMipLookup
,
min
(
max
(
samplerStates
[
WINED3DSAMP_MINFILTER
],
WINED3DTEXF_POINT
),
WINED3DTEXF_LINEAR
),
min
(
max
(
samplerStates
[
WINED3DSAMP_MIPFILTER
],
WINED3DTEXF_NONE
),
WINED3DTEXF_LINEAR
));
...
...
@@ -465,12 +463,12 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
if
(
!
cond_np2
)
{
if
(
gl_tex
->
states
[
WINED3DTEXSTA_MIPFILTER
]
==
WINED3DTEXF_NONE
)
glValue
=
This
->
baseTexture
.
LOD
;
else
if
(
gl_tex
->
states
[
WINED3DTEXSTA_MAXMIPLEVEL
]
>=
This
->
baseTexture
.
level_count
)
glValue
=
This
->
baseTexture
.
level_count
-
1
;
else
if
(
gl_tex
->
states
[
WINED3DTEXSTA_MAXMIPLEVEL
]
<
This
->
baseTexture
.
LOD
)
glValue
=
texture
->
baseTexture
.
LOD
;
else
if
(
gl_tex
->
states
[
WINED3DTEXSTA_MAXMIPLEVEL
]
>=
texture
->
baseTexture
.
level_count
)
glValue
=
texture
->
baseTexture
.
level_count
-
1
;
else
if
(
gl_tex
->
states
[
WINED3DTEXSTA_MAXMIPLEVEL
]
<
texture
->
baseTexture
.
LOD
)
/* baseTexture.LOD is already clamped in the setter */
glValue
=
This
->
baseTexture
.
LOD
;
glValue
=
texture
->
baseTexture
.
LOD
;
else
glValue
=
gl_tex
->
states
[
WINED3DTEXSTA_MAXMIPLEVEL
];
...
...
@@ -508,10 +506,10 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
gl_tex
->
states
[
WINED3DTEXSTA_MAXANISOTROPY
]
=
aniso
;
}
if
(
!
(
This
->
resource
.
format
->
flags
&
WINED3DFMT_FLAG_SHADOW
)
if
(
!
(
texture
->
resource
.
format
->
flags
&
WINED3DFMT_FLAG_SHADOW
)
!=
!
gl_tex
->
states
[
WINED3DTEXSTA_SHADOW
])
{
if
(
This
->
resource
.
format
->
flags
&
WINED3DFMT_FLAG_SHADOW
)
if
(
texture
->
resource
.
format
->
flags
&
WINED3DFMT_FLAG_SHADOW
)
{
glTexParameteri
(
textureDimensions
,
GL_DEPTH_TEXTURE_MODE_ARB
,
GL_LUMINANCE
);
glTexParameteri
(
textureDimensions
,
GL_TEXTURE_COMPARE_MODE_ARB
,
GL_COMPARE_R_TO_TEXTURE_ARB
);
...
...
dlls/wined3d/state.c
View file @
a2c81ada
...
...
@@ -3643,10 +3643,10 @@ static void sampler(DWORD state_id, IWineD3DStateBlockImpl *stateblock, struct w
if
(
state
->
textures
[
sampler
])
{
IWineD3DBaseTexture
*
texture
=
(
IWineD3DBaseTexture
*
)
state
->
textures
[
sampler
];
IWineD3DBaseTexture
Impl
*
texture
=
state
->
textures
[
sampler
];
BOOL
srgb
=
state
->
sampler_states
[
sampler
][
WINED3DSAMP_SRGBTEXTURE
];
IWineD3DBaseTexture_BindTexture
(
texture
,
srgb
);
IWineD3DBaseTexture_BindTexture
(
(
IWineD3DBaseTexture
*
)
texture
,
srgb
);
basetexture_apply_state_changes
(
texture
,
state
->
sampler_states
[
sampler
],
gl_info
);
...
...
@@ -3671,7 +3671,7 @@ static void sampler(DWORD state_id, IWineD3DStateBlockImpl *stateblock, struct w
}
/* Trigger shader constant reloading (for NP2 texcoord fixup) */
if
(
!
state
->
textures
[
sampler
]
->
baseTexture
.
pow2Matrix_identity
)
if
(
!
texture
->
baseTexture
.
pow2Matrix_identity
)
{
device
->
shader_backend
->
shader_load_np2fixup_constants
(
device
->
shader_priv
,
gl_info
,
state
);
}
...
...
dlls/wined3d/wined3d_private.h
View file @
a2c81ada
...
...
@@ -1909,7 +1909,7 @@ typedef struct IWineD3DBaseTextureImpl
}
IWineD3DBaseTextureImpl
;
void
basetexture_apply_state_changes
(
IWineD3DBaseTexture
*
ifac
e
,
void
basetexture_apply_state_changes
(
IWineD3DBaseTexture
Impl
*
textur
e
,
const
DWORD
samplerStates
[
WINED3D_HIGHEST_SAMPLER_STATE
+
1
],
const
struct
wined3d_gl_info
*
gl_info
)
DECLSPEC_HIDDEN
;
HRESULT
basetexture_bind
(
IWineD3DBaseTextureImpl
*
texture
,
BOOL
srgb
,
BOOL
*
set_surface_desc
)
DECLSPEC_HIDDEN
;
...
...
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