#define DALI_INTERNAL_RENDER_GEOMETRY_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// 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/graphics-api/graphics-types.h>
#include <dali/internal/common/buffer-index.h>
#include <dali/internal/common/owner-pointer.h>
#include <dali/public-api/common/dali-vector.h>
class Geometry
{
public:
- using Type = Dali::Geometry::Type;
+ using Type = Dali::Geometry::Type;
+ using IndexType = Dali::Graphics::Format;
+
+ using Uint16ContainerType = Dali::Vector<uint16_t>;
+ using Uint32ContainerType = Dali::Vector<uint32_t>;
Geometry();
* Set the data for the index buffer to be used by the geometry
* @param[in] indices A vector containing the indices
*/
- void SetIndexBuffer(Dali::Vector<uint16_t>& indices);
+ void SetIndexBuffer(Uint16ContainerType& indices);
+
+ /**
+ * Set the data for the index buffer to be used by the geometry
+ * @param[in] indices A vector containing the indices
+ */
+ void SetIndexBuffer(Uint32ContainerType& indices);
/**
* Removes a VertexBuffer from the geometry
* Check if the attributes for the geometry have changed
* @return True if vertex buffers have been added or removed since last frame, false otherwise
*/
- [[nodiscard]] bool AttributesChanged() const
+ [[maybe_unused]] [[nodiscard]] bool AttributesChanged() const
{
return mAttributesChanged;
}
* Set up the attributes and perform the Draw call corresponding to the geometry type.
*
* @param[in] graphicsController The graphics controller
- * @param[in] bufferIndex The current buffer index
+ * @param[in,out] commandBuffer The current command buffer queue
* @param[in] elementBufferOffset The index of first element to draw if index buffer bound
* @param[in] elementBufferCount Number of elements to draw if index buffer bound, uses whole buffer when 0
* @return true if the draw command was issued, false otherwise
uint32_t elementBufferOffset,
uint32_t elementBufferCount);
+ /**
+ * @brief Set up the attributes bind commaneds
+ *
+ * @param[in,out] commandBuffer The current command buffer queue
+ * @return true if the bind command was issued, false otherwise
+ */
+ bool BindVertexAttributes(Graphics::CommandBuffer& commandBuffer);
+
private:
// VertexBuffers
Vector<Render::VertexBuffer*> mVertexBuffers;
- Dali::Vector<uint16_t> mIndices;
+ Uint16ContainerType mIndices;
OwnerPointer<GpuBuffer> mIndexBuffer;
+ IndexType mIndexType;
Type mGeometryType;
// Booleans