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
3e5899b3
Commit
3e5899b3
authored
Apr 07, 2008
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Some Windows drivers set undefined attributes to 0.0.
parent
1c3e725d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
visual.c
dlls/d3d9/tests/visual.c
+9
-6
state.c
dlls/wined3d/state.c
+8
-0
No files found.
dlls/d3d9/tests/visual.c
View file @
3e5899b3
...
@@ -6078,11 +6078,13 @@ void test_vshader_input(IDirect3DDevice9 *device)
...
@@ -6078,11 +6078,13 @@ void test_vshader_input(IDirect3DDevice9 *device)
ok
(
color
==
0x00FFFF80
||
color
==
0x00FFFF7f
||
color
==
0x00FFFF81
,
ok
(
color
==
0x00FFFF80
||
color
==
0x00FFFF7f
||
color
==
0x00FFFF81
,
"Input test: Quad 1(2crd) returned color 0x%08x, expected 0x00FFFF80
\n
"
,
color
);
"Input test: Quad 1(2crd) returned color 0x%08x, expected 0x00FFFF80
\n
"
,
color
);
/* The last value of the read but undefined stream is used */
/* The last value of the read but undefined stream is used
, it is 0x00. The defined input is vec4(1, 0, 0, 0)
*/
color
=
getPixelColor
(
device
,
480
,
360
);
color
=
getPixelColor
(
device
,
480
,
360
);
ok
(
color
==
0x00FFFF00
,
"Input test: Quad 2(1crd) returned color 0x%08x, expected 0x00FFFF00
\n
"
,
color
);
ok
(
color
==
0x00FFFF00
||
color
==
0x00FF0000
,
"Input test: Quad 2(1crd) returned color 0x%08x, expected 0x00FFFF00
\n
"
,
color
);
color
=
getPixelColor
(
device
,
160
,
120
);
color
=
getPixelColor
(
device
,
160
,
120
);
ok
(
color
==
0x00FF0080
||
color
==
0x00FF007f
||
color
==
0x00FF0081
,
/* Same as above, accept both the last used value and 0.0 for the undefined streams */
ok
(
color
==
0x00FF0080
||
color
==
0x00FF007f
||
color
==
0x00FF0081
||
color
==
0x00FF0000
,
"Input test: Quad 3(2crd-wrongidx) returned color 0x%08x, expected 0x00FF0080
\n
"
,
color
);
"Input test: Quad 3(2crd-wrongidx) returned color 0x%08x, expected 0x00FF0080
\n
"
,
color
);
color
=
getPixelColor
(
device
,
480
,
160
);
color
=
getPixelColor
(
device
,
480
,
160
);
...
@@ -6149,7 +6151,8 @@ void test_vshader_input(IDirect3DDevice9 *device)
...
@@ -6149,7 +6151,8 @@ void test_vshader_input(IDirect3DDevice9 *device)
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_Present failed with %s
\n
"
,
DXGetErrorString9
(
hr
));
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_Present failed with %s
\n
"
,
DXGetErrorString9
(
hr
));
color
=
getPixelColor
(
device
,
480
,
350
);
color
=
getPixelColor
(
device
,
480
,
350
);
/* vs_1_1 may fail, accept the clear color
/* vs_1_1 may fail, accept the clear color. Some drivers also set the undefined streams to 0, accept that
* as well.
*
*
* NOTE: This test fails on the reference rasterizer. In the refrast, the 4 vertices have different colors,
* NOTE: This test fails on the reference rasterizer. In the refrast, the 4 vertices have different colors,
* i.e., the whole old stream is read, and not just the last used attribute. Some games require that this
* i.e., the whole old stream is read, and not just the last used attribute. Some games require that this
...
@@ -6158,8 +6161,8 @@ void test_vshader_input(IDirect3DDevice9 *device)
...
@@ -6158,8 +6161,8 @@ void test_vshader_input(IDirect3DDevice9 *device)
*
*
* A test app for this behavior is Half Life 2 Episode 2 in dxlevel 95, and related games(Portal, TF2).
* A test app for this behavior is Half Life 2 Episode 2 in dxlevel 95, and related games(Portal, TF2).
*/
*/
ok
(
color
==
0x000000FF
||
color
==
0x00808080
,
ok
(
color
==
0x000000FF
||
color
==
0x00808080
||
color
==
0x00000000
,
"Input test: Quad 2(different colors) returned color 0x%08x, expected 0x000000FF
\n
"
,
color
);
"Input test: Quad 2(different colors) returned color 0x%08x, expected 0x000000FF
, 0x00808080 or 0x00000000
\n
"
,
color
);
color
=
getPixelColor
(
device
,
160
,
120
);
color
=
getPixelColor
(
device
,
160
,
120
);
IDirect3DDevice9_SetVertexShader
(
device
,
NULL
);
IDirect3DDevice9_SetVertexShader
(
device
,
NULL
);
...
...
dlls/wined3d/state.c
View file @
3e5899b3
...
@@ -3017,6 +3017,14 @@ static inline void unloadNumberedArrays(IWineD3DStateBlockImpl *stateblock) {
...
@@ -3017,6 +3017,14 @@ static inline void unloadNumberedArrays(IWineD3DStateBlockImpl *stateblock) {
for
(
i
=
0
;
i
<
maxAttribs
;
++
i
)
{
for
(
i
=
0
;
i
<
maxAttribs
;
++
i
)
{
GL_EXTCALL
(
glDisableVertexAttribArrayARB
(
i
));
GL_EXTCALL
(
glDisableVertexAttribArrayARB
(
i
));
checkGLcall
(
"glDisableVertexAttribArrayARB(reg)"
);
checkGLcall
(
"glDisableVertexAttribArrayARB(reg)"
);
/* Some Windows drivers(NV GF 7) use the latest value that was used when drawing with the now
* deactivated stream disabled, some other drivers(ATI, NV GF 8) set the undefined values to 0x00.
* Let's set them to 0x00 to avoid hitting some undefined aspects of OpenGL. All that is really
* important here is the glDisableVertexAttribArrayARB call above. The test shows that the refrast
* keeps dereferencing the pointers, which would cause crashes in some games like Half Life 2 Eposide 2
*/
GL_EXTCALL
(
glVertexAttrib4NubARB
(
i
,
0
,
0
,
0
,
0
));
checkGLcall
(
"glVertexAttrib4NubARB(i, 0, 0, 0, 0)"
);
}
}
}
}
...
...
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