Fix vsync, oPos register and RenderState #108
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request fixes #49
This pull request fixes #63
This pull request fixes #86
This pull request fixes #103
This pull also fixes AquaNox, which never worked before with d3d8to9.
There are three main updates in this pull:
This will properly set the vsync based on whether the game is usin windowed or fullscreen. This also removes the code that forced
D3DMULTISAMPLE_NONE
, as this broke some AA functions.AquaNox uses almost 100 VirtexShaders. Several of them would set only on the x and y components of the pPos register, which is not allowed in DirectX9. See sample below.
Before fix (see error):
After fix:
D3DRS_LINEPATTERN
,D3DRS_EDGEANTIALIAS
andD3DRS_PATCHSEGMENTS
These states were removed in DirectX9. For
D3DRS_LINEPATTERN
andD3DRS_PATCHSEGMENTS
this changes from returningD3DERR_INVALIDCALL
to returningD3D_OK
. It also changesD3DRS_EDGEANTIALIAS
to useD3DRS_ANTIALIASEDLINEENABLE
instead.These changes are required for AquaNox because AquaNox would monitor the return call and fail out if anything other than
D3D_OK
is returned.