Andrew Fenn schrieb:
I made a new patch this time including a test.
I put in some extra checking in SetScissorRect making sure that if rect was null or it was an invalid rectangle that it was returned as invalid as it should be.
I'm not able to do a test on windows so if anyone does one please let me know if there are any problems. Also please tell me if you spot any problems with this patch.
Thanks, Andrew
- RECT rect = {0, 0, 0, 0};
- hr = IDirect3DDevice9_SetScissorRect(device, &rect);
- ok(hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %08x\n", hr);
Sorry that I led you in the wrong direction but these tests didn't pass on windows! Also please read the comment to the bug, where I attached my patch. My suggestion which I made there isn't true! The real background is that wine sets the default scissor rect to {0,0,0,0} but on windows it is set to another size, I have written a patch for that, but it looks like there is something incomplete (see http://www.winehq.org/pipermail/wine-patches/2008-August/059891.html ). When the game is starting it retrieves the initial value with GetScissorRect which is in wine the null-rect. And so nothing is rendered to the screen.
Cheers Rico
I'm alittle confused, are you suggesting that if SetScissorRect receives a null value that if should default to the window size? or do you mean that perhaps GetScissorRect should call SetScissorRect and return a correct value instead of null?
If I understand you correctly it sounds like another problem and I think that checking should still be done on SetScissorRect as currently there is no checking being done where as the documentation states that D3DERR_INVALIDCALL is returned if SetScissorRect gets an invalid or null rectangle.
I'm currently rewriting the tests and patch so I'll let you know when I am done.
PS: I just looked at wine's implementation of GetScissorRect and it looks wrong as well. It should be returning D3DERR_INVALIDCALL if there is no value and perhaps maybe if scissor test hasn't been enabled.
On Sat, Aug 23, 2008 at 1:46 AM, Rico Schüller kgbricola@web.de wrote:
Andrew Fenn schrieb:
I made a new patch this time including a test.
I put in some extra checking in SetScissorRect making sure that if rect was null or it was an invalid rectangle that it was returned as invalid as it should be.
I'm not able to do a test on windows so if anyone does one please let me know if there are any problems. Also please tell me if you spot any problems with this patch.
Thanks, Andrew
- RECT rect = {0, 0, 0, 0};
- hr = IDirect3DDevice9_SetScissorRect(device, &rect);
- ok(hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %08x\n", hr);
Sorry that I led you in the wrong direction but these tests didn't pass on windows! Also please read the comment to the bug, where I attached my patch. My suggestion which I made there isn't true! The real background is that wine sets the default scissor rect to {0,0,0,0} but on windows it is set to another size, I have written a patch for that, but it looks like there is something incomplete (see http://www.winehq.org/pipermail/wine-patches/2008-August/059891.html ). When the game is starting it retrieves the initial value with GetScissorRect which is in wine the null-rect. And so nothing is rendered to the screen.
Cheers Rico
Andrew Fenn schrieb:
I'm alittle confused, are you suggesting that if SetScissorRect receives a null value that if should default to the window size? or do you mean that perhaps GetScissorRect should call SetScissorRect and return a correct value instead of null?
No. {0,0,0,0} is a valid scissorrect. You could set it and get it. It is valid. Wines default scissorect is wrong, it has to be the size of the first swapchains backbuffer. I have a patch for this one. I'll send it later today.
If I understand you correctly it sounds like another problem and I think that checking should still be done on SetScissorRect as currently there is no checking being done where as the documentation states that D3DERR_INVALIDCALL is returned if SetScissorRect gets an invalid or null rectangle.
Probably, checking should be done for invalid scissorrect values.
I'm currently rewriting the tests and patch so I'll let you know when I am done.
PS: I just looked at wine's implementation of GetScissorRect and it looks wrong as well. It should be returning D3DERR_INVALIDCALL if there is no value and perhaps maybe if scissor test hasn't been enabled.
There is always a scissorrect value! I don't know if there is a chance to get a D3DERR_INVALIDCALL from the GetScissorRect-function.
Cheers Rico
I see what you mean now with regards to there always being a ScissorRect value. I tried testing for all kinds of invalid values but there doesn't seem to be any.
Also setting ScissorRect to NULL seems to kill the program on windows rather then return invalid so I don't know what should be done in that situation with regards to wine's implementation. Should it be returning invalid or perhaps silently fail?
Regards, Andrew
On Sat, Aug 23, 2008 at 9:18 PM, Rico Schüller kgbricola@web.de wrote:
Andrew Fenn schrieb:
I'm alittle confused, are you suggesting that if SetScissorRect receives a null value that if should default to the window size? or do you mean that perhaps GetScissorRect should call SetScissorRect and return a correct value instead of null?
No. {0,0,0,0} is a valid scissorrect. You could set it and get it. It is valid. Wines default scissorect is wrong, it has to be the size of the first swapchains backbuffer. I have a patch for this one. I'll send it later today.
If I understand you correctly it sounds like another problem and I think that checking should still be done on SetScissorRect as currently there is no checking being done where as the documentation states that D3DERR_INVALIDCALL is returned if SetScissorRect gets an invalid or null rectangle.
Probably, checking should be done for invalid scissorrect values.
I'm currently rewriting the tests and patch so I'll let you know when I am done.
PS: I just looked at wine's implementation of GetScissorRect and it looks wrong as well. It should be returning D3DERR_INVALIDCALL if there is no value and perhaps maybe if scissor test hasn't been enabled.
There is always a scissorrect value! I don't know if there is a chance to get a D3DERR_INVALIDCALL from the GetScissorRect-function.
Cheers Rico