Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
99033b14
Commit
99033b14
authored
Nov 04, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 04, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of getDepthStencilBits().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e0ab314b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
66 deletions
+22
-66
context.c
dlls/wined3d/context.c
+12
-19
directx.c
dlls/wined3d/directx.c
+10
-14
utils.c
dlls/wined3d/utils.c
+0
-31
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-2
No files found.
dlls/wined3d/context.c
View file @
99033b14
...
...
@@ -1244,7 +1244,6 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
BOOL
auxBuffers
,
BOOL
findCompatible
)
{
int
iPixelFormat
=
0
;
BYTE
depthBits
=
0
,
stencilBits
=
0
;
unsigned
int
current_value
;
unsigned
int
cfg_count
=
device
->
adapter
->
cfg_count
;
unsigned
int
i
;
...
...
@@ -1253,8 +1252,6 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
device
,
hdc
,
debug_d3dformat
(
color_format
->
id
),
debug_d3dformat
(
ds_format
->
id
),
auxBuffers
,
findCompatible
);
getDepthStencilBits
(
ds_format
,
&
depthBits
,
&
stencilBits
);
current_value
=
0
;
for
(
i
=
0
;
i
<
cfg_count
;
++
i
)
{
...
...
@@ -1276,9 +1273,9 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
continue
;
if
(
cfg
->
alphaSize
<
color_format
->
alpha_size
)
continue
;
if
(
cfg
->
depthSize
<
d
epthBits
)
if
(
cfg
->
depthSize
<
d
s_format
->
depth_size
)
continue
;
if
(
stencilBits
&&
cfg
->
stencilSize
!=
stencilBits
)
if
(
ds_format
->
stencil_size
&&
cfg
->
stencilSize
!=
ds_format
->
stencil_size
)
continue
;
/* Check multisampling support. */
if
(
cfg
->
numSamples
)
...
...
@@ -1287,9 +1284,9 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
value
=
1
;
/* We try to locate a format which matches our requirements exactly. In case of
* depth it is no problem to emulate 16-bit using e.g. 24-bit, so accept that. */
if
(
cfg
->
depthSize
==
d
epthBits
)
if
(
cfg
->
depthSize
==
d
s_format
->
depth_size
)
value
+=
1
;
if
(
cfg
->
stencilSize
==
stencilBits
)
if
(
cfg
->
stencilSize
==
ds_format
->
stencil_size
)
value
+=
2
;
if
(
cfg
->
alphaSize
==
color_format
->
alpha_size
)
value
+=
4
;
...
...
@@ -1325,8 +1322,8 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC
pfd
.
cAlphaBits
=
color_format
->
alpha_size
;
pfd
.
cColorBits
=
color_format
->
red_size
+
color_format
->
green_size
+
color_format
->
blue_size
+
color_format
->
alpha_size
;
pfd
.
cDepthBits
=
d
epthBits
;
pfd
.
cStencilBits
=
stencilBits
;
pfd
.
cDepthBits
=
d
s_format
->
depth_size
;
pfd
.
cStencilBits
=
ds_format
->
stencil_size
;
pfd
.
iLayerType
=
PFD_MAIN_PLANE
;
iPixelFormat
=
ChoosePixelFormat
(
hdc
,
&
pfd
);
...
...
@@ -2245,21 +2242,17 @@ static void context_set_render_offscreen(struct wined3d_context *context, BOOL o
static
BOOL
match_depth_stencil_format
(
const
struct
wined3d_format
*
existing
,
const
struct
wined3d_format
*
required
)
{
BYTE
existing_depth
,
existing_stencil
,
required_depth
,
required_stencil
;
if
(
existing
==
required
)
return
TRUE
;
if
((
existing
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3DFMT_FLAG_FLOAT
)
!=
(
required
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3DFMT_FLAG_FLOAT
))
return
FALSE
;
getDepthStencilBits
(
existing
,
&
existing_depth
,
&
existing_stencil
);
getDepthStencilBits
(
required
,
&
required_depth
,
&
required_stencil
);
if
(
existing_depth
<
required_depth
)
return
FALSE
;
/* If stencil bits are used the exact amount is required - otherwise wrapping
* won't work correctly */
if
(
required_stencil
&&
required_stencil
!=
existing_stencil
)
return
FALSE
;
if
(
existing
->
depth_size
<
required
->
depth_size
)
return
FALSE
;
/* If stencil bits are used the exact amount is required - otherwise
* wrapping won't work correctly. */
if
(
required
->
stencil_size
&&
required
->
stencil_size
!=
existing
->
stencil_size
)
return
FALSE
;
return
TRUE
;
}
...
...
dlls/wined3d/directx.c
View file @
99033b14
...
...
@@ -4291,15 +4291,8 @@ static BOOL wined3d_check_pixel_format_color(const struct wined3d_gl_info *gl_in
static
BOOL
wined3d_check_pixel_format_depth
(
const
struct
wined3d_gl_info
*
gl_info
,
const
struct
wined3d_pixel_format
*
cfg
,
const
struct
wined3d_format
*
format
)
{
BYTE
depthSize
,
stencilSize
;
BOOL
lockable
=
FALSE
;
if
(
!
getDepthStencilBits
(
format
,
&
depthSize
,
&
stencilSize
))
{
ERR
(
"Unable to check compatibility for format %s.
\n
"
,
debug_d3dformat
(
format
->
id
));
return
FALSE
;
}
/* Float formats need FBOs. If FBOs are used this function isn't called */
if
(
format
->
flags
[
WINED3D_GL_RES_TYPE_TEX_2D
]
&
WINED3DFMT_FLAG_FLOAT
)
return
FALSE
;
...
...
@@ -4307,15 +4300,18 @@ static BOOL wined3d_check_pixel_format_depth(const struct wined3d_gl_info *gl_in
if
((
format
->
id
==
WINED3DFMT_D16_LOCKABLE
)
||
(
format
->
id
==
WINED3DFMT_D32_FLOAT
))
lockable
=
TRUE
;
/* On some modern cards like the Geforce8/9 GLX doesn't offer some dephthstencil formats which D3D9 reports.
* We can safely report 'compatible' formats (e.g. D24 can be used for D16) as long as we aren't dealing with
* a lockable format. This also helps D3D <= 7 as they expect D16 which isn't offered without this on Geforce8 cards. */
if
(
!
(
cfg
->
depthSize
==
depthSize
||
(
!
lockable
&&
cfg
->
depthSize
>
depthSize
)))
/* On some modern cards like the Geforce8/9, GLX doesn't offer some
* dephth/stencil formats which D3D9 reports. We can safely report
* "compatible" formats (e.g. D24 can be used for D16) as long as we
* aren't dealing with a lockable format. This also helps D3D <= 7 as they
* expect D16 which isn't offered without this on Geforce8 cards. */
if
(
!
(
cfg
->
depthSize
==
format
->
depth_size
||
(
!
lockable
&&
cfg
->
depthSize
>
format
->
depth_size
)))
return
FALSE
;
/* Some cards like Intel i915 ones only offer D24S8 but lots of games also need a format without stencil, so
* allow more stencil bits than requested. */
if
(
cfg
->
stencilSize
<
stencilSize
)
/* Some cards like Intel i915 ones only offer D24S8 but lots of games also
* need a format without stencil, so allow more stencil bits than
* requested. */
if
(
cfg
->
stencilSize
<
format
->
stencil_size
)
return
FALSE
;
return
TRUE
;
...
...
dlls/wined3d/utils.c
View file @
99033b14
...
...
@@ -4016,37 +4016,6 @@ unsigned int count_bits(unsigned int mask)
return
count
;
}
/* Helper function for retrieving depth/stencil info for ChoosePixelFormat and wglChoosePixelFormatARB */
BOOL
getDepthStencilBits
(
const
struct
wined3d_format
*
format
,
BYTE
*
depthSize
,
BYTE
*
stencilSize
)
{
TRACE
(
"format %s.
\n
"
,
debug_d3dformat
(
format
->
id
));
switch
(
format
->
id
)
{
case
WINED3DFMT_D16_LOCKABLE
:
case
WINED3DFMT_D16_UNORM
:
case
WINED3DFMT_S1_UINT_D15_UNORM
:
case
WINED3DFMT_X8D24_UNORM
:
case
WINED3DFMT_S4X4_UINT_D24_UNORM
:
case
WINED3DFMT_D24_UNORM_S8_UINT
:
case
WINED3DFMT_S8_UINT_D24_FLOAT
:
case
WINED3DFMT_D32_UNORM
:
case
WINED3DFMT_D32_FLOAT
:
case
WINED3DFMT_INTZ
:
break
;
default:
FIXME
(
"Unsupported depth/stencil format %s.
\n
"
,
debug_d3dformat
(
format
->
id
));
return
FALSE
;
}
*
depthSize
=
format
->
depth_size
;
*
stencilSize
=
format
->
stencil_size
;
TRACE
(
"Returning depthSize: %d and stencilSize: %d for format %s.
\n
"
,
*
depthSize
,
*
stencilSize
,
debug_d3dformat
(
format
->
id
));
return
TRUE
;
}
/* Note: It's the caller's responsibility to ensure values can be expressed
* in the requested format. UNORM formats for example can only express values
* in the range 0.0f -> 1.0f. */
...
...
dlls/wined3d/wined3d_private.h
View file @
99033b14
...
...
@@ -2903,8 +2903,6 @@ void state_pointsprite_w(struct wined3d_context *context,
void
state_pointsprite
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
DECLSPEC_HIDDEN
;
BOOL
getDepthStencilBits
(
const
struct
wined3d_format
*
format
,
BYTE
*
depthSize
,
BYTE
*
stencilSize
)
DECLSPEC_HIDDEN
;
GLenum
gl_primitive_type_from_d3d
(
enum
wined3d_primitive_type
primitive_type
)
DECLSPEC_HIDDEN
;
/* Math utils */
...
...
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