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
9492a10f
Commit
9492a10f
authored
Mar 19, 2024
by
Paul Gofman
Committed by
Alexandre Julliard
Mar 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Factor out wined3d_texture_set_lod() function.
parent
2e088045
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
17 deletions
+28
-17
stateblock.c
dlls/wined3d/stateblock.c
+3
-17
texture.c
dlls/wined3d/texture.c
+24
-0
wined3d.h
include/wine/wined3d.h
+1
-0
No files found.
dlls/wined3d/stateblock.c
View file @
9492a10f
...
...
@@ -3321,28 +3321,14 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
unsigned
int
CDECL
wined3d_stateblock_set_texture_lod
(
struct
wined3d_stateblock
*
stateblock
,
struct
wined3d_texture
*
texture
,
unsigned
int
lod
)
{
struct
wined3d_resource
*
resource
;
unsigned
int
old
=
texture
->
lod
;
unsigned
int
old
;
TRACE
(
"texture %p, lod %u.
\n
"
,
texture
,
lod
);
/* The d3d9:texture test shows that SetLOD is ignored on non-managed
* textures. The call always returns 0, and GetLOD always returns 0. */
resource
=
&
texture
->
resource
;
if
(
!
(
resource
->
usage
&
WINED3DUSAGE_MANAGED
))
{
TRACE
(
"Ignoring LOD on texture with resource access %s.
\n
"
,
wined3d_debug_resource_access
(
resource
->
access
));
return
0
;
}
old
=
wined3d_texture_set_lod
(
texture
,
lod
);
if
(
lod
>=
texture
->
level_count
)
lod
=
texture
->
level_count
-
1
;
if
(
texture
->
lod
!=
lod
)
if
(
old
!=
lod
)
{
texture
->
lod
=
lod
;
for
(
unsigned
int
i
=
0
;
i
<
WINED3D_MAX_COMBINED_SAMPLERS
;
++
i
)
{
/* Mark the texture as changed. The next time the appplication
...
...
dlls/wined3d/texture.c
View file @
9492a10f
...
...
@@ -1784,6 +1784,30 @@ unsigned int CDECL wined3d_texture_get_lod(const struct wined3d_texture *texture
return
texture
->
lod
;
}
unsigned
int
CDECL
wined3d_texture_set_lod
(
struct
wined3d_texture
*
texture
,
unsigned
int
lod
)
{
struct
wined3d_resource
*
resource
;
unsigned
int
old
=
texture
->
lod
;
TRACE
(
"texture %p, returning %u.
\n
"
,
texture
,
texture
->
lod
);
/* The d3d9:texture test shows that SetLOD is ignored on non-managed
* textures. The call always returns 0, and GetLOD always returns 0. */
resource
=
&
texture
->
resource
;
if
(
!
(
resource
->
usage
&
WINED3DUSAGE_MANAGED
))
{
TRACE
(
"Ignoring LOD on texture with resource access %s.
\n
"
,
wined3d_debug_resource_access
(
resource
->
access
));
return
0
;
}
if
(
lod
>=
texture
->
level_count
)
lod
=
texture
->
level_count
-
1
;
texture
->
lod
=
lod
;
return
old
;
}
UINT
CDECL
wined3d_texture_get_level_count
(
const
struct
wined3d_texture
*
texture
)
{
TRACE
(
"texture %p, returning %u.
\n
"
,
texture
,
texture
->
level_count
);
...
...
include/wine/wined3d.h
View file @
9492a10f
...
...
@@ -2883,6 +2883,7 @@ ULONG __cdecl wined3d_texture_decref(struct wined3d_texture *texture);
HRESULT
__cdecl
wined3d_texture_get_dc
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
HDC
*
dc
);
unsigned
int
__cdecl
wined3d_texture_get_level_count
(
const
struct
wined3d_texture
*
texture
);
unsigned
int
__cdecl
wined3d_texture_get_lod
(
const
struct
wined3d_texture
*
texture
);
unsigned
int
__cdecl
wined3d_texture_set_lod
(
struct
wined3d_texture
*
texture
,
unsigned
int
lod
);
HRESULT
__cdecl
wined3d_texture_get_overlay_position
(
const
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
LONG
*
x
,
LONG
*
y
);
void
*
__cdecl
wined3d_texture_get_parent
(
const
struct
wined3d_texture
*
texture
);
...
...
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