diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index 6035b590..a579564b 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -221,6 +221,7 @@ int main( int argc, char** argv ) ImGuiTracyContext imguiContext; Backend backend( title, DrawContents, &mainThreadTasks ); + tracy::InitTexture(); iconTex = tracy::MakeTexture(); iconThread.join(); backend.SetIcon( iconPx, iconX, iconY ); diff --git a/server/TracyTexture.cpp b/server/TracyTexture.cpp index 1fa748c2..dd07751f 100644 --- a/server/TracyTexture.cpp +++ b/server/TracyTexture.cpp @@ -1,6 +1,7 @@ #include #ifdef __EMSCRIPTEN__ +# include # include #else # include "../profiler/src/imgui/imgui_impl_opengl3_loader.h" @@ -14,6 +15,28 @@ namespace tracy { +static bool s_hardwareS3tc; + +void InitTexture() +{ +#ifdef __EMSCRIPTEN__ + s_hardwareS3tc = emscripten_webgl_enable_extension( emscripten_webgl_get_current_context(), "WEBGL_compressed_texture_s3tc" ); +#else + s_hardwareS3tc = false; + GLint num; + glGetIntegerv( GL_NUM_EXTENSIONS, &num ); + for( GLint i=0; i, bool) ); void UpdateTexture( void* tex, const char* data, int w, int h );