#define __DALI_INTERNAL_SCENE_GRAPH_PREPARE_RENDER_INSTRUCTIONS_H__
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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/internal/common/buffer-index.h>
#include <dali/internal/update/manager/sorted-layers.h>
+#include <dali/integration-api/resource-declarations.h>
namespace Dali
{
namespace Internal
{
+namespace Render
+{
+class Geometry;
+}
+
namespace SceneGraph
{
class RenderTracker;
-class RenderItem;
+struct RenderItem;
class Shader;
-class Material;
-class Geometry;
+class GeometryBatcher;
/**
* Structure to store information for sorting the renderers.
RendererWithSortAttributes()
: renderItem( NULL ),
shader(NULL),
- material(NULL),
+ textureResourceId( Integration::InvalidResourceId ),
geometry(NULL),
zValue(0.0f)
{
}
- RenderItem* renderItem; ///< The render item that is being sorted (includes depth index)
- Shader* shader; ///< The shader instance
- Material* material; ///< The material instance
- Geometry* geometry; ///< The geometry instance
- float zValue; // The zValue of the given renderer (either distance from camera, or a custom calculated value)
+ RenderItem* renderItem; ///< The render item that is being sorted (includes depth index)
+ const Shader* shader; ///< The shader instance
+ Integration::ResourceId textureResourceId;///< The first texture resource ID of the texture set instance, is InvalidResourceId if the texture set doesn't have any textures
+ const Render::Geometry* geometry; ///< The geometry instance
+ float zValue; ///< The zValue of the given renderer (either distance from camera, or a custom calculated value)
};
typedef std::vector< RendererWithSortAttributes > RendererSortingHelper;
class RenderInstructionContainer;
/**
- * Sorts and prepares the list of opaque/transparent renderable
- * attachments for each layer. Whilst iterating through each layer,
- * update the attachments ModelView matrices
+ * Sorts and prepares the list of opaque/transparent renderers for each layer.
+ * Whilst iterating through each layer, update the renderitems ModelView matrices
*
* The opaque and transparent render lists are sorted first by depth
- * index, then by Z (for transparent only), then by shader, material
+ * index, then by Z (for transparent only), then by shader, texture
* and geometry. The render algorithm should then work through both
* lists simultaneously, working through opaque then transparent
* items at each depth index, resetting the flags appropriately.
* @param[in] updateBufferIndex The current update buffer index.
* @param[in] sortedLayers The layers containing lists of opaque/transparent renderables.
* @param[in] renderTask The rendering task information.
- * @param[in] renderTracker A tracker object if we need to know when this render instruction has actually rendered, or NULL if tracking is not required
+ * @param[in] sortingHelper to avoid allocating containers for sorting every frame
+ * @param[in] cull Whether frustum culling is enabled or not
* @param[out] instructions The rendering instructions for the next frame.
*/
void PrepareRenderInstruction( BufferIndex updateBufferIndex,
SortedLayerPointers& sortedLayers,
RenderTask& renderTask,
RendererSortingHelper& sortingHelper,
- RenderTracker* renderTracker,
- RenderInstructionContainer& instructions );
+ bool cull,
+ RenderInstructionContainer& instructions,
+ GeometryBatcher& geometryBatcher );
} // namespace SceneGraph