Closed WinterSnowfall closed 4 months ago
I've sweetened it a bit by using D3DPOOL_SCRATCH only in case of unsupported surface formats (when CreateImageSurface would typically fail without this PR). We should still consider handling D3DPOOL_SCRATCH in CopyRects, but it's far less likely anything will blow up now.
Edit: Apparently, according to spec, CreateImageSurface() should use D3DPOOL_SYSTEMMEM, but I doubt this actually happens in practice. Modern drivers also don't support any of the above mentioned formats and yet most of the problematic games work fine on native d3d8. All things considered, it is perhaps a generally good idea to keep using D3DPOOL_SYSTEMMEM for the formats we do support, since some games might rely on this particularity.
Edit 2: I've confirmed CreateImageSurface() never fails on native Nvidia (thanks to @K0bin), so my initial assumptions were correct.
Fixes #89 and fixes points (1.) and (2.) from #205.
Some games expect us to successfully create image surfaces for them even when they supply unsupported formats like
P8
orR8G8B8
. This only works withD3DPOOL_SCRATCH
according to spec, and it's also what dxvk validates inside ofCreateOffscreenPlainSurfaceEx()
.We don't actually need to fully support them in order for the above games to work properly at least. #182 will still need
P8
support, since it uses that onCreateTexture()
.The only problem is we don't currently handle
D3DPOOL_SCRATCH
at all inCopyRects()
, so this has the potential to explode and break more than it fixes. We should merge this change only after sorting out that bit ideally.