mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00:00
vk: Fix D32S8 interpolation by using integer interpolation instead of floating point
- Interpolating floats is not the same as interpolating their bits! Use integer format to interpolate linearly for D32F formats instead of using R32F as intermediary
This commit is contained in:
parent
086ecf4ba6
commit
621fab2ad9
1 changed files with 4 additions and 1 deletions
|
@ -517,7 +517,10 @@ namespace vk
|
|||
// Since the typeless transfer itself violates spec, the only way to make it work is to use a D32S8 intermediate
|
||||
// Copy from src->intermediate then intermediate->dst for each aspect separately
|
||||
|
||||
auto typeless_depth = vk::get_typeless_helper(VK_FORMAT_R32_SFLOAT, typeless_w, typeless_h);
|
||||
// NOTE: While it may seem intuitive to use R32_SFLOAT as the carrier for the depth aspect, this does not work properly
|
||||
// Floating point interpolation is non-linear from a bit-by-bit perspective and generates undesirable effects
|
||||
|
||||
auto typeless_depth = vk::get_typeless_helper(VK_FORMAT_B8G8R8A8_UNORM, typeless_w, typeless_h);
|
||||
auto typeless_stencil = vk::get_typeless_helper(VK_FORMAT_R8_UNORM, typeless_w, typeless_h);
|
||||
change_image_layout(cmd, typeless_depth, VK_IMAGE_LAYOUT_GENERAL);
|
||||
change_image_layout(cmd, typeless_stencil, VK_IMAGE_LAYOUT_GENERAL);
|
||||
|
|
Loading…
Add table
Reference in a new issue