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
06b51143
Commit
06b51143
authored
Mar 09, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce helpers functions to calculate texture level dimensions.
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bc24fbf6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
7 deletions
+25
-7
texture.c
dlls/wined3d/texture.c
+7
-7
wined3d_private.h
dlls/wined3d/wined3d_private.h
+18
-0
No files found.
dlls/wined3d/texture.c
View file @
06b51143
...
...
@@ -532,8 +532,8 @@ void CDECL wined3d_texture_get_pitch(const struct wined3d_texture *texture,
unsigned
int
level
,
unsigned
int
*
row_pitch
,
unsigned
int
*
slice_pitch
)
{
const
struct
wined3d_resource
*
resource
=
&
texture
->
resource
;
unsigned
int
width
=
max
(
1
,
texture
->
resource
.
width
>>
level
);
unsigned
int
height
=
max
(
1
,
texture
->
resource
.
height
>>
level
);
unsigned
int
width
=
wined3d_texture_get_level_width
(
texture
,
level
);
unsigned
int
height
=
wined3d_texture_get_level_height
(
texture
,
level
);
if
(
texture
->
row_pitch
)
{
...
...
@@ -1322,8 +1322,8 @@ BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture,
unsigned
int
level
,
const
struct
wined3d_box
*
box
)
{
const
struct
wined3d_format
*
format
=
texture
->
resource
.
format
;
unsigned
int
height
=
max
(
1
,
texture
->
resource
.
height
>>
level
);
unsigned
int
width
=
max
(
1
,
texture
->
resource
.
width
>>
level
);
unsigned
int
height
=
wined3d_texture_get_level_height
(
texture
,
level
);
unsigned
int
width
=
wined3d_texture_get_level_width
(
texture
,
level
);
unsigned
int
width_mask
,
height_mask
;
if
((
box
->
left
>=
box
->
right
)
...
...
@@ -1709,9 +1709,9 @@ HRESULT CDECL wined3d_texture_get_sub_resource_desc(const struct wined3d_texture
desc
->
pool
=
resource
->
pool
;
level_idx
=
sub_resource_idx
%
texture
->
level_count
;
desc
->
width
=
max
(
1
,
resource
->
width
>>
level_idx
);
desc
->
height
=
max
(
1
,
resource
->
height
>>
level_idx
);
desc
->
depth
=
max
(
1
,
resource
->
depth
>>
level_idx
);
desc
->
width
=
wined3d_texture_get_level_width
(
texture
,
level_idx
);
desc
->
height
=
wined3d_texture_get_level_height
(
texture
,
level_idx
);
desc
->
depth
=
wined3d_texture_get_level_depth
(
texture
,
level_idx
);
desc
->
size
=
texture
->
sub_resources
[
sub_resource_idx
].
resource
->
size
;
return
WINED3D_OK
;
...
...
dlls/wined3d/wined3d_private.h
View file @
06b51143
...
...
@@ -2414,6 +2414,24 @@ static inline struct gl_texture *wined3d_texture_get_gl_texture(struct wined3d_t
return
srgb
?
&
texture
->
texture_srgb
:
&
texture
->
texture_rgb
;
}
static
inline
unsigned
int
wined3d_texture_get_level_width
(
const
struct
wined3d_texture
*
texture
,
unsigned
int
level
)
{
return
max
(
1
,
texture
->
resource
.
width
>>
level
);
}
static
inline
unsigned
int
wined3d_texture_get_level_height
(
const
struct
wined3d_texture
*
texture
,
unsigned
int
level
)
{
return
max
(
1
,
texture
->
resource
.
height
>>
level
);
}
static
inline
unsigned
int
wined3d_texture_get_level_depth
(
const
struct
wined3d_texture
*
texture
,
unsigned
int
level
)
{
return
max
(
1
,
texture
->
resource
.
depth
>>
level
);
}
void
wined3d_texture_apply_sampler_desc
(
struct
wined3d_texture
*
texture
,
const
struct
wined3d_sampler_desc
*
sampler_desc
,
const
struct
wined3d_context
*
context
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_bind
(
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