mirror of
https://github.com/wolfpld/tracy.git
synced 2026-06-16 20:29:00 +00:00
Compare commits
4 Commits
slomp/gl_q
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d571f2bd59 | ||
|
|
781938317d | ||
|
|
f9365abe4f | ||
|
|
3f91f35d59 |
13
cmake/imgui-no-samplers.patch
Normal file
13
cmake/imgui-no-samplers.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/backends/imgui_impl_opengl3.cpp b/backends/imgui_impl_opengl3.cpp
|
||||
index a9e32b7ac..2cdbc4812 100644
|
||||
--- a/backends/imgui_impl_opengl3.cpp
|
||||
+++ b/backends/imgui_impl_opengl3.cpp
|
||||
@@ -1069,7 +1069,7 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
||||
bd->HasPolygonMode = (!bd->GlProfileIsES2 && !bd->GlProfileIsES3);
|
||||
#endif
|
||||
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
|
||||
- bd->HasBindSampler = (bd->GlVersion >= 330 || bd->GlProfileIsES3);
|
||||
+ //bd->HasBindSampler = (bd->GlVersion >= 330 || bd->GlProfileIsES3);
|
||||
#endif
|
||||
bd->HasClipOrigin = (bd->GlVersion >= 450);
|
||||
#ifdef IMGUI_IMPL_OPENGL_HAS_EXTENSIONS
|
||||
@@ -142,6 +142,7 @@ CPMAddPackage(
|
||||
PATCHES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/imgui-emscripten.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/imgui-loader.patch"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/imgui-no-samplers.patch"
|
||||
)
|
||||
|
||||
set(IMGUI_SOURCES
|
||||
@@ -271,7 +272,7 @@ if(NOT EMSCRIPTEN)
|
||||
CPMAddPackage(
|
||||
NAME pugixml
|
||||
GITHUB_REPOSITORY zeux/pugixml
|
||||
GIT_TAG v1.15
|
||||
GIT_TAG v1.16
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
add_library(TracyPugixml INTERFACE)
|
||||
|
||||
@@ -214,6 +214,7 @@ bool View::DrawConnection()
|
||||
else
|
||||
{
|
||||
auto val = int( p.val );
|
||||
ImGui::SetNextItemWidth( 100 * GetScale() );
|
||||
if( ImGui::InputInt( "", &val, 1, 100, ImGuiInputTextFlags_EnterReturnsTrue ) )
|
||||
{
|
||||
m_worker.SetParameter( idx, int32_t( val ) );
|
||||
|
||||
@@ -102,7 +102,6 @@ public:
|
||||
: m_context( GetGpuCtxCounter().fetch_add( 1, std::memory_order_relaxed ) )
|
||||
, m_head( 0 )
|
||||
, m_tail( 0 )
|
||||
, m_supportsQueryBufferObject( false )
|
||||
{
|
||||
ZoneScopedC( Color::Red4 );
|
||||
|
||||
@@ -114,14 +113,6 @@ public:
|
||||
"OpenGL context does not support GL_ARB_timer_query." );
|
||||
}
|
||||
|
||||
// check for GL_QUERY_RESULT_NO_WAIT support
|
||||
m_supportsQueryBufferObject = CheckFeature( "GL_ARB_query_buffer_object" );
|
||||
if( !m_supportsQueryBufferObject )
|
||||
{
|
||||
Profiler::LogString( MessageSourceType::Tracy, MessageSeverity::Info, 0, 0,
|
||||
"OpenGL context does not support GL_ARB_query_buffer_object." );
|
||||
}
|
||||
|
||||
GLint bits;
|
||||
glGetQueryiv( GL_TIMESTAMP, GL_QUERY_COUNTER_BITS, &bits );
|
||||
if( bits == 0 )
|
||||
@@ -206,8 +197,12 @@ public:
|
||||
|
||||
while( m_tail != m_head )
|
||||
{
|
||||
GLint available;
|
||||
glGetQueryObjectiv( m_query[m_tail], GL_QUERY_RESULT_AVAILABLE, &available );
|
||||
if( !available ) return;
|
||||
|
||||
uint64_t time;
|
||||
if( !GetTimestamp(time, m_tail) ) return;
|
||||
glGetQueryObjectui64v( m_query[m_tail], GL_QUERY_RESULT, &time );
|
||||
|
||||
TracyLfqPrepare( QueueType::GpuTime );
|
||||
MemWrite( &item->gpuTime.gpuTime, (int64_t)time );
|
||||
@@ -244,28 +239,6 @@ private:
|
||||
return exts && strstr( exts, feature ) != nullptr;
|
||||
}
|
||||
|
||||
tracy_force_inline bool GetTimestamp( uint64_t& timestamp, unsigned int queryId )
|
||||
{
|
||||
if( m_supportsQueryBufferObject )
|
||||
{
|
||||
constexpr uint64_t sentinel = ~uint64_t(0);
|
||||
uint64_t time = sentinel;
|
||||
glGetQueryObjectui64v( m_query[queryId], GL_QUERY_RESULT_NO_WAIT, &time );
|
||||
if ( time == sentinel ) return false;
|
||||
timestamp = time;
|
||||
}
|
||||
else
|
||||
{
|
||||
GLint available;
|
||||
glGetQueryObjectiv( m_query[queryId], GL_QUERY_RESULT_AVAILABLE, &available );
|
||||
if( available == GL_FALSE ) return false;
|
||||
uint64_t time;
|
||||
glGetQueryObjectui64v( m_query[queryId], GL_QUERY_RESULT, &time );
|
||||
timestamp = time;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef TRACY_OPENGL_AUTO_CALIBRATION
|
||||
// Monotonic host ns for the inter-calibration interval (cpuDelta), kept
|
||||
// separate from Profiler::GetTime() as in the D3D12/Vulkan backends.
|
||||
@@ -325,8 +298,6 @@ private:
|
||||
#ifdef TRACY_OPENGL_AUTO_CALIBRATION
|
||||
int64_t m_prevCalibration; // host-ns timestamp of the last emitted calibration
|
||||
#endif
|
||||
|
||||
bool m_supportsQueryBufferObject;
|
||||
};
|
||||
|
||||
class GpuCtxScope
|
||||
|
||||
Reference in New Issue
Block a user