This will return D3DERR_INVALIDCALL if the pViewport describes a region that cannot exist within the render target surface. See comments here for details on how this fixes the issue with Hydorah.
This takes the update from here. This fixes an issue where D3DUSAGE_DYNAMIC was breaking Depth Stencil Textures.
Overview:
This pull fixes #76 and this pull fixes #79.
There are two changes here:
Testing:
I tested this with the following games: