Remove some dead and non-thread safe internal uniforms 45/49545/1
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 14 Oct 2015 15:38:22 +0000 (16:38 +0100)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 14 Oct 2015 15:55:39 +0000 (16:55 +0100)
Change-Id: I70635a012f67b75d22a411ac06d7b34f27be4659

dali/internal/render/common/render-algorithms.cpp
dali/internal/render/common/render-algorithms.h
dali/internal/render/common/render-manager.cpp
dali/internal/render/common/render-manager.h
dali/internal/render/renderers/render-renderer.cpp
dali/internal/render/renderers/render-renderer.h
dali/internal/render/shaders/program.cpp
dali/internal/render/shaders/program.h
dali/internal/update/manager/update-manager.cpp

index 48799259fd6c42760e5f2756e9501b1083649251..646053d06892d23a51198ee02a0d953253be6297 100644 (file)
@@ -109,7 +109,6 @@ inline void SetRenderFlags( const RenderList& renderList, Context& context )
  * @param[in] context The GL context.
  * @param[in] defaultShader The default shader to use.
  * @param[in] buffer The current render buffer index (previous update buffer)
- * @param[in] frameTime The elapsed time between the last two updates.
  * @param[in] viewMatrix The view matrix from the appropriate camera.
  * @param[in] projectionMatrix The projection matrix from the appropriate camera.
  * @param[in] cullMode True if the renderers should be subjected to clipspace culling
@@ -120,7 +119,6 @@ inline void ProcessRenderList(
   SceneGraph::TextureCache& textureCache,
   SceneGraph::Shader& defaultShader,
   BufferIndex bufferIndex,
-  float frameTime,
   const Matrix& viewMatrix,
   const Matrix& projectionMatrix,
   bool cullMode )
@@ -142,7 +140,7 @@ inline void ProcessRenderList(
       //Enable depth writes if depth buffer is enabled and item is opaque
       context.DepthMask( depthBufferEnabled && item.IsOpaque() );
 
-      item.GetRenderer().Render( context, textureCache, bufferIndex, item.GetNode(), defaultShader, item.GetModelViewMatrix(), viewMatrix, projectionMatrix, frameTime, cullMode, !item.IsOpaque() );
+      item.GetRenderer().Render( context, textureCache, bufferIndex, item.GetNode(), defaultShader, item.GetModelViewMatrix(), viewMatrix, projectionMatrix, cullMode, !item.IsOpaque() );
     }
   }
   else
@@ -153,69 +151,17 @@ inline void ProcessRenderList(
       const RenderItem& item = renderList.GetItem( index );
       DALI_PRINT_RENDER_ITEM( item );
 
-      item.GetRenderer().Render( context, textureCache, bufferIndex, item.GetNode(), defaultShader, item.GetModelViewMatrix(), viewMatrix, projectionMatrix, frameTime, cullMode, !item.IsOpaque() );
+      item.GetRenderer().Render( context, textureCache, bufferIndex, item.GetNode(), defaultShader, item.GetModelViewMatrix(), viewMatrix, projectionMatrix, cullMode, !item.IsOpaque() );
     }
 
   }
 }
 
