/**
* @brief Interface class for RenderCommand types in the graphics API.
+ *
+ * @startuml
+ *
+ * skinparam defaultFontName Ubuntu Mono
+ * class RenderCommand {
+ * -- protected --
+ * #VertexAttributeBufferBinding[] mVertexBufferBindings
+ * #UniformBufferBinding[] mUniformBufferBindings
+ * #TextureBinding[] mTextureBindings
+ * #SamplerBinding[] mSamplerBindings
+ * #IndexBufferBinding mIndexBufferBinding
+ * #RenderTargetBinding mRenderTargetBinding
+ * #DrawCommand mDrawCommand
+ * #PushConstantsBinding[] mPushConstantsBindings
+ * #RenderState mRenderState
+ *
+ * -- public API --
+ * +RenderCommand& BindVertextBuffers()
+ * +RenderCommand& BindUniformBuffers()
+ * +RenderCommand& BindTextures()
+ * +RenderCommand& BindSamplers()
+ * +RenderCommand& PushConstants()
+ * +RenderCommand& BindRenderState()
+ * +RenderCommand& Draw()
+ * -- static API ( helper functions )--
+ * {static} NewVertexAttributeBufferBindings()
+ * {static} NewVertexAttributeBufferBindings()
+ * {static} NewVertexAttributeBufferBindings()
+ * {static} NewTextureBindings()
+ * {static} NewPushConstantsBindings()
+ * }
+ *
+ * class VertexAttributeBufferBinding {
+ * Accessor<Buffer> buffer
+ * uint32_t location
+ * uint32_t offset
+ * uint32_t stride
+ * InputAttributeRate rate
+ * void* pNext
+ * }
+ *
+ * class UniformBufferBinding {
+ * #Accessor<Buffer> buffer
+ * #uint32_t offset
+ * #uint32_t dataSize
+ * #uint32_t binding
+ * #void* pNext
+ * }
+ *
+ class IndexBufferBinding {
+ #Accessor<Buffer> buffer
+ #uint32_t offset
+ #IndexType type
+ #void* pNext
+ }
+
+ class RenderTargetBinding {
+ #Accessor<Framebuffer> framebuffer
+ #std::vector<Framebuffer::ClearColor> clearColors
+ #Framebuffer::DepthStencilClearColor dsClearColor
+ #void* pNext
+ }
+
+ class DrawCommand {
+ #DrawType drawType;
+ #uint32_t firstVertex
+ #uint32_t firstIndex
+ #uint32_t vertexCount
+ #uint32_t indicesCount
+ #uint32_t firstInstance
+ #uint32_t instanceCount
+ #void* pNext
+ }
+
+ class PushConstantsBinding {
+ #void* data
+ #uint32_t size
+ #uint32_t binding
+ #void* pNext
+ }
+
+ class RenderState {
+ #Accessor<Shader> shader
+ #void* pNext
+ }
+
+ class TextureBinding {
+ #Accessor<Texture> texture
+ #Accessor<Sampler> sampler
+ #uint32_t binding
+ #void* pNext
+ }
+
+ class SamplerBinding {
+ #Accessor<Sampler> sampler
+ #uint32_t binding
+ #void* pNext
+ }
+
+ note as RenderStateWIP
+ Other render states like
+ blending etc. should be added
+ as public fields of this structure.
+ end note
+
+ RenderStateWIP .. RenderState
+
+ * note as N1
+ * Each state is described as POD
+ * structure which is a Vulkan
+ * approach.
+ * end note
+ *
+ * note as N2
+ * Field pNext may be used by the
+ * implementation to pass additional
+ * data.
+ * end note
+ *
+ * N2 .. VertexAttributeBufferBinding::pNext
+ * N1 .. VertexAttributeBufferBinding
+ * N1 .. UniformBufferBinding
+ * N1 .. IndexBufferBinding
+ * N1 .. RenderTargetBinding
+ *
+
+ *
+ * RenderCommand *-right- VertexAttributeBufferBinding
+ * RenderCommand *-right- UniformBufferBinding
+ * RenderCommand *-left- IndexBufferBinding
+ * RenderCommand *-left- RenderTargetBinding
+ * RenderCommand *-up- RenderState
+ * RenderCommand *-up- DrawCommand
+ * RenderCommand *-down- PushConstantsBinding
+ * RenderCommand *-down- SamplerBinding
+ * RenderCommand *-down- TextureBinding
+ * @enduml
*/
class RenderCommand
{
/**
* Describes buffer attribute binding
+ *
*/
struct VertexAttributeBufferBinding
{
} // namespace Graphics
} // namespace Dali
+
#endif // DALI_GRAPHICS_API_RENDER_COMMAND_H
namespace VulkanAPI
{
-
struct UboManager::Impl
{
explicit Impl( UboManager& uboManager, Controller& controller )
{
public:
+ /**
+ *
+ * @param controller
+ */
explicit UboManager( Controller& controller );
~UboManager();
{
class PipelineCache;
}
+
namespace VulkanAPI
{
class Controller;
namespace
{
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wlarger-than="
+
/**
* List of all the SPIR-V opcodes
* OpCodes describing types: 19-39
{"OpGroupFMaxNonUniformAMD", 5005, true, true, false},
{"OpGroupUMaxNonUniformAMD", 5006, true, true, false},
{"OpGroupSMaxNonUniformAMD", 5007, true, true, false}};
-#pragma GCC diagnostic pop
+
static const SPIRVOpCode OP_CODE_NULL{};
const SPIRVOpCode& FindOpCode( uint32_t code )
{
return *mImpl;
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wframe-larger-than="
struct SPIRVShader::Impl
{
/**
Header header;
};
-#pragma GCC diagnostic pop
/**************************************************************************************
* SPIRVShader
#include <dali/graphics/vulkan/vulkan-graphics.h>
#include <dali/graphics/vulkan/vulkan-image.h>
-
namespace Dali
{
namespace Graphics
// creating render pass may happen either as deferred or
// when framebuffer is initialised into immutable state
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wframe-larger-than="
bool Initialise()
{
mAttachmentReference.clear();
return true;
}
-#pragma GCC diagnostic pop
/**
* Creates immutable framebuffer object
};
Graphics::Graphics() = default;
-
Graphics::~Graphics() = default;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wframe-larger-than="
Platform Graphics::GetDefaultPlatform() const
{
info.setEnabledExtensionCount(U32(extensions.size()))
.setPpEnabledExtensionNames(extensions.data())
.setEnabledLayerCount(U32(validationLayers.size()))
- .setEnabledLayerCount(0)
+ //.setEnabledLayerCount(0)
.setPpEnabledLayerNames(validationLayers.data());
mInstance = VkAssert(vk::createInstance(info, *mAllocator));
mDeviceMemoryManager = GpuMemoryManager::New( *this );
}
-#pragma GCC diagnostic pop
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wframe-larger-than="
void Graphics::GetPhysicalDeviceProperties()
{
// store data on heap to keep object smaller
mPhysicalDeviceFeatures =
MakeUnique<vk::PhysicalDeviceFeatures>(mPhysicalDevice.getFeatures());
}
-#pragma GCC diagnostic pop
void Graphics::GetQueueFamilyProperties()
{
return mSurfaceFBIDMap[surfaceId].swapchain;
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wframe-larger-than="
std::vector< vk::DeviceQueueCreateInfo > Graphics::GetQueueCreateInfos()
{
// surface is needed in order to find a family that supports presentation to this surface
return queueInfos;
}
-#pragma GCC diagnostic pop
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wframe-larger-than="
void Graphics::CreateDevice()
{
auto queueInfos = GetQueueCreateInfos();
mPipelineDatabase = std::make_unique<PipelineCache>( *this );
}
-#pragma GCC diagnostic pop
vk::Device Graphics::GetDevice() const
{
public:
Graphics();
- Graphics(std::unique_ptr< SurfaceFactory > surfaceFactory);
+ explicit Graphics(std::unique_ptr< SurfaceFactory > surfaceFactory);
Graphics(const Graphics&) = delete;
Graphics& operator=(const Graphics&) = delete;
~Graphics();
return true;
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wframe-larger-than="
void PrepareFramebuffers()
{
/*
* @param image
* @return
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wframe-larger-than="
FramebufferRef CreateFramebuffer( vk::Image& image )
{
auto fbRef = Framebuffer::New( mGraphics, mSwapchainExtent.width, mSwapchainExtent.height );
return fbRef;
}
-#pragma GCC diagnostic pop
/**
* This function acquires next framebuffer
* @todo we should rather use roundrobin method
* @return
*/
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wframe-larger-than="
+
FramebufferRef AcquireNextFramebuffer()
{
const auto& device = mGraphics.GetDevice();