d3d9: Windows7 doesn't draw with Viewports bigger than the framebuffer.
This is my Geforce 9600 setup here, the failure doesn't occur on all windows 7 systems. I don't think we can change wined3d's behavior as a number of games are broken on my Windows installation because they do not like the extra parameter validation.
This commit is contained in:
parent
cb4ba6a862
commit
b50a008549
|
@ -10730,6 +10730,7 @@ static void viewport_test(IDirect3DDevice9 *device) {
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
DWORD color;
|
DWORD color;
|
||||||
D3DVIEWPORT9 vp, old_vp;
|
D3DVIEWPORT9 vp, old_vp;
|
||||||
|
BOOL draw_failed = TRUE;
|
||||||
const float quad[] =
|
const float quad[] =
|
||||||
{
|
{
|
||||||
-0.5, -0.5, 0.1,
|
-0.5, -0.5, 0.1,
|
||||||
|
@ -10749,6 +10750,10 @@ static void viewport_test(IDirect3DDevice9 *device) {
|
||||||
*
|
*
|
||||||
* TODO: Test Width < surface.width, but X + Width > surface.width
|
* TODO: Test Width < surface.width, but X + Width > surface.width
|
||||||
* TODO: Test Width < surface.width, what happens with the height?
|
* TODO: Test Width < surface.width, what happens with the height?
|
||||||
|
*
|
||||||
|
* Note that Windows 7 rejects MinZ / MaxZ outside [0;1], but accepts Width
|
||||||
|
* and Height fields bigger than the framebuffer. However, it later refuses
|
||||||
|
* to draw.
|
||||||
*/
|
*/
|
||||||
memset(&vp, 0, sizeof(vp));
|
memset(&vp, 0, sizeof(vp));
|
||||||
vp.X = 0;
|
vp.X = 0;
|
||||||
|
@ -10767,12 +10772,14 @@ static void viewport_test(IDirect3DDevice9 *device) {
|
||||||
if(SUCCEEDED(hr))
|
if(SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float));
|
hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float));
|
||||||
ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr);
|
ok(hr == D3D_OK || broken(hr == D3DERR_INVALIDCALL), "DrawPrimitiveUP failed (%08x)\n", hr);
|
||||||
|
draw_failed = FAILED(hr);
|
||||||
hr = IDirect3DDevice9_EndScene(device);
|
hr = IDirect3DDevice9_EndScene(device);
|
||||||
ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr);
|
ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr);
|
||||||
}
|
}
|
||||||
|
|
||||||
ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr);
|
if(!draw_failed)
|
||||||
|
{
|
||||||
color = getPixelColor(device, 158, 118);
|
color = getPixelColor(device, 158, 118);
|
||||||
ok(color == 0x00ff0000, "viewport test: (158,118) has color %08x\n", color);
|
ok(color == 0x00ff0000, "viewport test: (158,118) has color %08x\n", color);
|
||||||
color = getPixelColor(device, 162, 118);
|
color = getPixelColor(device, 162, 118);
|
||||||
|
@ -10790,6 +10797,7 @@ static void viewport_test(IDirect3DDevice9 *device) {
|
||||||
ok(color == 0x00ff0000, "viewport test: (478,362) has color %08x\n", color);
|
ok(color == 0x00ff0000, "viewport test: (478,362) has color %08x\n", color);
|
||||||
color = getPixelColor(device, 482, 362);
|
color = getPixelColor(device, 482, 362);
|
||||||
ok(color == 0x00ff0000, "viewport test: (482,362) has color %08x\n", color);
|
ok(color == 0x00ff0000, "viewport test: (482,362) has color %08x\n", color);
|
||||||
|
}
|
||||||
|
|
||||||
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||||
ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr);
|
ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr);
|
||||||
|
|
Loading…
Reference in New Issue