mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Switch to DXT1 textures in profiler utility.
This commit is contained in:
parent
1939c31165
commit
10bcc8c770
@ -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 );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ namespace tracy
|
||||
|
||||
void* MakeTexture();
|
||||
void FreeTexture( void* 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 );
|
||||
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ namespace Version
|
||||
{
|
||||
enum { Major = 0 };
|
||||
enum { Minor = 4 };
|
||||
enum { Patch = 9 };
|
||||
enum { Patch = 10 };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1001,7 +1001,7 @@ void View::DrawFrames()
|
||||
if( fi != m_frameTexturePtr )
|
||||
{
|
||||
if( !m_frameTexture ) m_frameTexture = MakeTexture();
|
||||
UpdateTexture( m_frameTexture, m_worker.UnpackFrameImage( *fi ), fi->w, fi->h );
|
||||
UpdateTexture( m_frameTexture, m_worker.UnpackFrameImage( *fi ), fi->w, fi->h, m_worker.HasEtc1FrameImages() );
|
||||
m_frameTexturePtr = fi;
|
||||
}
|
||||
ImGui::Separator();
|
||||
@ -1409,7 +1409,7 @@ bool View::DrawZoneFrames( const FrameData& frames )
|
||||
if( fi != m_frameTexturePtr )
|
||||
{
|
||||
if( !m_frameTexture ) m_frameTexture = MakeTexture();
|
||||
UpdateTexture( m_frameTexture, m_worker.UnpackFrameImage( *fi ), fi->w, fi->h );
|
||||
UpdateTexture( m_frameTexture, m_worker.UnpackFrameImage( *fi ), fi->w, fi->h, m_worker.HasEtc1FrameImages() );
|
||||
m_frameTexturePtr = fi;
|
||||
}
|
||||
ImGui::Separator();
|
||||
@ -9122,7 +9122,7 @@ void View::DrawPlayback()
|
||||
if( m_playback.currFrame != m_playback.frame )
|
||||
{
|
||||
m_playback.currFrame = m_playback.frame;
|
||||
UpdateTexture( m_playback.texture, m_worker.UnpackFrameImage( *fi ), fi->w, fi->h );
|
||||
UpdateTexture( m_playback.texture, m_worker.UnpackFrameImage( *fi ), fi->w, fi->h, m_worker.HasEtc1FrameImages() );
|
||||
|
||||
if( m_playback.sync )
|
||||
{
|
||||
|
@ -4534,4 +4534,9 @@ const char* Worker::UnpackFrameImage( const FrameImage& image )
|
||||
return m_frameImageBuffer;
|
||||
}
|
||||
|
||||
bool Worker::HasEtc1FrameImages() const
|
||||
{
|
||||
return m_traceVersion <= FileVersion( 0, 4, 9 );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -350,6 +350,7 @@ public:
|
||||
|
||||
const char* PackFrameImage( const char* image, uint16_t w, uint16_t h, uint32_t& csz );
|
||||
const char* UnpackFrameImage( const FrameImage& image );
|
||||
bool HasEtc1FrameImages() const;
|
||||
|
||||
private:
|
||||
void Exec();
|
||||
|
Loading…
Reference in New Issue
Block a user