gl:Implement proper support for packed 16-bit rendertargets

- Also some minor refactoring
This commit is contained in:
kd-11 2019-08-13 16:29:30 +03:00 committed by kd-11
parent 7f85b18b46
commit a0f0c418d7
5 changed files with 29 additions and 72 deletions

View file

@ -104,14 +104,16 @@ namespace gl
return std::make_tuple(GL_RED, GL_UNSIGNED_SHORT, true);
case texture::internal_format::r32f:
return std::make_tuple(GL_RED, GL_FLOAT, true);
case texture::internal_format::r5g6b5:
return std::make_tuple(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, true);
case texture::internal_format::rg8:
return std::make_tuple(GL_RG, GL_UNSIGNED_BYTE, false);
case texture::internal_format::rg16:
return std::make_tuple(GL_RG, GL_UNSIGNED_SHORT, true);
case texture::internal_format::rg16f:
return std::make_tuple(GL_RG, GL_HALF_FLOAT, true);
case texture::internal_format::rgb565:
return std::make_tuple(GL_RGB, GL_UNSIGNED_SHORT_5_6_5, true);
case texture::internal_format::rgb5a1:
return std::make_tuple(GL_RGB, GL_UNSIGNED_SHORT_5_5_5_1, true);
case texture::internal_format::rgba4:
return std::make_tuple(GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4, false);
case texture::internal_format::rgba8: