Cxbx-reloaded: SetViewport returns 0x7FFFFFFF for width and height

Created on 8 Jun 2018  路  7Comments  路  Source: Cxbx-Reloaded/Cxbx-Reloaded


SetViewport returns 0x7FFFFFFF for width and height in many titles, even dashboard.

[0x17CC] D3D8: D3DDevice_SetViewport(
   pViewport            : 0x002FEBF4 -> X_D3DVIEWPORT8* {
   .X                    : 0
   .Y                    : 0
   .Width                : 7FFFFFFF
   .Height               : 7FFFFFFF
   .MinZ                 : 0
   .MaxZ                 : 1}
);

Upload titles here with compatibility link to create relationship between issues, tracelogs also needed.
Euro 2004
https://github.com/Cxbx-Reloaded/game-compatibility/issues/781
Euro2004_missinggfx_KrnlDebug.zip

HLE bug graphics

Most helpful comment

Let me clarify this :

PR #1257 doesn't change the arguments Xbox code passes into SetViewport, so you'll continue seeing 0x7FFFFFFF in the log.
What PR #1257 DOES do, is limit the values passed onto host SetViewport, so that call won't fail anymore (so we shouldn't see failed SetViewport log messages anymore).

EDIT : Do note, that the first SetViewport call to host always fails - I'm not entirely sure, but I suspect that's because the framebuffer hasn't yet been properly presented. I feel we can ignore this single SetViewport error for now.

With that, this issue can be closed.

PS: It's likely, that for this particular API, it wouldn't matter anymore if d3d8to9 was used or not.

All 7 comments

Yesterday I've issueda pull request that fixes this

@PatrickvL, the issue is after your pull request #1257. The kernel log attached here has commit c5e908ef to prove it. 馃槈

Plus Luke state both xbox and Windows perform differently for 0x7FFFFFFF. Here's the comment from discord.

LukeUsher: Basically, games call D3DDevice_SetViewPort with 7FFFFFFF to reset to default.
On Xbox, the SetViewPort function automatically clips to the render target size.
We don't implement that part yet

Hopefully, someone will have this resolve sooner or later.

Please - create test-case fo this issue, it help to get more titles for tracking.
There well be MANY of it - even dashboard (4920) throws D3DDevice_SetViewport with such Width and Height.

This turns out to not be a cause of missing graphics, just a call that fails with D3D8 but succeeds with D3D9: as long as we clip the given viewport size to the render target dimensions (like Xbox does), we'll be fine.

For the missing graphics issues itself, better create an independent issue to track it by. Link to this one as one (dismissed) possible cause.

Another possible cause : we are presenting the first framebuffer that comes by SetRenderTarget, but Xbox title might target another framebuffer (because of multisampling or any other special effect)

Let me clarify this :

PR #1257 doesn't change the arguments Xbox code passes into SetViewport, so you'll continue seeing 0x7FFFFFFF in the log.
What PR #1257 DOES do, is limit the values passed onto host SetViewport, so that call won't fail anymore (so we shouldn't see failed SetViewport log messages anymore).

EDIT : Do note, that the first SetViewport call to host always fails - I'm not entirely sure, but I suspect that's because the framebuffer hasn't yet been properly presented. I feel we can ignore this single SetViewport error for now.

With that, this issue can be closed.

PS: It's likely, that for this particular API, it wouldn't matter anymore if d3d8to9 was used or not.

Ah, yes. It is passing down the arguments.

Hmm, it has one error. [0x17CC] D3D8: D3DDevice_SetViewport : g_pD3DDevice->SetViewport D3D error (0x8876086C: D3DERR_INVALIDCALL: Invalid Call)

Yet, the rest of the calls with 0x7FFFFFFF seems to be fine.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LukeUsher picture LukeUsher  路  4Comments

PatrickvL picture PatrickvL  路  3Comments

PatrickvL picture PatrickvL  路  3Comments

gandalfthewhite19890404 picture gandalfthewhite19890404  路  3Comments

LukeUsher picture LukeUsher  路  3Comments