-/**
- * Render items from the currentIndex until the depth index changes.
- * Leaves currentIndex pointing at the
- *
- * @param[in] renderList The render-list to process.
- * @param[in] context The GL context.
- * @param[in] defaultShader The default shader to use.
- * @param[in] buffer The current render buffer index (previous update buffer)
- * @param[in] frameTime The elapsed time between the last two updates.
- * @param[in] viewMatrix The view matrix from the appropriate camera.
- * @param[in] projectionMatrix The projection matrix from the appropriate camera.
- * @param[in] cullMode True if the renderers should be subjected to clipspace culling
- * @param[in] depthIndex The current depth index
- * @param[inout] currentIndex On entry, the index in the render list of the first item at the given depth index. On exit, the index of the first item at the next depth index.
- */
-inline void RenderItemsAtDepthIndex(
-  const RenderList&         renderList,
-  Context&                  context,
-  SceneGraph::TextureCache& textureCache,
-  SceneGraph::Shader&       defaultShader,
-  BufferIndex               bufferIndex,
-  float                     frameTime,
-  const Matrix&             viewMatrix,
-  const Matrix&             projectionMatrix,
-  bool                      cullMode,
-  int                       depthIndex,
-  size_t&                   currentIndex ) // Out parameter
-{
-  const size_t count = renderList.Count();
-
-  // Don't initialise currentIndex. Ever.
-  for( ; currentIndex < count ; currentIndex++ )
-  {
-    const RenderItem& renderItem = renderList.GetItem( currentIndex );
-    DALI_PRINT_RENDER_ITEM( renderItem );
-
-    if( renderItem.GetDepthIndex() == depthIndex )
-    {
-      const Matrix& modelViewMatrix = renderItem.GetModelViewMatrix();
-      renderItem.GetRenderer().Render( context, textureCache, bufferIndex, renderItem.GetNode(), defaultShader, modelViewMatrix, viewMatrix, projectionMatrix, frameTime, cullMode, !renderItem.IsOpaque() );
-
-    }
-    else
-    {
-      break; // Stop iterating when we reach a new depth index
-    }
-  }
-}
-
-
-
 void ProcessRenderInstruction( const RenderInstruction& instruction,
                                Context& context,
                                SceneGraph::TextureCache& textureCache,
                                SceneGraph::Shader& defaultShader,
-                               BufferIndex bufferIndex,
-                               float frameTime )
+                               BufferIndex bufferIndex )
 {
   DALI_PRINT_RENDER_INSTRUCTION( instruction, bufferIndex );
 
@@ -239,7 +185,7 @@ void ProcessRenderInstruction( const RenderInstruction& instruction,
       if(  renderList &&
           !renderList->IsEmpty() )
       {
-          ProcessRenderList( *renderList, context, textureCache, defaultShader, bufferIndex, frameTime, *viewMatrix, *projectionMatrix, instruction.mCullMode );
+        ProcessRenderList( *renderList, context, textureCache, defaultShader, bufferIndex, *viewMatrix, *projectionMatrix, instruction.mCullMode );
       }
     }
   }
index f06cecad94a64f45e9725050c440a9ca8b03c0da..b84d68df5fecae17a52e7b7bbdd948e5e8bfd3b4 100644 (file)
@@ -44,14 +44,12 @@ namespace Render
  * @param[in] textureCache The texture cache used to get textures.
  * @param[in] defaultShader The default shader.
  * @param[in] buffer The current render buffer index (previous update buffer)
- * @param[in] frameTime The elapsed time between the last two updates.
  */
 void ProcessRenderInstruction( const SceneGraph::RenderInstruction& instruction,
                                Context& context,
                                SceneGraph::TextureCache& textureCache,
                                SceneGraph::Shader& defaultShader,
-                               BufferIndex bufferIndex,
-                               float frameTime );
+                               BufferIndex bufferIndex );
 
 } // namespace Render
 
index dd6a9c64b3206b0ecaed2d398a8292f844a4e251..83c25466775eaa36e528e443aa2eae65d167adf8 100644 (file)
@@ -96,8 +96,6 @@ struct RenderManager::Impl
     resourcePostProcessQueue( resourcePostProcessQ ),
     instructions(),
     backgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR ),
-    frameTime( 0.0f ),
-    lastFrameTime( 0.0f ),
     frameCount( 0 ),
     renderBufferIndex( SceneGraphBuffers::INITIAL_UPDATE_BUFFER_INDEX ),
     defaultSurfaceRect(),
@@ -154,9 +152,6 @@ struct RenderManager::Impl
 
   Vector4                       backgroundColor;          ///< The glClear color used at the beginning of each frame.
 
-  float                         frameTime;                ///< The elapsed time since the previous frame
-  float                         lastFrameTime;            ///< Last frame delta.
-
   unsigned int                  frameCount;               ///< The current frame count
   BufferIndex                   renderBufferIndex;        ///< The index of the buffer to read from; this is opposite of the "update" buffer
 
