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
7b1e0815
Commit
7b1e0815
authored
May 08, 2011
by
Stefan Dösinger
Committed by
Alexandre Julliard
May 10, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Map ZBIAS values to a smaller depth range.
parent
362a7d57
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
device.c
dlls/d3d8/device.c
+8
-2
No files found.
dlls/d3d8/device.c
View file @
7b1e0815
...
@@ -1466,6 +1466,12 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetClipPlane(IDirect3DDevice8 *iface,
...
@@ -1466,6 +1466,12 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetClipPlane(IDirect3DDevice8 *iface,
return
hr
;
return
hr
;
}
}
/* This factor is the result of a trial-and-error search. Both ZBIAS and DEPTHBIAS require
* guesswork by design. d3d9 apps usually use a DEPTHBIAS of -0.00002(Mass Effect 2, WoW).
* d3d8 apps(Final Fantasy XI) set ZBIAS to 15 and still expect the depth test to sort
* objects properly. */
static
const
float
zbias_factor
=
-
0
.
000005
f
;
static
HRESULT
WINAPI
IDirect3DDevice8Impl_SetRenderState
(
IDirect3DDevice8
*
iface
,
static
HRESULT
WINAPI
IDirect3DDevice8Impl_SetRenderState
(
IDirect3DDevice8
*
iface
,
D3DRENDERSTATETYPE
State
,
DWORD
Value
)
D3DRENDERSTATETYPE
State
,
DWORD
Value
)
{
{
...
@@ -1483,7 +1489,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(IDirect3DDevice8 *ifac
...
@@ -1483,7 +1489,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(IDirect3DDevice8 *ifac
switch
(
State
)
switch
(
State
)
{
{
case
D3DRS_ZBIAS
:
case
D3DRS_ZBIAS
:
wined3d_value
.
f
=
Value
/
-
16
.
0
f
;
wined3d_value
.
f
=
Value
*
zbias_factor
;
hr
=
IWineD3DDevice_SetRenderState
(
This
->
WineD3DDevice
,
WINED3DRS_DEPTHBIAS
,
wined3d_value
.
d
);
hr
=
IWineD3DDevice_SetRenderState
(
This
->
WineD3DDevice
,
WINED3DRS_DEPTHBIAS
,
wined3d_value
.
d
);
break
;
break
;
...
@@ -1513,7 +1519,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetRenderState(IDirect3DDevice8 *ifac
...
@@ -1513,7 +1519,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetRenderState(IDirect3DDevice8 *ifac
{
{
case
D3DRS_ZBIAS
:
case
D3DRS_ZBIAS
:
hr
=
IWineD3DDevice_GetRenderState
(
This
->
WineD3DDevice
,
WINED3DRS_DEPTHBIAS
,
&
wined3d_value
.
d
);
hr
=
IWineD3DDevice_GetRenderState
(
This
->
WineD3DDevice
,
WINED3DRS_DEPTHBIAS
,
&
wined3d_value
.
d
);
if
(
SUCCEEDED
(
hr
))
*
pValue
=
-
wined3d_value
.
f
*
16
.
0
f
;
if
(
SUCCEEDED
(
hr
))
*
pValue
=
wined3d_value
.
f
/
zbias_factor
;
break
;
break
;
default:
default:
...
...
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