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
af9ccb49
Commit
af9ccb49
authored
Dec 10, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Use wined3d_log2i() to calculate the level count in ddraw_surface_create().
parent
f5939399
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
40 deletions
+36
-40
surface.c
dlls/ddraw/surface.c
+1
-8
utils.c
dlls/wined3d/utils.c
+0
-31
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-1
wined3d.h
include/wine/wined3d.h
+35
-0
No files found.
dlls/ddraw/surface.c
View file @
af9ccb49
...
...
@@ -5817,14 +5817,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
{
/* Undocumented feature: Create sublevels until either the
* width or the height is 1. */
DWORD
min
=
desc
->
dwWidth
<
desc
->
dwHeight
?
desc
->
dwWidth
:
desc
->
dwHeight
;
desc
->
u2
.
dwMipMapCount
=
0
;
while
(
min
)
{
++
desc
->
u2
.
dwMipMapCount
;
min
>>=
1
;
}
desc
->
u2
.
dwMipMapCount
=
wined3d_log2i
(
min
(
desc
->
dwWidth
,
desc
->
dwHeight
))
+
1
;
}
}
else
...
...
dlls/wined3d/utils.c
View file @
af9ccb49
...
...
@@ -3929,37 +3929,6 @@ const struct wine_rb_functions wined3d_ffp_vertex_program_rb_functions =
wined3d_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7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
};
UINT32
i
;
return
(
i
=
x
>>
16
)
?
(
x
=
i
>>
8
)
?
l
[
x
]
+
24
:
l
[
i
]
+
16
:
(
i
=
x
>>
8
)
?
l
[
i
]
+
8
:
l
[
x
];
#endif
}
const
struct
blit_shader
*
wined3d_select_blitter
(
const
struct
wined3d_gl_info
*
gl_info
,
enum
wined3d_blit_op
blit_op
,
const
RECT
*
src_rect
,
DWORD
src_usage
,
enum
wined3d_pool
src_pool
,
const
struct
wined3d_format
*
src_format
,
const
RECT
*
dst_rect
,
DWORD
dst_usage
,
enum
wined3d_pool
dst_pool
,
const
struct
wined3d_format
*
dst_format
)
...
...
dlls/wined3d/wined3d_private.h
View file @
af9ccb49
...
...
@@ -2824,7 +2824,6 @@ GLenum gl_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type) DE
/* Math utils */
void
multiply_matrix
(
struct
wined3d_matrix
*
dest
,
const
struct
wined3d_matrix
*
src1
,
const
struct
wined3d_matrix
*
src2
)
DECLSPEC_HIDDEN
;
UINT
wined3d_log2i
(
UINT32
x
)
DECLSPEC_HIDDEN
;
unsigned
int
count_bits
(
unsigned
int
mask
)
DECLSPEC_HIDDEN
;
void
wined3d_release_dc
(
HWND
window
,
HDC
dc
)
DECLSPEC_HIDDEN
;
...
...
include/wine/wined3d.h
View file @
af9ccb49
...
...
@@ -26,6 +26,10 @@
#ifndef __WINE_WINED3D_H
#define __WINE_WINED3D_H
#ifndef __WINE_CONFIG_H
# error You must include config.h to use this header
#endif
#include "wine/list.h"
#define WINED3D_OK S_OK
...
...
@@ -2555,4 +2559,35 @@ HRESULT __cdecl wined3d_volume_map(struct wined3d_volume *volume,
void
__cdecl
wined3d_volume_preload
(
struct
wined3d_volume
*
volume
);
HRESULT
__cdecl
wined3d_volume_unmap
(
struct
wined3d_volume
*
volume
);
/* Return the integer base-2 logarithm of x. Undefined for x == 0. */
static
inline
unsigned
int
wined3d_log2i
(
unsigned
int
x
)
{
#ifdef HAVE___BUILTIN_CLZ
return
__builtin_clz
(
x
)
^
0x1f
;
#else
static
const
unsigned
int
l
[]
=
{
~
0u
,
0
,
1
,
1
,
2
,
2
,
2
,
2
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
};
unsigned
int
i
;
return
(
i
=
x
>>
16
)
?
(
x
=
i
>>
8
)
?
l
[
x
]
+
24
:
l
[
i
]
+
16
:
(
i
=
x
>>
8
)
?
l
[
i
]
+
8
:
l
[
x
];
#endif
}
#endif
/* __WINE_WINED3D_H */
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