amdgpu: Handle 8-bit float format case for stencil. #2092
+13
−4
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.
8-bit float format is sometimes used for stencil views of a depth-stencil image. It's possible that because float formats don't do conversion this just happens to work on a real GPU even though 8-bit floats aren't supported; the shaders I've seen just read it as uint anyway. Handle this case by changing 8-bit float format to 8-bit unsigned integer automatically, to match stencil format.
Unfortunately we can't really know if this will end up being used for a stencil view of an existing depth-stencil image as we need the format change to happen earlier than that point, e.g. to use the right types in the shader resources and resolve the Vulkan format for the
ImageViewInfo
. Therefore, this just applies the conversion to all 8-bit float resources. If we do hit any non-stencil cases this should still work as it would on real hardware due to the lack of bit conversion for float formats.