@@ -252,11 +247,6 @@ void RenderManager::SetBackgroundColor( const Vector4& color )
   mImpl->backgroundColor = color;
 }
 
-void RenderManager::SetFrameDeltaTime( float deltaTime )
-{
-  mImpl->frameTime = deltaTime;
-}
-
 void RenderManager::SetDefaultSurfaceRect(const Rect<int>& rect)
 {
   mImpl->defaultSurfaceRect = rect;
@@ -453,7 +443,6 @@ bool RenderManager::Render( Integration::RenderStatus& status )
 
     // reset the program matrices for all programs once per frame
     // this ensures we will set view and projection matrix once per program per camera
-    // @todo move programs out of context onto a program controller and let that handle this
     mImpl->programController.ResetProgramMatrices();
 
     // if we don't have default shader, no point doing the render calls
@@ -464,7 +453,7 @@ bool RenderManager::Render( Integration::RenderStatus& status )
       {
         RenderInstruction& instruction = mImpl->instructions.At( mImpl->renderBufferIndex, i );
 
-        DoRender( instruction, *mImpl->defaultShader, mImpl->lastFrameTime );
+        DoRender( instruction, *mImpl->defaultShader );
 
         const RenderListContainer::SizeType countRenderList = instruction.RenderListCount();
         if ( countRenderList > 0 )
@@ -483,9 +472,6 @@ bool RenderManager::Render( Integration::RenderStatus& status )
 
   PERF_MONITOR_END(PerformanceMonitor::DRAW_NODES);
 
-  // Update the frame time
-  mImpl->lastFrameTime = mImpl->frameTime;
-
   // check if anything has been posted to the update thread
   bool updateRequired = !mImpl->resourcePostProcessQueue[ mImpl->renderBufferIndex ].empty();
 
@@ -510,7 +496,7 @@ bool RenderManager::Render( Integration::RenderStatus& status )
   return updateRequired;
 }
 
-void RenderManager::DoRender( RenderInstruction& instruction, Shader& defaultShader, float elapsedTime )
+void RenderManager::DoRender( RenderInstruction& instruction, Shader& defaultShader )
 {
   Rect<int> viewportRect;
   Vector4   clearColor;
@@ -591,8 +577,7 @@ void RenderManager::DoRender( RenderInstruction& instruction, Shader& defaultSha
                                     mImpl->context,
                                     mImpl->textureCache,
                                     defaultShader,
-                                    mImpl->renderBufferIndex,
-                                    elapsedTime );
+                                    mImpl->renderBufferIndex );
 
   if(instruction.mOffscreenTextureId != 0)
   {
index 62f19860d943846d3d66eb5562b9f4aa1ea55d13..91e2cc645bbd939468b1f08d539fe2c272007a0c 100644 (file)
@@ -256,9 +256,8 @@ private:
    * Helper to process a single RenderInstruction.
    * @param[in] instruction A description of the rendering operation.
    * @param[in] defaultShader default shader to use.
-   * @param[in] elapsedTime from previous render.
    */
-  void DoRender( RenderInstruction& instruction, Shader& defaultShader, float elapsedTime );
+  void DoRender( RenderInstruction& instruction, Shader& defaultShader );
 
 private:
 
index 90650efa36d8c39a1c981e746459064390061a3d..ff016aacc47dd29c874613fcd9b43baf146c9664 100644 (file)
@@ -141,12 +141,9 @@ void Renderer::Render( Context& context,
                        const Matrix& modelViewMatrix,
                        const Matrix& viewMatrix,
                        const Matrix& projectionMatrix,
-                       float frametime,
                        bool cull,
-                       bool blend)
+                       bool blend )
 {
-  // @todo MESH_REWORK Fix when merging! :D
-
   NewRenderer* renderer = dynamic_cast<NewRenderer*>(this);
 
   if( renderer )
@@ -215,11 +212,6 @@ void Renderer::Render( Context& context,
     const Vector4& color = node.GetRenderColor( bufferIndex );
     program->SetUniform4f( loc, color.r, color.g, color.b, color.a );
   }
-  loc = program->GetUniformLocation(Program::UNIFORM_TIME_DELTA);
-  if( Program::UNIFORM_UNKNOWN != loc )
-  {
-    program->SetUniform1f( loc, frametime );
-  }
 
   //@todo MESH_REWORK Remove after removing ImageRenderer
   DoSetUniforms(context, bufferIndex, mShader, program );
index 642f5977580cc9c2dbd59f120b1ec4b7ae5ba4dd..d5e91a9052ce42f34954d20ee0831dfb322c6b81 100644 (file)
@@ -106,7 +106,6 @@ public:
    * @param[in] modelViewMatrix The model-view matrix.
    * @param[in] viewMatrix The view matrix.
    * @param[in] projectionMatrix The projection matrix.
-   * @param[in] frametime The elapsed time between the last two updates.
    * @param[in] cull Whether to frustum cull this renderer
    */
   void Render( Context& context,
@@ -117,7 +116,6 @@ public:
                const Matrix& modelViewMatrix,
                const Matrix& viewMatrix,
                const Matrix& projectionMatrix,
-               float frametime,
                bool cull,
                bool blend);
 
index 7c1282bdd67bdf17f43ea4a49784382d57a4b8a8..c100895451351fc5f44913e0cf1a370a58bf17c2 100644 (file)
@@ -95,14 +95,9 @@ const char* gStdUniforms[ Program::UNIFORM_TYPE_LAST ] =
   "uViewMatrix",          // UNIFORM_VIEW_MATRIX,
   "uNormalMatrix",        // UNIFORM_NORMAL_MATRIX
   "uColor",               // UNIFORM_COLOR
-  "uCustomTextureCoords", // UNIFORM_CUSTOM_TEXTURE_COORDS
   "sTexture",             // UNIFORM_SAMPLER
   "sTextureRect",         // UNIFORM_SAMPLER_RECT
   "sEffect",              // UNIFORM_EFFECT_SAMPLER
-  "sEffectRect",          // UNIFORM_EFFECT_SAMPLER_RECT
-  "uTimeDelta",           // UNIFORM_TIME_DELTA
-  "sOpacityTexture",      // UNIFORM_SAMPLER_OPACITY
-  "sNormalMapTexture",    // UNIFORM_SAMPLER_NORMAL_MAP
   "uSize"                 // UNIFORM_SIZE
 };
 
index e1e47cd45d799d549c3a33f251de8c1a0b4e1942..9c30efbba3034db8f004139904957eb7929af27c 100644 (file)
@@ -96,14 +96,9 @@ public:
     UNIFORM_VIEW_MATRIX,
     UNIFORM_NORMAL_MATRIX,
     UNIFORM_COLOR,
-    UNIFORM_CUSTOM_TEXTURE_COORDS,
     UNIFORM_SAMPLER,
     UNIFORM_SAMPLER_RECT,
     UNIFORM_EFFECT_SAMPLER,
-    UNIFORM_EFFECT_SAMPLER_RECT,
-    UNIFORM_TIME_DELTA,
-    UNIFORM_SAMPLER_OPACITY,
-    UNIFORM_SAMPLER_NORMAL_MAP,
 
     UNIFORM_SIZE,
     UNIFORM_TYPE_LAST
index 31425a18a6810ac1608d17de9d1698774c2e1c08..f03be4f4ef3a1099516ce328d4cc16e25c898762 100644 (file)
@@ -981,9 +981,6 @@ unsigned int UpdateManager::Update( float elapsedSeconds,
 
   const BufferIndex bufferIndex = mSceneGraphBuffers.GetUpdateBufferIndex();
 
-  // Update the frame time delta on the render thread.
-  mImpl->renderManager.SetFrameDeltaTime(elapsedSeconds);
-
   // 1) Clear nodes/resources which were previously discarded
   mImpl->discardQueue.Clear( bufferIndex );