@@ -58,8 +58,8 @@ void tracy_gpu_zone_begin(struct tracy_data *tracy_data, struct tracy_gpu_zone_c
5858 }
5959
6060 // Create the query object
61- unsigned int query = tracy_data -> queries [ get_next_query_index (tracy_data )] ;
62- tracy_data -> renderer -> procs .glQueryCounterEXT (query , GL_TIMESTAMP_EXT );
61+ const unsigned int query = get_next_query_index (tracy_data );
62+ tracy_data -> renderer -> procs .glQueryCounterEXT (tracy_data -> queries [ query ] , GL_TIMESTAMP_EXT );
6363
6464 // Label the zone
6565 uint64_t srcloc = ___tracy_alloc_srcloc_name (line ,
@@ -84,9 +84,8 @@ void tracy_gpu_zone_end(struct tracy_gpu_zone_context *ctx) {
8484 struct tracy_data * tracy_data = ctx -> tracy_data ;
8585
8686 // Create the query object
87- unsigned int query = tracy_data -> queries [get_next_query_index (tracy_data )];
88- tracy_data -> renderer -> procs .glQueryCounterEXT (
89- query , GL_TIMESTAMP_EXT );
87+ const unsigned int query = get_next_query_index (tracy_data );
88+ tracy_data -> renderer -> procs .glQueryCounterEXT (tracy_data -> queries [query ], GL_TIMESTAMP_EXT );
9089
9190 // End the Tracy GPU zone
9291 const struct ___tracy_gpu_zone_end_data data = {
@@ -98,6 +97,7 @@ void tracy_gpu_zone_end(struct tracy_gpu_zone_context *ctx) {
9897
9998void tracy_gpu_context_collect (struct tracy_data * tracy_data ) {
10099 if (tracy_data == NULL ) {
100+ TracyCMessageL ("tracy_data == NULL" );
101101 return ;
102102 }
103103
@@ -132,7 +132,7 @@ void tracy_gpu_context_collect(struct tracy_data *tracy_data) {
132132 const struct ___tracy_gpu_time_data data = {
133133 .context = tracy_data -> context_id ,
134134 .gpuTime = time ,
135- .queryId = (uint16_t ) tracy_data -> queries [ tracy_data -> q_tail ] ,
135+ .queryId = (uint16_t ) tracy_data -> q_tail ,
136136 };
137137 ___tracy_emit_gpu_time (data );
138138
@@ -167,17 +167,17 @@ struct tracy_data *tracy_gpu_context_new(struct fx_renderer *renderer) {
167167 tracy_data -> q_head = 0 ;
168168 tracy_data -> q_tail = 0 ;
169169
170- // clear disjoint flag
171- GLint64 disjoint ;
172- renderer -> procs .glGetInteger64vEXT (GL_GPU_DISJOINT_EXT , & disjoint );
173-
174170 // Create the query objects
175171 renderer -> procs .glGenQueriesEXT (QUERY_COUNT , tracy_data -> queries );
176172
177173 // Get the current GL time
178174 GLint64 gl_gpu_time ;
179175 renderer -> procs .glGetInteger64vEXT (GL_TIMESTAMP_EXT , & gl_gpu_time );
180176
177+ // Create the query objects
178+ GLint bits ;
179+ renderer -> procs .glGetQueryivEXT (GL_TIMESTAMP_EXT , GL_QUERY_COUNTER_BITS_EXT , & bits );
180+
181181 const struct ___tracy_gpu_new_context_data data = {
182182 .context = tracy_data -> context_id ,
183183 .gpuTime = gl_gpu_time ,
0 commit comments