// INTERNAL INCLUDES
#include <dali/graphics/vulkan/vulkan-types.h>
-
+#include <dali/graphics-api/graphics-api-render-command.h>
namespace Dali
{
namespace Graphics
ShaderRef vertexShader;
ShaderRef fragmentShader;
+ API::RenderCommand::RenderState::BlendState blendState;
+
bool operator==(const PipelineDescription& description) const
{
return (vertexShader == description.vertexShader) &&
- (fragmentShader == description.fragmentShader);
+ (fragmentShader == description.fragmentShader) &&
+ (std::memcmp( &blendState, &description.blendState, sizeof(blendState) ));
}
std::vector<vk::DescriptorSetLayout> descriptorSetLayouts;
mQueue.Submit( cmdBuffer, FenceRef{} );
mQueue.WaitIdle();
}
-#pragma GCC diagnostic pop
bool SetImageFormat()
{
}
swapBuffer.firstUse = false;
- // Begins primary render pass
- BeginPrimaryRenderPass( swapBuffer );
-
return swapBuffer.framebuffer;
}
-#pragma GCC diagnostic pop
- void BeginPrimaryRenderPass( SwapchainBuffer& currentBuffer )
+
+ void BeginPrimaryRenderPass()
{
+ auto& currentBuffer = mSwapchainBuffer[mCurrentBufferIndex];
+
vk::RenderPassBeginInfo rpInfo{};
rpInfo.setRenderPass( currentBuffer.framebuffer->GetVkRenderPass() )
.setFramebuffer( currentBuffer.framebuffer->GetVkFramebuffer() )
currentBuffer.masterCmdBuffer->BeginRenderPass( rpInfo, vk::SubpassContents::eSecondaryCommandBuffers );
}
+ void BeginPrimaryRenderPass( std::vector<std::array<float,4>> colors )
+ {
+ auto& currentBuffer = mSwapchainBuffer[mCurrentBufferIndex];
+
+ vk::RenderPassBeginInfo rpInfo{};
+
+ auto newColors = currentBuffer.framebuffer->GetDefaultClearValues();
+ newColors[0].color.setFloat32( { colors[0][0],
+ colors[0][1],
+ colors[0][2],
+ colors[0][3]
+ } );
+
+ rpInfo.setRenderArea( vk::Rect2D( {0, 0}, mSurface->GetSize() ) )
+ .setRenderPass( currentBuffer.framebuffer->GetVkRenderPass() )
+ .setFramebuffer( currentBuffer.framebuffer->GetVkFramebuffer() )
+ .setPClearValues( newColors.data() )
+ .setClearValueCount( U32( currentBuffer.framebuffer->GetDefaultClearValues().size() ) );
+
+ currentBuffer.masterCmdBuffer->BeginRenderPass( rpInfo, vk::SubpassContents::eSecondaryCommandBuffers );
+ }
+
void EndPrimaryRenderPass( SwapchainBuffer& currentBuffer )
{
currentBuffer.masterCmdBuffer->EndRenderPass();
* The master command buffer must be in the recording state
* @param swapBuffer
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wframe-larger-than="
void UpdateLayoutPresentToColorAttachment( SwapchainBuffer& swapBuffer )
{
auto& cmdBuf = swapBuffer.masterCmdBuffer;
std::vector<vk::BufferMemoryBarrier>{},
barriers );
}
-#pragma GCC diagnostic pop
CommandBufferRef GetPrimaryCommandBuffer() const
{
return mImpl->GetPrimaryCommandBuffer();
}
+void Swapchain::BeginPrimaryRenderPass()
+{
+ mImpl->BeginPrimaryRenderPass( );
+}
+
+void Swapchain::BeginPrimaryRenderPass( std::vector<std::array<float,4>> colors )
+{
+ mImpl->BeginPrimaryRenderPass( colors );
+}
+
+
} // namespace Vulkan
} // namespace Graphics
} // namespace Dali
CommandBufferRef GetPrimaryCommandBuffer() const;
/**
+ * Begins primary render pass, must be called after acquiring new image
+ */
+ void BeginPrimaryRenderPass();
+
+ /**
+ * Begins primary render pass, must be called after acquiring new image
+ * @param beginInfo custom initialisation structure
+ */
+ void BeginPrimaryRenderPass( std::vector<std::array<float,4>> colors );
+
+ /**
* Presents using default present queue, asynchronously
*/
void Present();