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
bf9c544e
Commit
bf9c544e
authored
Dec 29, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a wined3d_texture to wined3d_sampler_desc_from_sampler_states().
parent
f1db8976
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
state.c
dlls/wined3d/state.c
+12
-12
No files found.
dlls/wined3d/state.c
View file @
bf9c544e
...
...
@@ -3451,7 +3451,7 @@ static void sampler_texmatrix(struct wined3d_context *context, const struct wine
}
}
static
enum
wined3d_texture_address
wined3d_texture_
gl_address_mode
(
const
struct
wined3d_texture_gl
*
texture_gl
,
static
enum
wined3d_texture_address
wined3d_texture_
address_mode
(
const
struct
wined3d_texture
*
texture
,
enum
wined3d_texture_address
t
)
{
if
(
t
<
WINED3D_TADDRESS_WRAP
||
t
>
WINED3D_TADDRESS_MIRROR_ONCE
)
...
...
@@ -3461,8 +3461,8 @@ static enum wined3d_texture_address wined3d_texture_gl_address_mode(const struct
}
/* Cubemaps are always set to clamp, regardless of the sampler state. */
if
(
texture_gl
->
target
==
GL_TEXTURE_CUBE_MAP_ARB
||
((
texture_gl
->
t
.
flags
&
WINED3D_TEXTURE_COND_NP2
)
&&
t
==
WINED3D_TADDRESS_WRAP
))
if
(
(
texture
->
resource
.
usage
&
WINED3DUSAGE_LEGACY_CUBEMAP
)
||
((
texture
->
flags
&
WINED3D_TEXTURE_COND_NP2
)
&&
t
==
WINED3D_TADDRESS_WRAP
))
return
WINED3D_TADDRESS_CLAMP
;
return
t
;
...
...
@@ -3470,7 +3470,7 @@ static enum wined3d_texture_address wined3d_texture_gl_address_mode(const struct
static
void
wined3d_sampler_desc_from_sampler_states
(
struct
wined3d_sampler_desc
*
desc
,
const
struct
wined3d_context_gl
*
context_gl
,
const
uint32_t
*
sampler_states
,
const
struct
wined3d_texture
_gl
*
texture_gl
)
const
struct
wined3d_texture
*
texture
)
{
union
{
...
...
@@ -3478,9 +3478,9 @@ static void wined3d_sampler_desc_from_sampler_states(struct wined3d_sampler_desc
DWORD
d
;
}
lod_bias
;
desc
->
address_u
=
wined3d_texture_
gl_address_mode
(
texture_gl
,
sampler_states
[
WINED3D_SAMP_ADDRESS_U
]);
desc
->
address_v
=
wined3d_texture_
gl_address_mode
(
texture_gl
,
sampler_states
[
WINED3D_SAMP_ADDRESS_V
]);
desc
->
address_w
=
wined3d_texture_
gl_address_mode
(
texture_gl
,
sampler_states
[
WINED3D_SAMP_ADDRESS_W
]);
desc
->
address_u
=
wined3d_texture_
address_mode
(
texture
,
sampler_states
[
WINED3D_SAMP_ADDRESS_U
]);
desc
->
address_v
=
wined3d_texture_
address_mode
(
texture
,
sampler_states
[
WINED3D_SAMP_ADDRESS_V
]);
desc
->
address_w
=
wined3d_texture_
address_mode
(
texture
,
sampler_states
[
WINED3D_SAMP_ADDRESS_W
]);
wined3d_color_from_d3dcolor
((
struct
wined3d_color
*
)
desc
->
border_color
,
sampler_states
[
WINED3D_SAMP_BORDER_COLOR
]);
if
(
sampler_states
[
WINED3D_SAMP_MAG_FILTER
]
>
WINED3D_TEXF_ANISOTROPIC
)
...
...
@@ -3504,20 +3504,20 @@ static void wined3d_sampler_desc_from_sampler_states(struct wined3d_sampler_desc
if
((
sampler_states
[
WINED3D_SAMP_MAG_FILTER
]
!=
WINED3D_TEXF_ANISOTROPIC
&&
sampler_states
[
WINED3D_SAMP_MIN_FILTER
]
!=
WINED3D_TEXF_ANISOTROPIC
&&
sampler_states
[
WINED3D_SAMP_MIP_FILTER
]
!=
WINED3D_TEXF_ANISOTROPIC
)
||
(
texture
_gl
->
t
.
flags
&
WINED3D_TEXTURE_COND_NP2
))
||
(
texture
->
flags
&
WINED3D_TEXTURE_COND_NP2
))
desc
->
max_anisotropy
=
1
;
desc
->
compare
=
texture
_gl
->
t
.
resource
.
format_caps
&
WINED3D_FORMAT_CAP_SHADOW
;
desc
->
compare
=
texture
->
resource
.
format_caps
&
WINED3D_FORMAT_CAP_SHADOW
;
desc
->
comparison_func
=
WINED3D_CMP_LESSEQUAL
;
desc
->
srgb_decode
=
is_srgb_enabled
(
sampler_states
);
if
(
!
(
texture
_gl
->
t
.
resource
.
format_caps
&
WINED3D_FORMAT_CAP_FILTERING
))
if
(
!
(
texture
->
resource
.
format_caps
&
WINED3D_FORMAT_CAP_FILTERING
))
{
desc
->
mag_filter
=
WINED3D_TEXF_POINT
;
desc
->
min_filter
=
WINED3D_TEXF_POINT
;
desc
->
mip_filter
=
WINED3D_TEXF_NONE
;
}
if
(
texture
_gl
->
t
.
flags
&
WINED3D_TEXTURE_COND_NP2
)
if
(
texture
->
flags
&
WINED3D_TEXTURE_COND_NP2
)
{
desc
->
mip_filter
=
WINED3D_TEXF_NONE
;
if
(
context_gl
->
gl_info
->
supported
[
WINED3D_GL_NORMALIZED_TEXRECT
])
...
...
@@ -3557,7 +3557,7 @@ static void sampler(struct wined3d_context *context, const struct wined3d_state
struct
wined3d_sampler
*
sampler
;
struct
wine_rb_entry
*
entry
;
wined3d_sampler_desc_from_sampler_states
(
&
desc
,
context_gl
,
sampler_states
,
texture_gl
);
wined3d_sampler_desc_from_sampler_states
(
&
desc
,
context_gl
,
sampler_states
,
&
texture_gl
->
t
);
wined3d_texture_gl_bind
(
texture_gl
,
context_gl
,
srgb
);
...
...
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