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
65c04ce0
Commit
65c04ce0
authored
Feb 09, 2016
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce wined3d_texture_get_pitch().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a95524b8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
18 deletions
+30
-18
surface.c
dlls/wined3d/surface.c
+2
-15
texture.c
dlls/wined3d/texture.c
+24
-1
volume.c
dlls/wined3d/volume.c
+1
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-0
No files found.
dlls/wined3d/surface.c
View file @
65c04ce0
...
...
@@ -1887,11 +1887,7 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
TRACE
(
"surface %p.
\n
"
,
surface
);
if
(
surface
->
container
->
row_pitch
)
return
surface
->
container
->
row_pitch
;
wined3d_format_calculate_pitch
(
surface
->
resource
.
format
,
surface
->
resource
.
device
->
surface_alignment
,
surface
->
resource
.
width
,
surface
->
resource
.
height
,
&
row_pitch
,
&
slice_pitch
);
wined3d_texture_get_pitch
(
surface
->
container
,
surface
->
texture_level
,
&
row_pitch
,
&
slice_pitch
);
TRACE
(
"Returning %u.
\n
"
,
row_pitch
);
...
...
@@ -1950,16 +1946,7 @@ HRESULT wined3d_surface_update_desc(struct wined3d_surface *surface, const struc
surface
->
resource
.
format
=
texture_resource
->
format
;
surface
->
resource
.
multisample_type
=
texture_resource
->
multisample_type
;
surface
->
resource
.
multisample_quality
=
texture_resource
->
multisample_quality
;
if
(
surface
->
container
->
row_pitch
)
{
surface
->
resource
.
size
=
height
*
surface
->
container
->
row_pitch
;
}
else
{
/* User memory surfaces don't have the regular surface alignment. */
wined3d_format_calculate_pitch
(
texture_resource
->
format
,
1
,
width
,
height
,
&
surface
->
container
->
row_pitch
,
&
surface
->
resource
.
size
);
}
surface
->
resource
.
size
=
surface
->
container
->
slice_pitch
;
/* The format might be changed to a format that needs conversion.
* If the surface didn't use PBOs previously but could now, don't
...
...
dlls/wined3d/texture.c
View file @
65c04ce0
...
...
@@ -499,6 +499,24 @@ void * CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
return
texture
->
resource
.
parent
;
}
void
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
);
if
(
texture
->
row_pitch
)
{
*
row_pitch
=
texture
->
row_pitch
;
*
slice_pitch
=
texture
->
slice_pitch
;
return
;
}
wined3d_format_calculate_pitch
(
resource
->
format
,
resource
->
device
->
surface_alignment
,
width
,
height
,
row_pitch
,
slice_pitch
);
}
DWORD
CDECL
wined3d_texture_set_lod
(
struct
wined3d_texture
*
texture
,
DWORD
lod
)
{
DWORD
old
=
texture
->
lod
;
...
...
@@ -645,7 +663,12 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, UINT
texture
->
resource
.
height
=
height
;
texture
->
user_memory
=
mem
;
texture
->
row_pitch
=
pitch
;
if
((
texture
->
row_pitch
=
pitch
))
texture
->
slice_pitch
=
height
*
pitch
;
else
/* User memory surfaces don't have the regular surface alignment. */
wined3d_format_calculate_pitch
(
format
,
1
,
width
,
height
,
&
texture
->
row_pitch
,
&
texture
->
slice_pitch
);
return
wined3d_surface_update_desc
(
surface
,
gl_info
);
}
...
...
dlls/wined3d/volume.c
View file @
65c04ce0
...
...
@@ -42,8 +42,7 @@ BOOL volume_prepare_system_memory(struct wined3d_volume *volume)
void
wined3d_volume_get_pitch
(
const
struct
wined3d_volume
*
volume
,
UINT
*
row_pitch
,
UINT
*
slice_pitch
)
{
wined3d_format_calculate_pitch
(
volume
->
resource
.
format
,
volume
->
resource
.
device
->
surface_alignment
,
volume
->
resource
.
width
,
volume
->
resource
.
height
,
row_pitch
,
slice_pitch
);
wined3d_texture_get_pitch
(
volume
->
container
,
volume
->
texture_level
,
row_pitch
,
slice_pitch
);
}
/* This call just uploads data, the caller is responsible for binding the
...
...
dlls/wined3d/wined3d_private.h
View file @
65c04ce0
...
...
@@ -2366,6 +2366,7 @@ struct wined3d_texture
void
*
user_memory
;
unsigned
int
row_pitch
;
unsigned
int
slice_pitch
;
/* May only be accessed from the command stream worker thread. */
struct
wined3d_texture_async
...
...
@@ -2400,6 +2401,8 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
void
wined3d_texture_bind_and_dirtify
(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_force_reload
(
struct
wined3d_texture
*
texture
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_get_pitch
(
const
struct
wined3d_texture
*
texture
,
unsigned
int
level
,
unsigned
int
*
row_pitch
,
unsigned
int
*
slice_pitch
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_load
(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_prepare_texture
(
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