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
9d75a517
Commit
9d75a517
authored
Aug 21, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Improve volume size calculation.
parent
089cc781
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
7 deletions
+12
-7
surface.c
dlls/wined3d/surface.c
+3
-3
utils.c
dlls/wined3d/utils.c
+4
-1
volume.c
dlls/wined3d/volume.c
+4
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/surface.c
View file @
9d75a517
...
...
@@ -2293,7 +2293,7 @@ static void surface_upload_data(struct wined3d_surface *surface, const struct wi
if
(
format
->
flags
&
WINED3DFMT_FLAG_COMPRESSED
)
{
UINT
row_length
=
wined3d_format_calculate_size
(
format
,
1
,
update_w
,
1
);
UINT
row_length
=
wined3d_format_calculate_size
(
format
,
1
,
update_w
,
1
,
1
);
UINT
row_count
=
(
update_h
+
format
->
block_height
-
1
)
/
format
->
block_height
;
const
BYTE
*
addr
=
data
->
addr
;
GLenum
internal
;
...
...
@@ -3437,7 +3437,7 @@ HRESULT CDECL wined3d_surface_update_desc(struct wined3d_surface *surface,
struct
wined3d_device
*
device
=
surface
->
resource
.
device
;
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
const
struct
wined3d_format
*
format
=
wined3d_get_format
(
gl_info
,
format_id
);
UINT
resource_size
=
wined3d_format_calculate_size
(
format
,
device
->
surface_alignment
,
width
,
height
);
UINT
resource_size
=
wined3d_format_calculate_size
(
format
,
device
->
surface_alignment
,
width
,
height
,
1
);
TRACE
(
"surface %p, width %u, height %u, format %s, multisample_type %#x, multisample_quality %u.
\n
"
,
surface
,
width
,
height
,
debug_d3dformat
(
format_id
),
multisample_type
,
multisample_type
);
...
...
@@ -7161,7 +7161,7 @@ static HRESULT surface_init(struct wined3d_surface *surface, UINT alignment, UIN
/* FIXME: Check that the format is supported by the device. */
resource_size
=
wined3d_format_calculate_size
(
format
,
alignment
,
width
,
height
);
resource_size
=
wined3d_format_calculate_size
(
format
,
alignment
,
width
,
height
,
1
);
if
(
!
resource_size
)
return
WINED3DERR_INVALIDCALL
;
...
...
dlls/wined3d/utils.c
View file @
9d75a517
...
...
@@ -1942,7 +1942,8 @@ const struct wined3d_format *wined3d_get_format(const struct wined3d_gl_info *gl
return
&
gl_info
->
formats
[
idx
];
}
UINT
wined3d_format_calculate_size
(
const
struct
wined3d_format
*
format
,
UINT
alignment
,
UINT
width
,
UINT
height
)
UINT
wined3d_format_calculate_size
(
const
struct
wined3d_format
*
format
,
UINT
alignment
,
UINT
width
,
UINT
height
,
UINT
depth
)
{
UINT
size
;
...
...
@@ -1968,6 +1969,8 @@ UINT wined3d_format_calculate_size(const struct wined3d_format *format, UINT ali
size
/=
format
->
height_scale
.
denominator
;
}
size
*=
depth
;
return
size
;
}
...
...
dlls/wined3d/volume.c
View file @
9d75a517
...
...
@@ -265,6 +265,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_device
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
const
struct
wined3d_format
*
format
=
wined3d_get_format
(
gl_info
,
format_id
);
HRESULT
hr
;
UINT
size
;
if
(
!
gl_info
->
supported
[
EXT_TEXTURE3D
])
{
...
...
@@ -272,10 +273,11 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_device
return
WINED3DERR_INVALIDCALL
;
}
size
=
wined3d_format_calculate_size
(
format
,
device
->
surface_alignment
,
width
,
height
,
depth
);
hr
=
resource_init
(
&
volume
->
resource
,
device
,
WINED3D_RTYPE_VOLUME
,
format
,
WINED3D_MULTISAMPLE_NONE
,
0
,
usage
,
pool
,
width
,
height
,
depth
,
width
*
height
*
depth
*
format
->
byte_count
,
parent
,
parent_ops
,
&
volume_resource_ops
);
size
,
parent
,
parent_ops
,
&
volume_resource_ops
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize resource, returning %#x.
\n
"
,
hr
);
...
...
dlls/wined3d/wined3d_private.h
View file @
9d75a517
...
...
@@ -2962,7 +2962,7 @@ struct wined3d_format
const
struct
wined3d_format
*
wined3d_get_format
(
const
struct
wined3d_gl_info
*
gl_info
,
enum
wined3d_format_id
format_id
)
DECLSPEC_HIDDEN
;
UINT
wined3d_format_calculate_size
(
const
struct
wined3d_format
*
format
,
UINT
alignment
,
UINT
width
,
UINT
height
)
DECLSPEC_HIDDEN
;
UINT
alignment
,
UINT
width
,
UINT
height
,
UINT
depth
)
DECLSPEC_HIDDEN
;
DWORD
wined3d_format_convert_from_float
(
const
struct
wined3d_surface
*
surface
,
const
struct
wined3d_color
*
color
)
DECLSPEC_HIDDEN
;
...
...
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