D3D11 Clear Does Not Clip to Viewport

Reporter: RobertBColton  |  Status: open  |  Last Modified: April 25, 2019, 03:35:21 AM
I finally figured this out while working on #1636 and it's not a regression, it occurs on master too. The Microsoft Documentation is actually very clear (pun intended) about this.

Unlike Direct3D 9, the full extent of the resource view is always cleared. Viewport and scissor settings are not applied.

The solution Microsoft proposes is actually that used by the Chromium/ANGLE projects at Google.

However, I actually think the way GMS gets around this problem may be the fact that each view might have its own render target. This means the render target of each view is already the size of the view, hence no additional clipping during clear is necessary. The documentation isn't clear (pun again) whether they create you a surface for each view if you don't assign one (it sounds like they don't since that would be expensive).

it will return -1 if no surface has been assigned

Key to Success Title Screen Direct3D11

Key to Success Title D3D11

Key to Success Title Screen Direct3D9

Key to Success Title D3D11

Please sign in to post comments, or you can view this issue on GitHub.