Browse Source

Do pass queue lookup only once when executing the scene pass command.

Lasse Öörni 10 years ago
parent
commit
a0a1d13109
1 changed files with 4 additions and 3 deletions
  1. 4 3
      Source/Urho3D/Graphics/View.cpp

+ 4 - 3
Source/Urho3D/Graphics/View.cpp

@@ -1505,15 +1505,16 @@ void View::ExecuteRenderPathCommands()
                 
                 
             case CMD_SCENEPASS:
             case CMD_SCENEPASS:
                 {
                 {
-                    if (!batchQueues_[command.passIndex_].IsEmpty())
+                    BatchQueue& queue = batchQueues_[command.passIndex_];
+                    if (!queue.IsEmpty())
                     {
                     {
                         PROFILE(RenderScenePass);
                         PROFILE(RenderScenePass);
-                    
+                        
                         SetRenderTargets(command);
                         SetRenderTargets(command);
                         bool allowDepthWrite = SetTextures(command);
                         bool allowDepthWrite = SetTextures(command);
                         graphics_->SetFillMode(camera_->GetFillMode());
                         graphics_->SetFillMode(camera_->GetFillMode());
                         graphics_->SetClipPlane(camera_->GetUseClipping(), camera_->GetClipPlane(), camera_->GetView(), camera_->GetProjection());
                         graphics_->SetClipPlane(camera_->GetUseClipping(), camera_->GetClipPlane(), camera_->GetView(), camera_->GetProjection());
-                        batchQueues_[command.passIndex_].Draw(this, command.markToStencil_, false, allowDepthWrite);
+                        queue.Draw(this, command.markToStencil_, false, allowDepthWrite);
                     }
                     }
                 }
                 }
                 break;
                 break;