rsx: Improve image aspect tests

- Replace old format-based detection with proper aspect test.
  Explicit image aspect has been available for a long time, but older
  code was not updated.
This commit is contained in:
kd-11 2021-12-07 20:46:31 +03:00 committed by kd-11
parent 8abd3e8bb4
commit 7ca15c60bb
3 changed files with 3 additions and 28 deletions

View File

@ -76,15 +76,7 @@ namespace gl
bool is_depth_surface() const override
{
switch (get_internal_format())
{
case gl::texture::internal_format::depth16:
case gl::texture::internal_format::depth24_stencil8:
case gl::texture::internal_format::depth32f_stencil8:
return true;
default:
return false;
}
return !!(aspect() & gl::image_aspect::depth);
}
void release_ref(texture* t) const override

View File

@ -413,15 +413,7 @@ namespace gl
bool is_depth_texture() const
{
switch (vram_texture->get_internal_format())
{
case gl::texture::internal_format::depth16:
case gl::texture::internal_format::depth24_stencil8:
case gl::texture::internal_format::depth32f_stencil8:
return true;
default:
return false;
}
return !!(vram_texture->aspect() & gl::image_aspect::depth);
}
bool has_compatible_format(gl::texture* tex) const

View File

@ -346,16 +346,7 @@ namespace vk
bool is_depth_texture() const
{
switch (vram_texture->info.format)
{
case VK_FORMAT_D16_UNORM:
case VK_FORMAT_D32_SFLOAT:
case VK_FORMAT_D32_SFLOAT_S8_UINT:
case VK_FORMAT_D24_UNORM_S8_UINT:
return true;
default:
return false;
}
return !!(vram_texture->aspect() & VK_IMAGE_ASPECT_DEPTH_BIT);
}
};