Fix issues with CheckDeviceFormat & CheckDeviceFormatConversion #4161
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.
Fixes #4158
Serious Sam 2 has 3 ways of uploading video frames:
That happens when: YUY2 textures are supported in
CheckDeviceFormat
. DXVK master hits this code path on Nvidia GPUs because we check for sampling support onVK_FORMAT_G8B8G8R8_422_UNORM
and Nvidia supports that.StretchRect
.That happens when: YUY2 textures are unsupported but YUY2 surfaces are supported in
CheckDeviceFormat
. Additionally YUY2 is supported as a source format inCheckDeviceFormatConversion
.That happens when:
CheckDeviceFormat
but YUY2 surfaces are supported inCheckDeviceFormat
. At the same time YUY2 is not supported as a source format inCheckDeviceFormatConversion
.CheckDeviceFormat
. This is what happens with DXVK master on RADV because it does not supportVK_FORMAT_G8B8G8R8_422_UNORM
images.Given that it also manages to get writing to the XRGB texture right in one of the cases, I'm pretty sure this is a game bug because no actual hardware hits that.
I do not know why support for YUY2 textures makes it use the code path where it writes XRGB data.
The case that YUY2 surfaces are supported in
CheckDeviceFormat
but not as a source format inCheckDeviceFormatConversion
is almost certainly wrong anyway.The first commit is pretty straightforward and should be clear.
The second one is because
CheckDeviceFormatConversion
also decides whether or not a format is supported inStretchRect
. We do support YUY2 there.The docs say (emphasis mine):