gl: Fixup

This commit is contained in:
kd-11
2018-06-24 01:01:27 +03:00
committed by kd-11
parent 1730708f47
commit 1e375e5210
+23
View File
@@ -1566,6 +1566,21 @@ namespace gl
m_pitch = compressed_size / height; m_pitch = compressed_size / height;
} }
else else
{
switch (sized_format)
{
case GL_DEPTH_COMPONENT16:
{
m_pitch = width * 2;
break;
}
case GL_DEPTH24_STENCIL8:
case GL_DEPTH32F_STENCIL8:
{
m_pitch = width * 4;
break;
}
default:
{ {
GLint r, g, b, a; GLint r, g, b, a;
glGetTexLevelParameteriv(query_target, 0, GL_TEXTURE_RED_SIZE, &r); glGetTexLevelParameteriv(query_target, 0, GL_TEXTURE_RED_SIZE, &r);
@@ -1574,6 +1589,14 @@ namespace gl
glGetTexLevelParameteriv(query_target, 0, GL_TEXTURE_ALPHA_SIZE, &a); glGetTexLevelParameteriv(query_target, 0, GL_TEXTURE_ALPHA_SIZE, &a);
m_pitch = width * (r + g + b + a) / 8; m_pitch = width * (r + g + b + a) / 8;
break;
}
}
if (!m_pitch)
{
fmt::throw_exception("Unhandled GL format 0x%X" HERE, sized_format);
}
} }
} }