1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Switch to DXT1 textures in profiler utility.

This commit is contained in:
Bartosz Taudul
2019-06-27 17:16:23 +02:00
parent 1939c31165
commit 10bcc8c770
6 changed files with 17 additions and 7 deletions
+6 -2
View File
@@ -2,6 +2,10 @@
#include "TracyTexture.hpp"
#ifndef COMPRESSED_RGB_S3TC_DXT1_EXT
# define COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
#endif
namespace tracy
{
@@ -21,11 +25,11 @@ void FreeTexture( void* _tex )
glDeleteTextures( 1, &tex );
}
void UpdateTexture( void* _tex, const char* data, int w, int h )
void UpdateTexture( void* _tex, const char* data, int w, int h, bool etc )
{
auto tex = (GLuint)(intptr_t)_tex;
glBindTexture( GL_TEXTURE_2D, tex );
glCompressedTexImage2D( GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB8_ETC2, w, h, 0, w * h / 2, data );
glCompressedTexImage2D( GL_TEXTURE_2D, 0, etc ? GL_COMPRESSED_RGB8_ETC2 : COMPRESSED_RGB_S3TC_DXT1_EXT, w, h, 0, w * h / 2, data );
}
}