Drop support for ETC1 frame images.

This commit is contained in:
Bartosz Taudul 2019-08-15 16:29:50 +02:00
parent 32c7d13159
commit 416113fdcb
5 changed files with 6 additions and 12 deletions

View File

@ -25,11 +25,11 @@ void FreeTexture( void* _tex )
glDeleteTextures( 1, &tex );
}
void UpdateTexture( void* _tex, const char* data, int w, int h, bool etc )
void UpdateTexture( void* _tex, const char* data, int w, int h )
{
auto tex = (GLuint)(intptr_t)_tex;
glBindTexture( GL_TEXTURE_2D, tex );
glCompressedTexImage2D( GL_TEXTURE_2D, 0, etc ? GL_COMPRESSED_RGB8_ETC2 : COMPRESSED_RGB_S3TC_DXT1_EXT, w, h, 0, w * h / 2, data );
glCompressedTexImage2D( GL_TEXTURE_2D, 0, COMPRESSED_RGB_S3TC_DXT1_EXT, w, h, 0, w * h / 2, data );
}
}

View File

@ -6,7 +6,7 @@ namespace tracy
void* MakeTexture();
void FreeTexture( void* tex );
void UpdateTexture( void* tex, const char* data, int w, int h, bool etc );
void UpdateTexture( void* tex, const char* data, int w, int h );
}

View File

@ -1053,7 +1053,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, m_worker.HasEtc1FrameImages() );
UpdateTexture( m_frameTexture, m_worker.UnpackFrameImage( *fi ), fi->w, fi->h );
m_frameTexturePtr = fi;
}
ImGui::Separator();
@ -1467,7 +1467,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, m_worker.HasEtc1FrameImages() );
UpdateTexture( m_frameTexture, m_worker.UnpackFrameImage( *fi ), fi->w, fi->h );
m_frameTexturePtr = fi;
}
ImGui::Separator();
@ -9944,7 +9944,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, m_worker.HasEtc1FrameImages() );
UpdateTexture( m_playback.texture, m_worker.UnpackFrameImage( *fi ), fi->w, fi->h );
if( m_playback.sync )
{

View File

@ -4615,9 +4615,4 @@ const char* Worker::UnpackFrameImage( const FrameImage& image )
return m_frameImageBuffer;
}
bool Worker::HasEtc1FrameImages() const
{
return m_traceVersion <= FileVersion( 0, 4, 9 );
}
}

View File

@ -378,7 +378,6 @@ 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();