mDataNeedsUploading = false;
}
+
+ for( unsigned int i = 0; i < mVertexBuffers.Count(); ++i )
+ {
+ mVertexBuffers[i]->Upload( context, bufferIndex );
+ }
+ if( mIndexBuffer )
+ {
+ mIndexBuffer->Upload( context, bufferIndex );
+ }
}
void RenderGeometry::DoUpload(
GpuBuffer::ARRAY_BUFFER,
GpuBuffer::STATIC_DRAW ); // TODO: MESH_REWORK: change this for animated meshes
- propertyBuffer->Upload( context, bufferIndex );
-
mVertexBuffers.PushBack( propertyBuffer );
}
*indexBuffer,
GpuBuffer::ELEMENT_ARRAY_BUFFER,
GpuBuffer::STATIC_DRAW ); // TODO: MESH_REWORK: change this for animated meshes
-
- mIndexBuffer->Upload( context, bufferIndex );
}
}
* limitations under the License.
*/
+// CLASS HEADERS
#include <dali/internal/render/renderers/render-renderer-property-buffer.h>
+// INTERNAL INCLUDES
#include <dali/internal/render/gl-resources/gpu-buffer.h>
#include <dali/internal/render/shaders/program.h>
void PropertyBuffer::SetData( BufferIndex bufferIndex, PropertyBufferDataProvider::BufferType* data )
{
mBufferData[bufferIndex] = data;
+ mDataChanged[bufferIndex] = true;
}
void PropertyBuffer::ConnectToSceneGraph( SceneController& sceneController, BufferIndex bufferIndex )
bool PropertyBuffer::HasDataChanged( BufferIndex bufferIndex ) const
{
- //TODO: MESH_REWORK fix this
- DALI_ASSERT_DEBUG(false && "FIX THIS");
- return true;
+ return mDataChanged[ bufferIndex ];
}
unsigned int PropertyBuffer::GetAttributeCount( BufferIndex bufferIndex ) const
// Update double buffered value
mBufferData.CopyPrevious(updateBufferIndex);
+
+ // The flag should be reset each frame
+ mDataChanged[updateBufferIndex] = false;
}
} // namespace SceneGraph
OwnerPointer<PropertyBufferMetadata::Format> mFormat; ///< Format of the buffer
DoubleBuffered< OwnerPointer<PropertyBufferDataProvider::BufferType> > mBufferData; ///< Data
+ DoubleBuffered< bool > mDataChanged; ///< Flag to know if data has changed in a frame
DoubleBufferedProperty<unsigned int> mSize; ///< Number of Elements in the buffer
};
enum
{
PROGRAM = DEFAULT_OBJECT_PROPERTY_START_INDEX, ///< name "program", type MAP; {"vertex-prefix":"","fragment-prefix":"","vertex":"","fragment":""}
- SHADER_HINTS, ///< name "shader-hints", type UNSIGNED_INTEGER; (bitfield) values from enum GeometryHints
+ SHADER_HINTS, ///< name "shader-hints", type UNSIGNED_INTEGER; (bitfield) values from enum Shader::Hints
};
};