Change to using intrusive pointer as, especially after GL Context loss
and restore, the pointer may not be valid. IntrusivePtr ensures that
the program data will not be destroyed for the lifetime of the program
class
Change-Id: Ibe3b27b2e4f94baab04e325b8284b9d26f516240
void Program::Load()
{
- DALI_ASSERT_ALWAYS( NULL != mProgramData && "Program data is not initialized" );
+ DALI_ASSERT_ALWAYS( NULL != mProgramData.Get() && "Program data is not initialized" );
Unload();
#include <dali/public-api/object/ref-object.h>
#include <dali/internal/render/gl-resources/context.h>
#include <dali/integration-api/resource-cache.h>
+#include <dali/integration-api/shader-data.h>
namespace Dali
{
GLuint mVertexShaderId; ///< GL identifier for vertex shader
GLuint mFragmentShaderId; ///< GL identifier for fragment shader
GLuint mProgramId; ///< GL identifier for program
- Integration::ShaderData* mProgramData; ///< Shader program source and binary (when compiled & linked or loaded)
+ Integration::ShaderDataPtr mProgramData; ///< Shader program source and binary (when compiled & linked or loaded)
// location caches
GLint mAttribLocations[ ATTRIB_TYPE_LAST ]; ///< attribute location cache