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
7b5561cb
Commit
7b5561cb
authored
May 03, 2008
by
Roderick Colenbrander
Committed by
Alexandre Julliard
May 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Allow stencil support when it wasn't requested on broken drivers.
parent
a789375f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
3 deletions
+27
-3
context.c
dlls/wined3d/context.c
+4
-2
directx.c
dlls/wined3d/directx.c
+22
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/context.c
View file @
7b5561cb
...
...
@@ -169,8 +169,10 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, WINED3DF
exactDepthMatch
=
FALSE
;
/* In all cases make sure the number of stencil bits matches our requirements
* even when we don't need stencil because it could affect performance */
if
(
!
(
cfgs
->
stencilSize
==
stencilBits
))
* even when we don't need stencil because it could affect performance EXCEPT
* on cards which don't offer depth formats without stencil like the i915 drivers
* on Linux. */
if
(
stencilBits
!=
cfgs
->
stencilSize
&&
!
(
This
->
adapter
->
brokenStencil
&&
stencilBits
<=
cfgs
->
stencilSize
))
continue
;
/* Check multisampling support */
...
...
dlls/wined3d/directx.c
View file @
7b5561cb
...
...
@@ -1706,7 +1706,9 @@ static BOOL IWineD3DImpl_IsPixelFormatCompatibleWithDepthFmt(const WineD3D_Pixel
if
(
!
(
cfg
->
depthSize
==
depthSize
||
(
!
lockable
&&
cfg
->
depthSize
>
depthSize
)))
return
FALSE
;
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
<
stencilSize
)
return
FALSE
;
return
TRUE
;
...
...
@@ -3839,6 +3841,7 @@ BOOL InitAdapters(void) {
int
values
[
10
];
int
nAttribs
=
0
;
int
res
;
int
i
;
WineD3D_PixelFormat
*
cfgs
;
int
attribute
;
DISPLAY_DEVICEW
DisplayDevice
;
...
...
@@ -3953,6 +3956,24 @@ BOOL InitAdapters(void) {
cfgs
++
;
}
/* D16, D24X8 and D24S8 are common depth / depth+stencil formats. All drivers support them though this doesn't
* mean that the format is offered in hardware. For instance Geforce8 cards don't have offer D16 in hardware
* but just fake it using D24(X8?) which is fine. D3D also allows that.
* Some display drivers (i915 on Linux) only report mixed depth+stencil formats like D24S8. MSDN clearly mentions
* that only on lockable formats (e.g. D16_locked) the bit order is guaranteed and that on other formats the
* driver is allowed to consume more bits EXCEPT for stencil bits.
*
* Mark an adapter with this broken stencil behavior.
*/
Adapters
[
0
].
brokenStencil
=
TRUE
;
for
(
i
=
0
,
cfgs
=
Adapters
[
0
].
cfgs
;
i
<
Adapters
[
0
].
nCfgs
;
i
++
)
{
/* Nearly all drivers offer depth formats without stencil, only on i915 this if-statement won't be entered. */
if
(
cfgs
[
i
].
depthSize
&&
!
cfgs
[
i
].
stencilSize
)
{
Adapters
[
0
].
brokenStencil
=
FALSE
;
break
;
}
}
fixup_extensions
(
&
Adapters
[
0
].
gl_info
);
WineD3D_ReleaseFakeGLContext
();
...
...
dlls/wined3d/wined3d_private.h
View file @
7b5561cb
...
...
@@ -702,6 +702,7 @@ struct WineD3DAdapter
WCHAR
DeviceName
[
CCHDEVICENAME
];
/* DeviceName for use with e.g. ChangeDisplaySettings */
int
nCfgs
;
WineD3D_PixelFormat
*
cfgs
;
BOOL
brokenStencil
;
/* Set on cards which only offer mixed depth+stencil */
unsigned
int
TextureRam
;
/* Amount of texture memory both video ram + AGP/TurboCache/HyperMemory/.. */
unsigned
int
UsedTextureRam
;
};
...
...
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