// INTERNAL INCLUDES
#include <dali/devel-api/threading/thread-pool.h>
#include <dali/integration-api/core.h>
-#include <dali/integration-api/gl-context-helper-abstraction.h>
#include <dali/internal/event/common/scene-impl.h>
OwnerContainer<Render::RenderTracker*> mRenderTrackers; ///< List of render trackers
- ProgramController programController; ///< Owner of the GL programs
+ ProgramController programController; ///< Owner of the programs
Render::ShaderCache shaderCache; ///< The cache for the graphics shaders
std::unique_ptr<Render::UniformBufferManager> uniformBufferManager; ///< The uniform buffer manager
// Offscreen buffer rendering
if(instruction.mIsViewportSet)
{
- // For glViewport the lower-left corner is (0,0)
+ // For Viewport the lower-left corner is (0,0)
const int32_t y = (instruction.mFrameBuffer->GetHeight() - instruction.mViewport.height) - instruction.mViewport.y;
viewportRect.Set(instruction.mViewport.x, y, instruction.mViewport.width, instruction.mViewport.height);
}
// Check whether a viewport is specified, otherwise the full surface size is used
if(instruction.mIsViewportSet)
{
- // For glViewport the lower-left corner is (0,0)
+ // For Viewport the lower-left corner is (0,0)
const int32_t y = (surfaceRect.height - instruction.mViewport.height) - instruction.mViewport.y;
viewportRect.Set(instruction.mViewport.x, y, instruction.mViewport.width, instruction.mViewport.height);
}
clippingRect,
surfaceOrientation);
- // Synchronise the FBO/Texture access
-
- // Check whether any bound texture is in the dependency list
- bool textureFound = false;
-
- if(mImpl->boundTextures.Count() > 0u && mImpl->textureDependencyList.Count() > 0u)
- {
- for(auto texture : mImpl->textureDependencyList)
- {
- textureFound = std::find_if(mImpl->boundTextures.Begin(), mImpl->boundTextures.End(), [texture](Graphics::Texture* graphicsTexture) {
- return texture == graphicsTexture;
- }) != mImpl->boundTextures.End();
- }
- }
-
- if(textureFound)
- {
- if(instruction.mFrameBuffer)
- {
- // For off-screen buffer
-
- // Clear the dependency list
- mImpl->textureDependencyList.Clear();
- }
- else
- {
- // Worker thread lambda function
- auto& glContextHelperAbstraction = mImpl->graphicsController.GetGlContextHelperAbstraction();
- auto workerFunction = [&glContextHelperAbstraction](int workerThread) {
- // Switch to the shared context in the worker thread
- glContextHelperAbstraction.MakeSurfacelessContextCurrent();
-
- // Wait until all rendering calls for the shared context are executed
- glContextHelperAbstraction.WaitClient();
-
- // Must clear the context in the worker thread
- // Otherwise the shared context cannot be switched to from the render thread
- glContextHelperAbstraction.MakeContextNull();
- };
-
- auto future = mImpl->threadPool->SubmitTask(0u, workerFunction);
- if(future)
- {
- mImpl->threadPool->Wait();
-
- // Clear the dependency list
- mImpl->textureDependencyList.Clear();
- }
- }
- }
-
Graphics::SyncObject* syncObject{nullptr};
// If the render instruction has an associated render tracker (owned separately)
// and framebuffer, create a one shot sync object, and use it to determine when
{
namespace Integration
{
-class GlAbstraction;
-class GlContextHelperAbstraction;
class RenderStatus;
class Scene;
} // namespace Integration
Graphics::SyncObject* CreateSyncObject(Graphics::Controller& graphicsController);
/**
- * Check the GL Sync objects. This is called from Render Thread.
- * If the GlSyncObject has been triggered, then atomically set the sync trigger
+ * Check the Sync objects. This is called from Render Thread.
+ * If the SyncObject has been triggered, then atomically set the sync trigger
*/
void PollSyncObject();
// INTERNAL INCLUDES
#include <dali/devel-api/rendering/frame-buffer-devel.h>
-#include <dali/integration-api/gl-defines.h>
#include <dali/internal/render/renderers/render-sampler.h>
#include <dali/public-api/rendering/frame-buffer.h>
if(elementBufferOffset != 0u)
{
elementBufferOffset = (elementBufferOffset >= numIndices) ? numIndices - 1 : elementBufferOffset;
- firstIndexOffset = elementBufferOffset * sizeof(GLushort);
+ firstIndexOffset = elementBufferOffset * sizeof(uint16_t);
numIndices -= elementBufferOffset;
}
else
{
// Un-indexed draw call
- GLsizei numVertices(0u);
+ uint32_t numVertices(0u);
if(vertexBufferCount > 0)
{
// truncated, no value loss happening in practice
- numVertices = static_cast<GLsizei>(mVertexBuffers[0]->GetElementCount());
+ numVertices = static_cast<uint32_t>(mVertexBuffers[0]->GetElementCount());
}
commandBuffer.Draw(numVertices, 1, 0, 0);
// INTERNAL INCLUDES
#include <dali/devel-api/common/owner-container.h>
#include <dali/graphics-api/graphics-controller.h>
-#include <dali/integration-api/gl-abstraction.h>
-#include <dali/integration-api/gl-defines.h>
#include <dali/internal/common/buffer-index.h>
#include <dali/internal/common/owner-pointer.h>
#include <dali/public-api/common/dali-vector.h>
#include <dali/internal/render/renderers/render-texture.h>
#include <dali/internal/render/renderers/render-vertex-buffer.h>
#include <dali/internal/render/renderers/shader-cache.h>
+#include <dali/internal/render/renderers/uniform-buffer-view-pool.h>
+#include <dali/internal/render/renderers/uniform-buffer-view.h>
#include <dali/internal/render/shaders/program.h>
#include <dali/internal/render/shaders/render-shader.h>
#include <dali/internal/update/common/uniform-map.h>
-#include <dali/internal/render/renderers/uniform-buffer-view.h>
-#include <dali/internal/render/renderers/uniform-buffer-view-pool.h>
namespace Dali::Internal
{
}
// Create uniform buffer view from uniform buffer
- Graphics::UniquePtr<Render::UniformBufferView> uboView {nullptr};
+ Graphics::UniquePtr<Render::UniformBufferView> uboView{nullptr};
if(uniformBlockAllocationBytes)
{
- auto uboPoolView = mUniformBufferManager->GetUniformBufferViewPool( bufferIndex );
+ auto uboPoolView = mUniformBufferManager->GetUniformBufferViewPool(bufferIndex);
- uboView = uboPoolView->CreateUniformBufferView( uniformBlockAllocationBytes );
+ uboView = uboPoolView->CreateUniformBufferView(uniformBlockAllocationBytes);
}
// update the uniform buffer
std::vector<Graphics::UniformBufferBinding>* bindings{&mUniformBufferBindings};
- mUniformBufferBindings[0].buffer = uboView->GetBuffer( &mUniformBufferBindings[0].offset );
+ mUniformBufferBindings[0].buffer = uboView->GetBuffer(&mUniformBufferBindings[0].offset);
// Write default uniforms
WriteDefaultUniform(program->GetDefaultUniform(Program::DefaultUniformIndex::MODEL_MATRIX), *uboView, *bindings, modelMatrix);
mUniformBufferBindings[i].binding = reflection.GetUniformBlockBinding(i);
dataOffset += GetUniformBufferDataAlignment(mUniformBufferBindings[i].dataSize);
- mUniformBufferBindings[i].buffer = ubo.GetBuffer( &mUniformBufferBindings[i].offset );
+ mUniformBufferBindings[i].buffer = ubo.GetBuffer(&mUniformBufferBindings[i].offset);
for(UniformIndexMappings::Iterator iter = mUniformIndexMap.Begin(),
end = mUniformIndexMap.End();
}
case Property::Type::MATRIX3:
{
- // todo: handle data padding properly
+ // @todo: handle data padding properly
+ // Get padding requirement from Graphics
+ //
// Vulkan:
//
//const auto& matrix = &(*iter).propertyValue->GetMatrix3(updateBufferIndex);
} // namespace Render
-} // namespace Dali
+} // namespace Dali::Internal
* @param[in] dataProviders The data providers for the renderer
* @param[in] geometry The geometry for the renderer
* @param[in] blendingBitmask A bitmask of blending options.
- * @param[in] blendColor The blend color to pass to GL
+ * @param[in] blendColor The blend color
* @param[in] faceCullingMode The face-culling mode.
* @param[in] preMultipliedAlphaEnabled whether alpha is pre-multiplied.
* @param[in] depthWriteMode Depth buffer write mode
* @param[in] dataProviders The data providers for the renderer
* @param[in] geometry The geometry for the renderer
* @param[in] blendingBitmask A bitmask of blending options.
- * @param[in] blendColor The blend color to pass to GL
+ * @param[in] blendColor The blend color
* @param[in] faceCullingMode The face-culling mode.
* @param[in] preMultipliedAlphaEnabled whether alpha is pre-multiplied.
* @param[in] depthWriteMode Depth buffer write mode
/**
* Set the blend color for blending options
- * @param[in] blendColor The blend color to pass to GL
+ * @param[in] blendColor The blend color
*/
void SetBlendColor(const Vector4& color);
template<class T>
bool WriteDefaultUniform(const Graphics::UniformInfo* uniformInfo,
- Render::UniformBufferView& ubo,
+ Render::UniformBufferView& ubo,
const std::vector<Graphics::UniformBufferBinding>& bindings,
const T& data);
template<class T>
- void WriteUniform(Render::UniformBufferView& ubo,
+ void WriteUniform(Render::UniformBufferView& ubo,
const std::vector<Graphics::UniformBufferBinding>& bindings,
const Graphics::UniformInfo& uniformInfo,
const T& data);
- void WriteUniform(Render::UniformBufferView& ubo,
+ void WriteUniform(Render::UniformBufferView& ubo,
const std::vector<Graphics::UniformBufferBinding>& bindings,
const Graphics::UniformInfo& uniformInfo,
const void* data,
*/
void FillUniformBuffer(Program& program,
const SceneGraph::RenderInstruction& instruction,
- Render::UniformBufferView& ubo,
+ Render::UniformBufferView& ubo,
std::vector<Graphics::UniformBufferBinding>*& outBindings,
uint32_t& offset,
BufferIndex updateBufferIndex);
#include <dali/graphics-api/graphics-texture-create-info.h>
#include <dali/graphics-api/graphics-texture.h>
#include <dali/graphics-api/graphics-types.h>
-#include <dali/integration-api/gl-defines.h>
#include <dali/internal/event/rendering/texture-impl.h>
#include <dali/internal/render/renderers/render-sampler.h>
*/
// INTERNAL INCLUDES
-#include <dali/integration-api/gl-abstraction.h> // for GLenum
#include <dali/internal/common/shader-data.h>
namespace Dali
#include <dali/internal/render/shaders/program-controller.h>
// INTERNAL INCLUDES
-#include <dali/integration-api/gl-defines.h>
#include <dali/internal/common/shader-saver.h>
#include <dali/internal/render/shaders/program.h>
#include <dali/graphics-api/graphics-program.h>
#include <dali/graphics-api/graphics-reflection.h>
#include <dali/integration-api/debug.h>
-#include <dali/integration-api/gl-defines.h>
#include <dali/internal/common/shader-data.h>
#include <dali/internal/render/common/performance-monitor.h>
#include <dali/internal/render/shaders/program-cache.h>