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
980711a8
Commit
980711a8
authored
Dec 30, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Handle texture LOD in wined3d_sampler_desc_from_sampler_states().
parent
bf9c544e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
18 deletions
+17
-18
context_gl.c
dlls/wined3d/context_gl.c
+1
-1
sampler.c
dlls/wined3d/sampler.c
+3
-11
state.c
dlls/wined3d/state.c
+9
-1
texture.c
dlls/wined3d/texture.c
+3
-3
view.c
dlls/wined3d/view.c
+1
-1
wined3d_gl.h
dlls/wined3d/wined3d_gl.h
+0
-1
No files found.
dlls/wined3d/context_gl.c
View file @
980711a8
...
@@ -5920,7 +5920,7 @@ static void apply_texture_blit_state(const struct wined3d_gl_info *gl_info, stru
...
@@ -5920,7 +5920,7 @@ static void apply_texture_blit_state(const struct wined3d_gl_info *gl_info, stru
texture
->
sampler_desc
.
address_u
=
WINED3D_TADDRESS_CLAMP
;
texture
->
sampler_desc
.
address_u
=
WINED3D_TADDRESS_CLAMP
;
texture
->
sampler_desc
.
address_v
=
WINED3D_TADDRESS_CLAMP
;
texture
->
sampler_desc
.
address_v
=
WINED3D_TADDRESS_CLAMP
;
texture
->
sampler_desc
.
srgb_decode
=
FALSE
;
texture
->
sampler_desc
.
srgb_decode
=
FALSE
;
texture
->
base_level
=
level
;
texture
->
sampler_desc
.
mip_
base_level
=
level
;
}
}
/* Context activation is done by the caller. */
/* Context activation is done by the caller. */
...
...
dlls/wined3d/sampler.c
View file @
980711a8
...
@@ -307,24 +307,16 @@ static void texture_gl_apply_base_level(struct wined3d_texture_gl *texture_gl,
...
@@ -307,24 +307,16 @@ static void texture_gl_apply_base_level(struct wined3d_texture_gl *texture_gl,
const
struct
wined3d_sampler_desc
*
desc
,
const
struct
wined3d_gl_info
*
gl_info
)
const
struct
wined3d_sampler_desc
*
desc
,
const
struct
wined3d_gl_info
*
gl_info
)
{
{
struct
gl_texture
*
gl_tex
;
struct
gl_texture
*
gl_tex
;
unsigned
int
base_level
;
if
(
texture_gl
->
t
.
flags
&
WINED3D_TEXTURE_COND_NP2
)
base_level
=
0
;
else
if
(
desc
->
mip_filter
==
WINED3D_TEXF_NONE
)
base_level
=
texture_gl
->
t
.
lod
;
else
base_level
=
min
(
max
(
desc
->
mip_base_level
,
texture_gl
->
t
.
lod
),
texture_gl
->
t
.
level_count
-
1
);
gl_tex
=
wined3d_texture_gl_get_gl_texture
(
texture_gl
,
texture_gl
->
t
.
flags
&
WINED3D_TEXTURE_IS_SRGB
);
gl_tex
=
wined3d_texture_gl_get_gl_texture
(
texture_gl
,
texture_gl
->
t
.
flags
&
WINED3D_TEXTURE_IS_SRGB
);
if
(
base_level
!=
gl_tex
->
base_level
)
if
(
desc
->
mip_base_level
!=
gl_tex
->
sampler_desc
.
mip_
base_level
)
{
{
/* Note that WINED3D_SAMP_MAX_MIP_LEVEL specifies the largest mipmap
/* Note that WINED3D_SAMP_MAX_MIP_LEVEL specifies the largest mipmap
* (default 0), while GL_TEXTURE_MAX_LEVEL specifies the smallest
* (default 0), while GL_TEXTURE_MAX_LEVEL specifies the smallest
* mipmap used (default 1000). So WINED3D_SAMP_MAX_MIP_LEVEL
* mipmap used (default 1000). So WINED3D_SAMP_MAX_MIP_LEVEL
* corresponds to GL_TEXTURE_BASE_LEVEL. */
* corresponds to GL_TEXTURE_BASE_LEVEL. */
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
texture_gl
->
target
,
GL_TEXTURE_BASE_LEVEL
,
base_level
);
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
texture_gl
->
target
,
GL_TEXTURE_BASE_LEVEL
,
desc
->
mip_
base_level
);
gl_tex
->
base_level
=
base_level
;
gl_tex
->
sampler_desc
.
mip_base_level
=
desc
->
mip_
base_level
;
}
}
}
}
...
...
dlls/wined3d/state.c
View file @
980711a8
...
@@ -3499,7 +3499,15 @@ static void wined3d_sampler_desc_from_sampler_states(struct wined3d_sampler_desc
...
@@ -3499,7 +3499,15 @@ static void wined3d_sampler_desc_from_sampler_states(struct wined3d_sampler_desc
desc
->
lod_bias
=
lod_bias
.
f
;
desc
->
lod_bias
=
lod_bias
.
f
;
desc
->
min_lod
=
-
1000
.
0
f
;
desc
->
min_lod
=
-
1000
.
0
f
;
desc
->
max_lod
=
1000
.
0
f
;
desc
->
max_lod
=
1000
.
0
f
;
desc
->
mip_base_level
=
sampler_states
[
WINED3D_SAMP_MAX_MIP_LEVEL
];
/* The LOD is already clamped to texture->level_count in wined3d_texture_set_lod(). */
if
(
texture
->
flags
&
WINED3D_TEXTURE_COND_NP2
)
desc
->
mip_base_level
=
0
;
else
if
(
desc
->
mip_filter
==
WINED3D_TEXF_NONE
)
desc
->
mip_base_level
=
texture
->
lod
;
else
desc
->
mip_base_level
=
min
(
max
(
sampler_states
[
WINED3D_SAMP_MAX_MIP_LEVEL
],
texture
->
lod
),
texture
->
level_count
-
1
);
desc
->
max_anisotropy
=
sampler_states
[
WINED3D_SAMP_MAX_ANISOTROPY
];
desc
->
max_anisotropy
=
sampler_states
[
WINED3D_SAMP_MAX_ANISOTROPY
];
if
((
sampler_states
[
WINED3D_SAMP_MAG_FILTER
]
!=
WINED3D_TEXF_ANISOTROPIC
if
((
sampler_states
[
WINED3D_SAMP_MAG_FILTER
]
!=
WINED3D_TEXF_ANISOTROPIC
&&
sampler_states
[
WINED3D_SAMP_MIN_FILTER
]
!=
WINED3D_TEXF_ANISOTROPIC
&&
sampler_states
[
WINED3D_SAMP_MIN_FILTER
]
!=
WINED3D_TEXF_ANISOTROPIC
...
...
dlls/wined3d/texture.c
View file @
980711a8
...
@@ -1319,7 +1319,7 @@ void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl,
...
@@ -1319,7 +1319,7 @@ void wined3d_texture_gl_bind(struct wined3d_texture_gl *texture_gl,
gl_tex
->
sampler_desc
.
srgb_decode
=
TRUE
;
gl_tex
->
sampler_desc
.
srgb_decode
=
TRUE
;
else
else
gl_tex
->
sampler_desc
.
srgb_decode
=
srgb
;
gl_tex
->
sampler_desc
.
srgb_decode
=
srgb
;
gl_tex
->
base_level
=
0
;
gl_tex
->
sampler_desc
.
mip_
base_level
=
0
;
wined3d_texture_set_dirty
(
&
texture_gl
->
t
);
wined3d_texture_set_dirty
(
&
texture_gl
->
t
);
wined3d_context_gl_bind_texture
(
context_gl
,
target
,
gl_tex
->
name
);
wined3d_context_gl_bind_texture
(
context_gl
,
target
,
gl_tex
->
name
);
...
@@ -1757,8 +1757,8 @@ unsigned int CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, unsi
...
@@ -1757,8 +1757,8 @@ unsigned int CDECL wined3d_texture_set_lod(struct wined3d_texture *texture, unsi
wined3d_resource_wait_idle
(
resource
);
wined3d_resource_wait_idle
(
resource
);
texture
->
lod
=
lod
;
texture
->
lod
=
lod
;
wined3d_texture_gl
(
texture
)
->
texture_rgb
.
base_level
=
~
0u
;
wined3d_texture_gl
(
texture
)
->
texture_rgb
.
sampler_desc
.
mip_
base_level
=
~
0u
;
wined3d_texture_gl
(
texture
)
->
texture_srgb
.
base_level
=
~
0u
;
wined3d_texture_gl
(
texture
)
->
texture_srgb
.
sampler_desc
.
mip_
base_level
=
~
0u
;
if
(
resource
->
bind_count
)
if
(
resource
->
bind_count
)
wined3d_device_context_emit_set_sampler_state
(
&
device
->
cs
->
c
,
texture
->
sampler
,
WINED3D_SAMP_MAX_MIP_LEVEL
,
wined3d_device_context_emit_set_sampler_state
(
&
device
->
cs
->
c
,
texture
->
sampler
,
WINED3D_SAMP_MAX_MIP_LEVEL
,
device
->
cs
->
c
.
state
->
sampler_states
[
texture
->
sampler
][
WINED3D_SAMP_MAX_MIP_LEVEL
]);
device
->
cs
->
c
.
state
->
sampler_states
[
texture
->
sampler
][
WINED3D_SAMP_MAX_MIP_LEVEL
]);
...
...
dlls/wined3d/view.c
View file @
980711a8
...
@@ -1350,7 +1350,7 @@ void wined3d_shader_resource_view_gl_generate_mipmap(struct wined3d_shader_resou
...
@@ -1350,7 +1350,7 @@ void wined3d_shader_resource_view_gl_generate_mipmap(struct wined3d_shader_resou
if
(
!
view_gl
->
gl_view
.
name
)
if
(
!
view_gl
->
gl_view
.
name
)
{
{
gl_tex
->
base_level
=
base_level
;
gl_tex
->
sampler_desc
.
mip_
base_level
=
base_level
;
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
texture_gl
->
target
,
gl_info
->
gl_ops
.
gl
.
p_glTexParameteri
(
texture_gl
->
target
,
GL_TEXTURE_MAX_LEVEL
,
texture_gl
->
t
.
level_count
-
1
);
GL_TEXTURE_MAX_LEVEL
,
texture_gl
->
t
.
level_count
-
1
);
}
}
...
...
dlls/wined3d/wined3d_gl.h
View file @
980711a8
...
@@ -943,7 +943,6 @@ static inline void wined3d_context_gl_reference_buffer(struct wined3d_context_gl
...
@@ -943,7 +943,6 @@ static inline void wined3d_context_gl_reference_buffer(struct wined3d_context_gl
struct
gl_texture
struct
gl_texture
{
{
struct
wined3d_sampler_desc
sampler_desc
;
struct
wined3d_sampler_desc
sampler_desc
;
unsigned
int
base_level
;
GLuint
name
;
GLuint
name
;
};
};
...
...
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