DXN textures. Probably.

This commit is contained in:
Ben Vanik 2014-12-31 14:19:25 -08:00
parent 7f4aef18d9
commit 33a3e41eaf
2 changed files with 9 additions and 2 deletions

View File

@ -372,6 +372,9 @@ bool TextureCache::UploadTexture2D(GLuint texture, void* host_base,
case TextureFormat::k_DXT4_5_AS_16_16_16_16: case TextureFormat::k_DXT4_5_AS_16_16_16_16:
internal_format = format = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; internal_format = format = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
break; break;
case TextureFormat::k_DXN:
internal_format = format = GL_COMPRESSED_RG_RGTC2;
break;
case TextureFormat::k_24_8: case TextureFormat::k_24_8:
internal_format = GL_DEPTH24_STENCIL8; internal_format = GL_DEPTH24_STENCIL8;
format = GL_DEPTH_STENCIL; format = GL_DEPTH_STENCIL;
@ -410,7 +413,6 @@ bool TextureCache::UploadTexture2D(GLuint texture, void* host_base,
case TextureFormat::k_16_INTERLACED: case TextureFormat::k_16_INTERLACED:
case TextureFormat::k_16_MPEG_INTERLACED: case TextureFormat::k_16_MPEG_INTERLACED:
case TextureFormat::k_16_16_MPEG_INTERLACED: case TextureFormat::k_16_16_MPEG_INTERLACED:
case TextureFormat::k_DXN:
case TextureFormat::k_DXT3A: case TextureFormat::k_DXT3A:
case TextureFormat::k_DXT5A: case TextureFormat::k_DXT5A:
case TextureFormat::k_CTX1: case TextureFormat::k_CTX1:

View File

@ -86,6 +86,12 @@ bool TextureInfo::Prepare(const xe_gpu_texture_fetch_t& fetch,
info.texel_pitch = 16; info.texel_pitch = 16;
info.is_compressed = true; info.is_compressed = true;
break; break;
case FMT_DXN:
// BC5
info.block_size = 4;
info.texel_pitch = 16;
info.is_compressed = true;
break;
case FMT_DXT1_AS_16_16_16_16: case FMT_DXT1_AS_16_16_16_16:
// TODO(benvanik): conversion? // TODO(benvanik): conversion?
info.block_size = 4; info.block_size = 4;
@ -138,7 +144,6 @@ bool TextureInfo::Prepare(const xe_gpu_texture_fetch_t& fetch,
case FMT_16_INTERLACED: case FMT_16_INTERLACED:
case FMT_16_MPEG_INTERLACED: case FMT_16_MPEG_INTERLACED:
case FMT_16_16_MPEG_INTERLACED: case FMT_16_16_MPEG_INTERLACED:
case FMT_DXN:
case FMT_2_10_10_10_AS_16_16_16_16: case FMT_2_10_10_10_AS_16_16_16_16:
case FMT_10_11_11_AS_16_16_16_16: case FMT_10_11_11_AS_16_16_16_16:
case FMT_11_11_10_AS_16_16_16_16: case FMT_11_11_10_AS_16_16_16_16: