$(platform_abstraction_src_dir)/debug.cpp \
$(platform_abstraction_src_dir)/profiling.cpp \
$(platform_abstraction_src_dir)/input-options.cpp \
- $(platform_abstraction_src_dir)/shader-data.cpp \
$(platform_abstraction_src_dir)/system-overlay.cpp \
$(platform_abstraction_src_dir)/lockless-buffer.cpp \
$(platform_abstraction_src_dir)/events/event.cpp \
$(platform_abstraction_src_dir)/gesture-manager.h \
$(platform_abstraction_src_dir)/render-controller.h \
$(platform_abstraction_src_dir)/platform-abstraction.h \
- $(platform_abstraction_src_dir)/shader-data.h \
$(platform_abstraction_src_dir)/system-overlay.h \
$(platform_abstraction_src_dir)/lockless-buffer.h
+++ /dev/null
-/*
- * Copyright (c) 2015 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/integration-api/shader-data.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-
-const size_t ShaderData::UNINITIALISED_HASH_VALUE = size_t(0) - 1;
-
-}
-}
-#ifndef __DALI_INTEGRATION_SHADER_DATA_H__
-#define __DALI_INTEGRATION_SHADER_DATA_H__
+#ifndef __DALI_INTERNAL_SHADER_DATA_H__
+#define __DALI_INTERNAL_SHADER_DATA_H__
/*
* Copyright (c) 2015 Samsung Electronics Co., Ltd.
// INTERNAL INCLUDES
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/common/dali-vector.h>
-#include <dali/integration-api/resource-declarations.h>
namespace Dali
{
-namespace Integration
+namespace Internal
{
class ShaderData;
-
typedef IntrusivePtr<ShaderData> ShaderDataPtr;
/**
{
public:
- static const size_t UNINITIALISED_HASH_VALUE;
-
/**
* Constructor
* @param[in] vertexSource Source code for vertex program
* @param[in] fragmentSource Source code for fragment program
*/
ShaderData(const std::string& vertexSource, const std::string& fragmentSource)
- : mShaderHash( UNINITIALISED_HASH_VALUE ),
+ : mShaderHash( -1 ),
mVertexShader(vertexSource),
mFragmentShader(fragmentSource)
{ }
*/
void SetHashValue(size_t shaderHash)
{
- DALI_ASSERT_DEBUG( shaderHash != 0 );
+ DALI_ASSERT_DEBUG( shaderHash != size_t(-1) );
mShaderHash = shaderHash;
}
*/
size_t GetHashValue() const
{
- DALI_ASSERT_DEBUG( mShaderHash != UNINITIALISED_HASH_VALUE );
+ DALI_ASSERT_DEBUG( mShaderHash != size_t(-1) );
return mShaderHash;
}
} // namespace Dali
-#endif // __DALI_INTEGRATION_SHADER_DATA_H__
+#endif // __DALI_INTERNAL_SHADER_DATA_H__
namespace Dali
{
-namespace Integration
+namespace Internal
{
class ShaderData;
typedef IntrusivePtr<ShaderData> ShaderDataPtr;
-}
-
-namespace Internal
-{
/**
* Abstract interface for passing a ShaderData object towards being saved.
* A function saving the binary from a ShaderDataPtr or passing it on to where it can be saved.
* @param[in] shaderData A smart pointer to a ShaderData for which the program binary should be saved.
*/
- virtual void SaveBinary( Integration::ShaderDataPtr shaderData ) = 0;
+ virtual void SaveBinary( Internal::ShaderDataPtr shaderData ) = 0;
protected:
/**
ShaderFactory& shaderFactory = tls.GetShaderFactory();
size_t shaderHash;
- Integration::ShaderDataPtr shaderData = shaderFactory.Load( vertexSource, fragmentSource, shaderHash );
+ Internal::ShaderDataPtr shaderData = shaderFactory.Load( vertexSource, fragmentSource, shaderHash );
DALI_ASSERT_DEBUG( shaderHash != 0U );
// Add shader program to scene-object using a message to the UpdateManager
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
#include <dali/integration-api/debug.h>
#include <dali/integration-api/platform-abstraction.h>
#include <dali/internal/event/common/thread-local-storage.h>
-#include <dali/internal/event/resources/resource-client.h>
#include <dali/internal/event/effects/shader-effect-impl.h>
#include <dali/internal/event/effects/shader-declarations.h>
const char* SHADER_SUFFIX = ".dali-bin";
}
-// Use pre-compiler constants in order to utilize string concatenation
-#define SHADER_DEF_USE_BONES "#define USE_BONES\n"
-#define SHADER_DEF_USE_COLOR "#define USE_COLOR\n"
-#define SHADER_DEF_USE_GRADIENT "#define USE_GRADIENT\n"
-
-using namespace Dali::Integration;
-
namespace Dali
{
return shaderData;
}
-void ShaderFactory::SaveBinary( Integration::ShaderDataPtr shaderData )
+void ShaderFactory::SaveBinary( Internal::ShaderDataPtr shaderData )
{
// Save the binary to the file system:
std::string binaryShaderFilename;
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
-#include <dali/internal/event/resources/resource-ticket.h>
#include <dali/internal/event/effects/shader-declarations.h>
#include <dali/internal/common/message.h>
#include <dali/internal/common/shader-saver.h>
namespace Dali
{
-namespace Integration
-{
-
-class ShaderData;
-typedef IntrusivePtr<ShaderData> ShaderDataPtr;
-
-}
namespace Internal
{
-class ResourceClient;
-class MessageController;
+class ShaderData;
+typedef IntrusivePtr<ShaderData> ShaderDataPtr;
/**
* ShaderFactory is an object which manages shader binary resource load requests,
* a compiled shader program binary if one could be found, else an
* empty binary buffer cleared to size zero.
*/
- Integration::ShaderDataPtr Load( const std::string& vertexSource, const std::string& fragmentSource, size_t& shaderHash );
+ Internal::ShaderDataPtr Load( const std::string& vertexSource, const std::string& fragmentSource, size_t& shaderHash );
/**
* @brief Saves shader to memory cache and filesystem.
* @param[in] shader The data to be saved.
* @sa Load
*/
- virtual void SaveBinary( Integration::ShaderDataPtr shader );
+ virtual void SaveBinary( Internal::ShaderDataPtr shader );
/**
* Called during Core initialization to load the default shader.
private:
- void MemoryCacheInsert( Integration::ShaderData& shaderData );
+ void MemoryCacheInsert( Internal::ShaderData& shaderData );
// Undefined
ShaderFactory( const ShaderFactory& );
private:
ShaderEffectPtr mDefaultShader;
- Dali::Vector< Integration::ShaderData* > mShaderBinaryCache; ///< Cache of pre-compiled shaders.
+ Dali::Vector< Internal::ShaderData* > mShaderBinaryCache; ///< Cache of pre-compiled shaders.
}; // class ShaderFactory
-inline MessageBase* ShaderCompiledMessage( ShaderSaver& factory, Integration::ShaderDataPtr shaderData )
+inline MessageBase* ShaderCompiledMessage( ShaderSaver& factory, Internal::ShaderDataPtr shaderData )
{
- return new MessageValue1< ShaderSaver, Integration::ShaderDataPtr >( &factory,
+ return new MessageValue1< ShaderSaver, Internal::ShaderDataPtr >( &factory,
&ShaderSaver::SaveBinary,
shaderData );
}
ThreadLocalStorage& tls = ThreadLocalStorage::Get();
ShaderFactory& shaderFactory = tls.GetShaderFactory();
size_t shaderHash;
- Integration::ShaderDataPtr shaderData = shaderFactory.Load( vertexSource, fragmentSource, shaderHash );
+ Internal::ShaderDataPtr shaderData = shaderFactory.Load( vertexSource, fragmentSource, shaderHash );
// Add shader program to scene-object using a message to the UpdateManager
SetShaderProgramMessage( updateManager, *mSceneObject, shaderData, (hints & Dali::Shader::HINT_MODIFIES_GEOMETRY) != 0x0 );
*/
#include "scene-graph-renderer-debug.h"
-#include <dali/integration-api/shader-data.h>
+#include <dali/internal/common/shader-data.h>
#include <dali/integration-api/resource-declarations.h>
#include <dali/internal/render/shaders/program.h>
#include <dali/internal/render/gl-resources/context.h>
#if defined ( DEBUG_ENABLED )
if( gDebugProgram == NULL )
{
- Integration::ShaderDataPtr shaderData( new Integration::ShaderData( DEBUG_DRAW_VERTEX_SHADER, DEBUG_DRAW_FRAGMENT_SHADER ) );
+ Internal::ShaderDataPtr shaderData( new Internal::ShaderData( DEBUG_DRAW_VERTEX_SHADER, DEBUG_DRAW_FRAGMENT_SHADER ) );
gDebugProgram = Program::New( shaderData.Get(), context, true );
}
/**
* @param programData to store/save
*/
- virtual void StoreBinary( Integration::ShaderDataPtr programData ) = 0;
+ virtual void StoreBinary( Internal::ShaderDataPtr programData ) = 0;
private: // not implemented as non-copyable
return mProgramBinaryFormat;
}
-void ProgramController::StoreBinary( Integration::ShaderDataPtr programData )
+void ProgramController::StoreBinary( Internal::ShaderDataPtr programData )
{
DALI_ASSERT_DEBUG( programData->GetBufferSize() > 0 );
- DALI_ASSERT_DEBUG( programData->GetHashValue() != 0 );
DALI_ASSERT_DEBUG( mShaderSaver && "SetShaderSaver() should have been called during startup." );
if( mShaderSaver != NULL )
/**
* @copydoc ProgramCache::StoreBinary
*/
- virtual void StoreBinary( Integration::ShaderDataPtr programData );
+ virtual void StoreBinary( Internal::ShaderDataPtr programData );
private: // not implemented as non-copyable
#include <dali/public-api/common/dali-vector.h>
#include <dali/public-api/common/constants.h>
#include <dali/integration-api/debug.h>
-#include <dali/integration-api/shader-data.h>
+#include <dali/internal/common/shader-data.h>
#include <dali/integration-api/gl-defines.h>
#include <dali/internal/render/common/performance-monitor.h>
#include <dali/internal/render/shaders/program-cache.h>
// IMPLEMENTATION
-Program* Program::New( ProgramCache& cache, Integration::ShaderDataPtr shaderData, bool modifiesGeometry )
+Program* Program::New( ProgramCache& cache, Internal::ShaderDataPtr shaderData, bool modifiesGeometry )
{
size_t shaderHash = shaderData->GetHashValue();
Program* program = cache.GetProgram( shaderHash );
return mModifiesGeometry;
}
-Program::Program( ProgramCache& cache, Integration::ShaderDataPtr shaderData, bool modifiesGeometry )
+Program::Program( ProgramCache& cache, Internal::ShaderDataPtr shaderData, bool modifiesGeometry )
: mCache( cache ),
mGlAbstraction( mCache.GetGlAbstraction() ),
mProjectionMatrix( NULL ),
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/object/ref-object.h>
#include <dali/integration-api/gl-abstraction.h>
-#include <dali/integration-api/shader-data.h>
+#include <dali/internal/common/shader-data.h>
namespace Dali
{
* @param[in] modifiesGeometry True if the shader modifies geometry
* @return pointer to the program
*/
- static Program* New( ProgramCache& cache, Integration::ShaderDataPtr shaderData, bool modifiesGeometry );
+ static Program* New( ProgramCache& cache, Internal::ShaderDataPtr shaderData, bool modifiesGeometry );
/**
* Takes this program into use
* @param[in] shaderData A smart pointer to a data structure containing the program source and binary
* @param[in] modifiesGeometry True if the vertex shader changes geometry
*/
- Program( ProgramCache& cache, Integration::ShaderDataPtr shaderData, bool modifiesGeometry );
+ Program( ProgramCache& cache, Internal::ShaderDataPtr shaderData, bool modifiesGeometry );
public:
GLuint mVertexShaderId; ///< GL identifier for vertex shader
GLuint mFragmentShaderId; ///< GL identifier for fragment shader
GLuint mProgramId; ///< GL identifier for program
- Integration::ShaderDataPtr mProgramData; ///< Shader program source and binary (when compiled & linked or loaded)
+ Internal::ShaderDataPtr mProgramData; ///< Shader program source and binary (when compiled & linked or loaded)
// location caches
std::vector< std::pair< std::string, GLint > > mAttributeLocations; ///< attribute location cache
mUniformMetadata[ index ]->SetCoordinateType( type );
}
-void Shader::SetProgram( Integration::ShaderDataPtr shaderData,
+void Shader::SetProgram( Internal::ShaderDataPtr shaderData,
ProgramCache* programCache,
bool modifiesGeometry )
{
#include <dali/public-api/common/dali-vector.h>
#include <dali/public-api/shader-effects/shader-effect.h>
-#include <dali/integration-api/shader-data.h>
+#include <dali/internal/common/shader-data.h>
#include <dali/internal/common/buffer-index.h>
#include <dali/internal/common/type-abstraction-enums.h>
* @param[in] modifiesGeometry True if the vertex shader changes the positions of vertexes such that
* they might exceed the bounding box of vertexes passing through the default transformation.
*/
- void SetProgram( Integration::ShaderDataPtr shaderData,
+ void SetProgram( Internal::ShaderDataPtr shaderData,
ProgramCache* programCache,
bool modifiesGeometry );
#include <dali/integration-api/core.h>
#include <dali/integration-api/render-controller.h>
-#include <dali/integration-api/shader-data.h>
+#include <dali/internal/common/shader-data.h>
#include <dali/integration-api/debug.h>
#include <dali/internal/common/core-impl.h>
typedef ShaderContainer::Iterator ShaderIter;
typedef ShaderContainer::ConstIterator ShaderConstIter;
-typedef std::vector<Integration::ShaderDataPtr> ShaderDataBatchedQueue;
+typedef std::vector<Internal::ShaderDataPtr> ShaderDataBatchedQueue;
typedef ShaderDataBatchedQueue::iterator ShaderDataBatchedQueueIterator;
typedef OwnerContainer<PanGesture*> GestureContainer;
}
void UpdateManager::SetShaderProgram( Shader* shader,
- Integration::ShaderDataPtr shaderData, bool modifiesGeometry )
+ Internal::ShaderDataPtr shaderData, bool modifiesGeometry )
{
if( shaderData )
{
- typedef MessageValue3< Shader, Integration::ShaderDataPtr, ProgramCache*, bool> DerivedType;
+ typedef MessageValue3< Shader, Internal::ShaderDataPtr, ProgramCache*, bool> DerivedType;
// Reserve some memory inside the render queue
unsigned int* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
}
}
-void UpdateManager::SaveBinary( Integration::ShaderDataPtr shaderData )
+void UpdateManager::SaveBinary( Internal::ShaderDataPtr shaderData )
{
DALI_ASSERT_DEBUG( shaderData && "No NULL shader data pointers please." );
DALI_ASSERT_DEBUG( shaderData->GetBufferSize() > 0 && "Shader binary empty so nothing to save." );
* @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
* @param[in] modifiesGeometry True if the vertex shader modifies geometry
*/
- void SetShaderProgram( Shader* shader, Integration::ShaderDataPtr shaderData, bool modifiesGeometry );
+ void SetShaderProgram( Shader* shader, Internal::ShaderDataPtr shaderData, bool modifiesGeometry );
/**
* @brief Accept compiled shaders passed back on render thread for saving.
* @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
*/
- virtual void SaveBinary( Integration::ShaderDataPtr shaderData );
+ virtual void SaveBinary( Internal::ShaderDataPtr shaderData );
/**
* @brief Set the destination for compiled shader binaries to be passed on to.
inline void SetShaderProgramMessage( UpdateManager& manager,
Shader& shader,
- Integration::ShaderDataPtr shaderData,
+ Internal::ShaderDataPtr shaderData,
bool modifiesGeometry )
{
- typedef MessageValue3< UpdateManager, Shader*, Integration::ShaderDataPtr, bool > LocalType;
+ typedef MessageValue3< UpdateManager, Shader*, Internal::ShaderDataPtr, bool > LocalType;
// Reserve some memory inside the message queue
unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );