gl: Do not allow cross-aspect bitcasts

- There is special handling for some cross-aspect bitcasts in vulkan, but this is not possible using OpenGL
This commit is contained in:
kd-11 2022-05-25 21:05:53 +03:00 committed by kd-11
parent 64958264c5
commit 81b9952e34
2 changed files with 3 additions and 3 deletions

View File

@ -885,9 +885,9 @@ namespace gl
bool formats_are_bitcast_compatible(const texture* texture1, const texture* texture2)
{
if (const u32 transfer_class = texture1->format_class() | texture2->format_class();
transfer_class & RSX_FORMAT_CLASS_DEPTH_FLOAT_MASK)
transfer_class > RSX_FORMAT_CLASS_COLOR)
{
// If any one of the two images is a depth float, the other must match exactly or bust
// If any one of the two images is a depth format, the other must match exactly or bust
return (texture1->format_class() == texture2->format_class());
}

View File

@ -166,7 +166,7 @@ namespace gl
{
const auto src_bpp = slice.src->pitch() / slice.src->width();
const u16 convert_w = u16(slice.src->width() * src_bpp) / dst_bpp;
tmp = std::make_unique<texture>(GL_TEXTURE_2D, convert_w, slice.src->height(), 1, 1, static_cast<GLenum>(dst_image->get_internal_format()));
tmp = std::make_unique<texture>(GL_TEXTURE_2D, convert_w, slice.src->height(), 1, 1, static_cast<GLenum>(dst_image->get_internal_format()), dst_image->format_class());
src_image = tmp.get();