Selaa lähdekoodia

pstats transfer times

David Rose 18 vuotta sitten
vanhempi
sitoutus
3b7f43058b

+ 2 - 3
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -2775,7 +2775,6 @@ apply_vertex_buffer(VertexBufferContext *vbc,
   }
   }
 
 
   if (gvbc->was_modified(reader)) {
   if (gvbc->was_modified(reader)) {
-    PStatTimer timer(_load_vertex_buffer_pcollector, reader->get_current_thread());
     int num_bytes = reader->get_data_size_bytes();
     int num_bytes = reader->get_data_size_bytes();
     if (GLCAT.is_spam()) {
     if (GLCAT.is_spam()) {
       GLCAT.spam()
       GLCAT.spam()
@@ -2788,6 +2787,7 @@ apply_vertex_buffer(VertexBufferContext *vbc,
         return false;
         return false;
       }
       }
 
 
+      PStatTimer timer(_load_vertex_buffer_pcollector, reader->get_current_thread());
       if (gvbc->changed_size(reader) || gvbc->changed_usage_hint(reader)) {
       if (gvbc->changed_size(reader) || gvbc->changed_usage_hint(reader)) {
         _glBufferData(GL_ARRAY_BUFFER, num_bytes, client_pointer,
         _glBufferData(GL_ARRAY_BUFFER, num_bytes, client_pointer,
                       get_usage(reader->get_usage_hint()));
                       get_usage(reader->get_usage_hint()));
@@ -2960,8 +2960,6 @@ apply_index_buffer(IndexBufferContext *ibc,
   }
   }
 
 
   if (gibc->was_modified(reader)) {
   if (gibc->was_modified(reader)) {
-    PStatTimer timer(_load_index_buffer_pcollector, reader->get_current_thread());
-    
     int num_bytes = reader->get_data_size_bytes();
     int num_bytes = reader->get_data_size_bytes();
     if (GLCAT.is_spam()) {
     if (GLCAT.is_spam()) {
       GLCAT.spam()
       GLCAT.spam()
@@ -2974,6 +2972,7 @@ apply_index_buffer(IndexBufferContext *ibc,
         return false;
         return false;
       }
       }
 
 
+      PStatTimer timer(_load_index_buffer_pcollector, reader->get_current_thread());
       if (gibc->changed_size(reader) || gibc->changed_usage_hint(reader)) {
       if (gibc->changed_size(reader) || gibc->changed_usage_hint(reader)) {
         _glBufferData(GL_ELEMENT_ARRAY_BUFFER, num_bytes, client_pointer,
         _glBufferData(GL_ELEMENT_ARRAY_BUFFER, num_bytes, client_pointer,
                       get_usage(reader->get_usage_hint()));
                       get_usage(reader->get_usage_hint()));

+ 5 - 5
panda/src/pstatclient/pStatProperties.cxx

@@ -145,14 +145,14 @@ static TimeCollectorProperties time_properties[] = {
   { 1, "Draw",                             { 0.83, 0.02, 0.01 },  1.0 / 30.0 },
   { 1, "Draw",                             { 0.83, 0.02, 0.01 },  1.0 / 30.0 },
   { 1, "Draw:Make current",                { 0.4, 0.2, 0.6 } },
   { 1, "Draw:Make current",                { 0.4, 0.2, 0.6 } },
   { 1, "Draw:Copy texture",                { 0.2, 0.6, 0.4 } },
   { 1, "Draw:Copy texture",                { 0.2, 0.6, 0.4 } },
+  { 1, "Draw:Transfer data",               { 0.8, 0.0, 0.6 } },
+  { 1, "Draw:Transfer data:Vertex buffer", { 0.0, 0.1, 0.9 } },
+  { 1, "Draw:Transfer data:Index buffer",  { 0.1, 0.9, 0.0 } },
+  { 1, "Draw:Transfer data:Texture",       { 0.9, 0.0, 0.1 } },
+  { 1, "Draw:Transfer data:Display lists", { 0.5, 0.0, 0.9 } },
   { 1, "Draw:Clear",                       { 0.0, 0.8, 0.6 } },
   { 1, "Draw:Clear",                       { 0.0, 0.8, 0.6 } },
   { 1, "Draw:Flush",                       { 0.9, 0.2, 0.7 } },
   { 1, "Draw:Flush",                       { 0.9, 0.2, 0.7 } },
   { 1, "Draw:Sync",                        { 0.5, 0.7, 0.7 } },
   { 1, "Draw:Sync",                        { 0.5, 0.7, 0.7 } },
-  { 0, "Draw:Transfer data",               { 0.8, 0.0, 0.6 } },
-  { 0, "Draw:Transfer data:Vertex buffer", { 0.0, 0.1, 0.9 } },
-  { 0, "Draw:Transfer data:Index buffer",  { 0.1, 0.9, 0.0 } },
-  { 0, "Draw:Transfer data:Texture",       { 0.9, 0.0, 0.1 } },
-  { 0, "Draw:Transfer data:Display lists", { 0.5, 0.0, 0.9 } },
   { 0, "Draw:Primitive",                   { 0.0, 0.0, 0.5 } },
   { 0, "Draw:Primitive",                   { 0.0, 0.0, 0.5 } },
   { 1, "Draw:Wait occlusion",              { 1.0, 0.5, 0.0 } },
   { 1, "Draw:Wait occlusion",              { 1.0, 0.5, 0.0 } },
   { 0, NULL }
   { 0, NULL }