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
2c0edb94
Commit
2c0edb94
authored
Dec 30, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 31, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix WINED3DRS_DEPTHBIAS handling.
parent
14da44aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
state.c
dlls/wined3d/state.c
+22
-8
No files found.
dlls/wined3d/state.c
View file @
2c0edb94
...
@@ -1666,19 +1666,33 @@ static void state_scissor(DWORD state, IWineD3DStateBlockImpl *stateblock, struc
...
@@ -1666,19 +1666,33 @@ static void state_scissor(DWORD state, IWineD3DStateBlockImpl *stateblock, struc
}
}
}
}
/* The Direct3D depth bias is specified in normalized depth coordinates. In
* OpenGL the bias is specified in units of "the smallest value that is
* guaranteed to produce a resolvable offset for a given implementation". To
* convert from D3D to GL we need to divide the D3D depth bias by that value.
* There's no practical way to retrieve that value from a given GL
* implementation, but the D3D application has essentially the same problem,
* which makes a guess of 1e-6f seem reasonable here. Note that
* SLOPESCALEDEPTHBIAS is a scaling factor for the depth slope, and doesn't
* need to be scaled. */
static
void
state_depthbias
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
state_depthbias
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
{
union
{
if
(
stateblock
->
renderState
[
WINED3DRS_SLOPESCALEDEPTHBIAS
]
DWORD
d
;
||
stateblock
->
renderState
[
WINED3DRS_DEPTHBIAS
])
float
f
;
{
}
tmpvalue
;
union
{
DWORD
d
;
float
f
;
}
scale_bias
,
const_bias
;
scale_bias
.
d
=
stateblock
->
renderState
[
WINED3DRS_SLOPESCALEDEPTHBIAS
];
const_bias
.
d
=
stateblock
->
renderState
[
WINED3DRS_DEPTHBIAS
];
if
(
stateblock
->
renderState
[
WINED3DRS_SLOPESCALEDEPTHBIAS
]
||
stateblock
->
renderState
[
WINED3DRS_DEPTHBIAS
])
{
tmpvalue
.
d
=
stateblock
->
renderState
[
WINED3DRS_SLOPESCALEDEPTHBIAS
];
glEnable
(
GL_POLYGON_OFFSET_FILL
);
glEnable
(
GL_POLYGON_OFFSET_FILL
);
checkGLcall
(
"glEnable(GL_POLYGON_OFFSET_FILL)"
);
checkGLcall
(
"glEnable(GL_POLYGON_OFFSET_FILL)"
);
glPolygonOffset
(
tmpvalue
.
f
,
*
((
float
*
)
&
stateblock
->
renderState
[
WINED3DRS_DEPTHBIAS
]));
glPolygonOffset
(
scale_bias
.
f
,
const_bias
.
f
*
1e6
f
);
checkGLcall
(
"glPolygonOffset(...)"
);
checkGLcall
(
"glPolygonOffset(...)"
);
}
else
{
}
else
{
glDisable
(
GL_POLYGON_OFFSET_FILL
);
glDisable
(
GL_POLYGON_OFFSET_FILL
);
...
...
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