[Tizen] Make SceneView FBO multisampling + Sync utc harness 70/284570/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 11 Nov 2022 13:51:03 +0000 (22:51 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Sun, 20 Nov 2022 07:33:52 +0000 (16:33 +0900)
Let we make SceneView's FBO usecase use multisampling as default.

Change-Id: Ibaafba7cd384fcf4162c6ccc126dd76228c0e98f
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h
dali-scene3d/internal/controls/scene-view/scene-view-impl.cpp
dali-scene3d/internal/controls/scene-view/scene-view-impl.h

index 7a31046..6021026 100644 (file)
@@ -166,6 +166,11 @@ bool TestGlAbstraction::IsAdvancedBlendEquationSupported()
   return true;
 }
 
+bool TestGlAbstraction::IsMultisampledRenderToTextureSupported()
+{
+  return true;
+}
+
 bool TestGlAbstraction::IsBlendEquationSupported(DevelBlendEquation::Type blendEquation)
 {
   return true;
index f6878ae..5e5fde3 100644 (file)
@@ -72,6 +72,8 @@ public:
 
   bool IsAdvancedBlendEquationSupported() override;
 
+  bool IsMultisampledRenderToTextureSupported() override;
+
   bool IsBlendEquationSupported(DevelBlendEquation::Type blendEquation) override;
 
   std::string GetShaderVersionPrefix();
@@ -1702,6 +1704,12 @@ public:
   {
   }
 
+  inline void FramebufferTexture2DMultisample(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) override
+  {
+    // TODO : Check it if need
+    FramebufferTexture2D(target, attachment, textarget, texture, level);
+  }
+
   inline void FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) override
   {
   }
index 9c1e373..49579a4 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali/devel-api/adaptor-framework/window-devel.h>
 #include <dali/devel-api/common/stage.h>
 #include <dali/integration-api/adaptor-framework/adaptor.h>
+#include <dali/devel-api/rendering/frame-buffer-devel.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/object/type-registry.h>
@@ -59,6 +60,7 @@ DALI_TYPE_REGISTRATION_END()
 Property::Index   RENDERING_BUFFER    = Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX + 1;
 constexpr int32_t DEFAULT_ORIENTATION = 0;
 
+constexpr uint8_t DEFAULT_FRAME_BUFFER_MULTI_SAMPLING_LEVEL = 4u;
 } // anonymous namespace
 
 SceneView::SceneView()
@@ -404,10 +406,11 @@ void SceneView::UpdateRenderTask()
         mRenderTask.SetViewport(Dali::Viewport(Vector4::ZERO));
 
         // create offscreen buffer of new size to render our child actors to
-        mTexture      = Dali::Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, unsigned(size.width), unsigned(size.height));
-        mRenderTarget = FrameBuffer::New(size.width, size.height, FrameBuffer::Attachment::DEPTH_STENCIL);
-        mRenderTarget.AttachColorTexture(mTexture);
-        Dali::Toolkit::ImageUrl imageUrl = Dali::Toolkit::Image::GenerateUrl(mRenderTarget, 0u);
+        mTexture     = Dali::Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, unsigned(size.width), unsigned(size.height));
+        mFrameBuffer = FrameBuffer::New(size.width, size.height, FrameBuffer::Attachment::DEPTH_STENCIL);
+        mFrameBuffer.AttachColorTexture(mTexture);
+        DevelFrameBuffer::SetMultiSamplingLevel(mFrameBuffer, DEFAULT_FRAME_BUFFER_MULTI_SAMPLING_LEVEL);
+        Dali::Toolkit::ImageUrl imageUrl = Dali::Toolkit::Image::GenerateUrl(mFrameBuffer, 0u);
 
         Property::Map imagePropertyMap;
         imagePropertyMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
@@ -418,7 +421,7 @@ void SceneView::UpdateRenderTask()
 
         Toolkit::DevelControl::RegisterVisual(*this, RENDERING_BUFFER, mVisual);
 
-        mRenderTask.SetFrameBuffer(mRenderTarget);
+        mRenderTask.SetFrameBuffer(mFrameBuffer);
         mRenderTask.SetClearEnabled(true);
         mRenderTask.SetClearColor(Color::TRANSPARENT);
       }
@@ -435,7 +438,7 @@ void SceneView::UpdateRenderTask()
         Toolkit::DevelControl::UnregisterVisual(*this, RENDERING_BUFFER);
 
         mVisual.Reset();
-        mRenderTarget.Reset();
+        mFrameBuffer.Reset();
         mTexture.Reset();
       }
     }
index 5cacf7b..3282370 100644 (file)
@@ -235,7 +235,7 @@ private:
   CameraActor                                              mSelectedCamera;
   std::vector<CameraActor>                                 mCameras;
   std::vector<Scene3D::Internal::ImageBasedLightObserver*> mItems;
-  Dali::FrameBuffer                                        mRenderTarget;
+  Dali::FrameBuffer                                        mFrameBuffer;
   Dali::Texture                                            mTexture;
   Dali::RenderTask                                         mRenderTask;
   Layer                                                    mRootLayer;