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
69861cf8
Commit
69861cf8
authored
Jan 26, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the depth range hack.
parent
ec03d3e4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
67 deletions
+23
-67
visual.c
dlls/d3d8/tests/visual.c
+4
-4
visual.c
dlls/d3d9/tests/visual.c
+4
-4
visual.c
dlls/ddraw/tests/visual.c
+4
-4
state.c
dlls/wined3d/state.c
+11
-55
No files found.
dlls/d3d8/tests/visual.c
View file @
69861cf8
...
...
@@ -1411,15 +1411,15 @@ static void depth_clamp_test(IDirect3DDevice8 *device)
ok
(
SUCCEEDED
(
hr
),
"EndScene failed, hr %#x.
\n
"
,
hr
);
color
=
getPixelColor
(
device
,
75
,
75
);
todo_wine
ok
(
color_match
(
color
,
0x00ffffff
,
1
),
"color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00ffffff
,
1
),
"color 0x%08x.
\n
"
,
color
);
color
=
getPixelColor
(
device
,
150
,
150
);
todo_wine
ok
(
color_match
(
color
,
0x00ffffff
,
1
),
"color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00ffffff
,
1
),
"color 0x%08x.
\n
"
,
color
);
color
=
getPixelColor
(
device
,
320
,
240
);
ok
(
color_match
(
color
,
0x00002b7f
,
1
),
"color 0x%08x.
\n
"
,
color
);
color
=
getPixelColor
(
device
,
320
,
330
);
todo_wine
ok
(
color_match
(
color
,
0x00f9e814
,
1
),
"color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00f9e814
,
1
),
"color 0x%08x.
\n
"
,
color
);
color
=
getPixelColor
(
device
,
320
,
330
);
todo_wine
ok
(
color_match
(
color
,
0x00f9e814
,
1
),
"color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00f9e814
,
1
),
"color 0x%08x.
\n
"
,
color
);
hr
=
IDirect3DDevice8_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Present failed (0x%08x)
\n
"
,
hr
);
...
...
dlls/d3d9/tests/visual.c
View file @
69861cf8
...
...
@@ -10685,15 +10685,15 @@ static void depth_clamp_test(IDirect3DDevice9 *device)
ok
(
SUCCEEDED
(
hr
),
"EndScene failed, hr %#x.
\n
"
,
hr
);
color
=
getPixelColor
(
device
,
75
,
75
);
todo_wine
ok
(
color_match
(
color
,
0x00ffffff
,
1
),
"color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00ffffff
,
1
),
"color 0x%08x.
\n
"
,
color
);
color
=
getPixelColor
(
device
,
150
,
150
);
todo_wine
ok
(
color_match
(
color
,
0x00ffffff
,
1
),
"color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00ffffff
,
1
),
"color 0x%08x.
\n
"
,
color
);
color
=
getPixelColor
(
device
,
320
,
240
);
ok
(
color_match
(
color
,
0x00002b7f
,
1
),
"color 0x%08x.
\n
"
,
color
);
color
=
getPixelColor
(
device
,
320
,
330
);
todo_wine
ok
(
color_match
(
color
,
0x00f9e814
,
1
),
"color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00f9e814
,
1
),
"color 0x%08x.
\n
"
,
color
);
color
=
getPixelColor
(
device
,
320
,
330
);
todo_wine
ok
(
color_match
(
color
,
0x00f9e814
,
1
),
"color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00f9e814
,
1
),
"color 0x%08x.
\n
"
,
color
);
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Present failed (0x%08x)
\n
"
,
hr
);
...
...
dlls/ddraw/tests/visual.c
View file @
69861cf8
...
...
@@ -2795,15 +2795,15 @@ static void depth_clamp_test(IDirect3DDevice7 *device)
ok
(
SUCCEEDED
(
hr
),
"EndScene failed, hr %#x.
\n
"
,
hr
);
color
=
getPixelColor
(
device
,
75
,
75
);
todo_wine
ok
(
color_match
(
color
,
0x00ffffff
,
1
),
"color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00ffffff
,
1
),
"color 0x%08x.
\n
"
,
color
);
color
=
getPixelColor
(
device
,
150
,
150
);
todo_wine
ok
(
color_match
(
color
,
0x00ffffff
,
1
),
"color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00ffffff
,
1
),
"color 0x%08x.
\n
"
,
color
);
color
=
getPixelColor
(
device
,
320
,
240
);
ok
(
color_match
(
color
,
0x00002b7f
,
1
),
"color 0x%08x.
\n
"
,
color
);
color
=
getPixelColor
(
device
,
320
,
330
);
todo_wine
ok
(
color_match
(
color
,
0x00f9e814
,
1
),
"color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00f9e814
,
1
),
"color 0x%08x.
\n
"
,
color
);
color
=
getPixelColor
(
device
,
320
,
330
);
todo_wine
ok
(
color_match
(
color
,
0x00f9e814
,
1
),
"color 0x%08x.
\n
"
,
color
);
ok
(
color_match
(
color
,
0x00f9e814
,
1
),
"color 0x%08x.
\n
"
,
color
);
vp
.
dvMinZ
=
0
.
0
;
vp
.
dvMaxZ
=
1
.
0
;
...
...
dlls/wined3d/state.c
View file @
69861cf8
...
...
@@ -3884,62 +3884,18 @@ static void transform_projection(DWORD state, IWineD3DStateBlockImpl *stateblock
glLoadIdentity
();
checkGLcall
(
"glLoadIdentity"
);
if
(
context
->
last_was_rhw
)
{
double
X
,
Y
,
height
,
width
,
minZ
,
maxZ
;
X
=
stateblock
->
viewport
.
X
;
Y
=
stateblock
->
viewport
.
Y
;
height
=
stateblock
->
viewport
.
Height
;
width
=
stateblock
->
viewport
.
Width
;
minZ
=
stateblock
->
viewport
.
MinZ
;
maxZ
=
stateblock
->
viewport
.
MaxZ
;
if
(
context
->
last_was_rhw
)
{
double
x
=
stateblock
->
viewport
.
X
;
double
y
=
stateblock
->
viewport
.
Y
;
double
w
=
stateblock
->
viewport
.
Width
;
double
h
=
stateblock
->
viewport
.
Height
;
if
(
!
stateblock
->
device
->
untransformed
)
{
/* Transformed vertices are supposed to bypass the whole transform pipeline including
* frustum clipping. This can't be done in opengl, so this code adjusts the Z range to
* suppress depth clipping. This can be done because it is an orthogonal projection and
* the Z coordinate does not affect the size of the primitives. Half Life 1 and Prince of
* Persia 3D need this.
*
* Note that using minZ and maxZ here doesn't entirely fix the problem, since view frustum
* clipping is still enabled, but it seems to fix it for all apps tested so far. A minor
* problem can be witnessed in half-life 1 engine based games, the weapon is clipped close
* to the viewer.
*
* Also note that this breaks z comparison against z values filled in with clear,
* but no app depending on that and disabled clipping has been found yet. Comparing
* primitives against themselves works, so the Z buffer is still intact for normal hidden
* surface removal.
*
* We could disable clipping entirely by setting the near to infinity and far to -infinity,
* but this would break Z buffer operation. Raising the range to something less than
* infinity would help a bit at the cost of Z precision, but it wouldn't eliminate the
* problem either.
*/
TRACE
(
"Calling glOrtho with %f, %f, %f, %f
\n
"
,
width
,
height
,
-
minZ
,
-
maxZ
);
if
(
context
->
render_offscreen
)
{
glOrtho
(
X
,
X
+
width
,
-
Y
,
-
Y
-
height
,
-
minZ
,
-
maxZ
);
}
else
{
glOrtho
(
X
,
X
+
width
,
Y
+
height
,
Y
,
-
minZ
,
-
maxZ
);
}
}
else
{
/* If the app mixes transformed and untransformed primitives we can't use the coordinate system
* trick above because this would mess up transformed and untransformed Z order. Pass the z position
* unmodified to opengl.
*
* If the app depends on mixed types and disabled clipping we're out of luck without a pipeline
* replacement shader.
*/
TRACE
(
"Calling glOrtho with %f, %f, %f, %f
\n
"
,
width
,
height
,
1
.
0
,
-
1
.
0
);
if
(
context
->
render_offscreen
)
{
glOrtho
(
X
,
X
+
width
,
-
Y
,
-
Y
-
height
,
0
.
0
,
-
1
.
0
);
}
else
{
glOrtho
(
X
,
X
+
width
,
Y
+
height
,
Y
,
0
.
0
,
-
1
.
0
);
}
}
TRACE
(
"Calling glOrtho with x %.8e, y %.8e, w %.8e, h %.8e.
\n
"
,
x
,
y
,
w
,
h
);
if
(
context
->
render_offscreen
)
glOrtho
(
x
,
x
+
w
,
-
y
,
-
y
-
h
,
0
.
0
,
-
1
.
0
);
else
glOrtho
(
x
,
x
+
w
,
y
+
h
,
y
,
0
.
0
,
-
1
.
0
);
checkGLcall
(
"glOrtho"
);
/* Window Coord 0 is the middle of the first pixel, so translate by 1/2 pixels */
...
...
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