gl: API compliance fixes

- Do not assume texture2D when creating new textures
- Flag invalid texture cache if readonly texture is trampled by fbo memory.
  Avoids binding a stale handle to the pipeline and is rare enough that it should not hurt performance
This commit is contained in:
kd-11 2018-01-31 19:11:03 +03:00
parent 2821915eae
commit b9cca71c47
6 changed files with 43 additions and 18 deletions

View file

@ -8,6 +8,18 @@
namespace gl
{
GLenum get_target(rsx::texture_dimension_extended type)
{
switch (type)
{
case rsx::texture_dimension_extended::texture_dimension_1d: return GL_TEXTURE_1D;
case rsx::texture_dimension_extended::texture_dimension_2d: return GL_TEXTURE_2D;
case rsx::texture_dimension_extended::texture_dimension_cubemap: return GL_TEXTURE_CUBE_MAP;
case rsx::texture_dimension_extended::texture_dimension_3d: return GL_TEXTURE_3D;
}
fmt::throw_exception("Unknown texture target" HERE);
}
GLenum get_sized_internal_format(u32 texture_format)
{
switch (texture_format)