Bläddra i källkod

Removed "BeginRendering" profiling block where no significant work is done. Renamed "EndRendering" block to "Present."

Lasse Öörni 13 år sedan
förälder
incheckning
45243975c1

+ 4 - 4
Engine/Graphics/Direct3D9/D3D9Graphics.cpp

@@ -510,8 +510,6 @@ bool Graphics::TakeScreenShot(Image& destImage)
 
 bool Graphics::BeginFrame()
 {
-    PROFILE(BeginRendering);
-    
     if (!IsInitialized())
         return false;
     
@@ -519,6 +517,8 @@ bool Graphics::BeginFrame()
     HRESULT hr = impl_->device_->TestCooperativeLevel();
     if (hr != D3D_OK)
     {
+        PROFILE(DeviceLost);
+        
         deviceLost_ = true;
         
         // The device can not be reset yet, sleep and try again eventually
@@ -557,11 +557,11 @@ bool Graphics::BeginFrame()
 
 void Graphics::EndFrame()
 {
-    PROFILE(EndRendering);
-    
     if (!IsInitialized())
         return;
     
+    PROFILE(Present);
+    
     SendEvent(E_ENDRENDERING);
     
     impl_->device_->EndScene();

+ 3 - 5
Engine/Graphics/OpenGL/OGLGraphics.cpp

@@ -347,8 +347,6 @@ bool Graphics::TakeScreenShot(Image& destImage)
 
 bool Graphics::BeginFrame()
 {
-    PROFILE(BeginRendering);
-
     if (!IsInitialized())
         return false;
 
@@ -377,11 +375,11 @@ bool Graphics::BeginFrame()
 
 void Graphics::EndFrame()
 {
-    PROFILE(EndRendering);
-    
     if (!IsInitialized())
         return;
-    
+ 
+    PROFILE(Present);
+       
     SendEvent(E_ENDRENDERING);
     
     glfwSwapBuffers();