From 09b2e203899685d1b6ff25c37a771747f6f0f3d4 Mon Sep 17 00:00:00 2001 From: Andrew Cox Date: Wed, 3 Jun 2015 13:35:32 +0100 Subject: [PATCH] Removed GeometryType from ShaderEffect and ShaderSubType Needs this in toolkit: https://review.tizen.org/gerrit/#/c/40841/ Change-Id: I24417fce49eedf63e6eceebd31acc887fe23b980 Signed-off-by: Andrew Cox --- automated-tests/src/dali/utc-Dali-ImageActor.cpp | 2 +- automated-tests/src/dali/utc-Dali-ShaderEffect.cpp | 20 +--- dali/internal/common/type-abstraction-enums.h | 2 - dali/internal/event/effects/shader-declarations.h | 11 -- dali/internal/event/effects/shader-effect-impl.cpp | 117 ++++-------------- dali/internal/event/effects/shader-effect-impl.h | 12 +- dali/internal/event/effects/shader-factory.cpp | 2 +- dali/internal/event/effects/shader-impl.cpp | 2 +- dali/internal/render/renderers/render-renderer.cpp | 9 +- dali/internal/render/renderers/render-renderer.h | 9 +- .../renderers/scene-graph-image-renderer.cpp | 6 - .../render/renderers/scene-graph-image-renderer.h | 5 - .../render/renderers/scene-graph-renderer.cpp | 24 ++-- .../render/renderers/scene-graph-renderer.h | 13 +- .../render/shader-source/textured-mesh.txt | 117 ------------------ .../render/shader-source/untextured-mesh.txt | 131 --------------------- .../internal/render/shaders/scene-graph-shader.cpp | 60 +--------- dali/internal/render/shaders/scene-graph-shader.h | 38 +----- dali/internal/render/shaders/uniform-meta.h | 7 +- dali/internal/update/manager/update-manager.cpp | 9 +- dali/internal/update/manager/update-manager.h | 10 +- dali/public-api/shader-effects/shader-effect.cpp | 7 +- dali/public-api/shader-effects/shader-effect.h | 20 +--- 23 files changed, 80 insertions(+), 553 deletions(-) delete mode 100644 dali/internal/render/shader-source/textured-mesh.txt delete mode 100644 dali/internal/render/shader-source/untextured-mesh.txt diff --git a/automated-tests/src/dali/utc-Dali-ImageActor.cpp b/automated-tests/src/dali/utc-Dali-ImageActor.cpp index 4179adc..2b66608 100644 --- a/automated-tests/src/dali/utc-Dali-ImageActor.cpp +++ b/automated-tests/src/dali/utc-Dali-ImageActor.cpp @@ -194,7 +194,7 @@ int UtcDaliImageActorSetSize01(void) BufferImage img = BufferImage::New( 1,1 ); ImageActor actor = ImageActor::New( img ); - ShaderEffect effect = ShaderEffect::New( " ", " ", GEOMETRY_TYPE_IMAGE, ShaderEffect::HINT_GRID ); + ShaderEffect effect = ShaderEffect::New( " ", " ", ShaderEffect::HINT_GRID ); actor.SetShaderEffect( effect ); const float INVALID_SIZE = float(1u<<31); diff --git a/automated-tests/src/dali/utc-Dali-ShaderEffect.cpp b/automated-tests/src/dali/utc-Dali-ShaderEffect.cpp index 4ce9dd6..7fc9b8e 100644 --- a/automated-tests/src/dali/utc-Dali-ShaderEffect.cpp +++ b/automated-tests/src/dali/utc-Dali-ShaderEffect.cpp @@ -801,8 +801,6 @@ int UtcDaliShaderEffectFromProperties01(void) programMap.SetValue("vertex-prefix", vertexShaderPrefix); programMap.SetValue("fragment-prefix", fragmentShaderPrefix); - programMap.SetValue("geometry-type", "GEOMETRY_TYPE_IMAGE"); - effect.SetProperty(effect.GetPropertyIndex("program"), programMap); Property::Value imageMap = Property::Value(Property::MAP); @@ -847,10 +845,8 @@ int UtcDaliShaderEffectFromProperties01(void) int UtcDaliShaderEffectFromProperties02(void) { - try - { - TestApplication application; - tet_infoline("UtcDaliShaderEffectFromProperties02()"); + TestApplication application; + tet_infoline("UtcDaliShaderEffectFromProperties02()"); // Call render to compile default shaders. application.SendNotification(); @@ -869,18 +865,8 @@ int UtcDaliShaderEffectFromProperties02(void) programMap.SetValue("vertex", std::string(VertexSource)); programMap.SetValue("fragment", std::string(FragmentSource)); - // programMap.SetValue("geometry-type", "GEOMETRY_TYPE_IMAGE"); - // dont set by value - programMap.SetValue("geometry-type", GeometryType( GEOMETRY_TYPE_IMAGE )); - - effect.SetProperty(effect.GetPropertyIndex("program"), programMap); + effect.SetProperty(effect.GetPropertyIndex("program"), programMap); - tet_result( TET_FAIL ); - } - catch(Dali::DaliException& e) - { - DALI_TEST_PRINT_ASSERT( e ); - } END_TEST; } diff --git a/dali/internal/common/type-abstraction-enums.h b/dali/internal/common/type-abstraction-enums.h index e3e1afd..0aa1ed3 100644 --- a/dali/internal/common/type-abstraction-enums.h +++ b/dali/internal/common/type-abstraction-enums.h @@ -36,8 +36,6 @@ namespace Internal template <> struct ParameterType< CullFaceMode > : public BasicType< CullFaceMode > {}; template <> struct ParameterType< BlendingMode::Type > : public BasicType< BlendingMode::Type > {}; -template <> struct ParameterType< GeometryType > : public BasicType< GeometryType > {}; -template <> struct ParameterType< ShaderSubTypes > : public BasicType< ShaderSubTypes > {}; } //namespace Internal diff --git a/dali/internal/event/effects/shader-declarations.h b/dali/internal/event/effects/shader-declarations.h index 9806f37..0203922 100644 --- a/dali/internal/event/effects/shader-declarations.h +++ b/dali/internal/event/effects/shader-declarations.h @@ -27,17 +27,6 @@ namespace Dali namespace Internal { -/** - * Shader sub types. - */ -enum ShaderSubTypes -{ - SHADER_DEFAULT = 0, ///< Use default shader for geometry type - SHADER_SUBTYPE_LAST, - - SHADER_SUBTYPE_ALL = 0xFF, -}; - class ShaderEffect; typedef IntrusivePtr ShaderEffectPtr; diff --git a/dali/internal/event/effects/shader-effect-impl.cpp b/dali/internal/event/effects/shader-effect-impl.cpp index e8ca9be..b3b99ab 100644 --- a/dali/internal/event/effects/shader-effect-impl.cpp +++ b/dali/internal/event/effects/shader-effect-impl.cpp @@ -82,27 +82,15 @@ struct WrapperStrings const char* fragmentShaderPostfix; }; -WrapperStrings customShaderWrappers [] = +WrapperStrings customImageShaderWrappers = { - { - CustomImagePrefixVertex, CustomImagePrefixFragment, - CustomImagePostfixVertex, CustomImagePostfixFragment - }, - { - CustomUntexturedMeshPrefixVertex, CustomUntexturedMeshPrefixFragment, - CustomUntexturedMeshPostfixVertex, CustomUntexturedMeshPostfixFragment - }, - { - CustomTexturedMeshPrefixVertex, CustomTexturedMeshPrefixFragment, - CustomTexturedMeshPostfixVertex, CustomTexturedMeshPostfixFragment - } + CustomImagePrefixVertex, CustomImagePrefixFragment, + CustomImagePostfixVertex, CustomImagePostfixFragment }; /** * Helper to wrap the program with our default pre and postfix if needed and then send it to update/render thread * @param[in] effect of the shader - * @param[in] actualGeometryType of the shader - * @param[in] expectedGeometryType of the shader * @param[in] vertexPrefix from application * @param[in] fragmentPrefix from application * @param[in] vertexBody from application @@ -110,48 +98,23 @@ WrapperStrings customShaderWrappers [] = * @param[in] modifiesGeometry based on flags and vertex shader */ void WrapAndSetProgram( Internal::ShaderEffect& effect, - GeometryType actualGeometryType, GeometryType expectedGeometryType, const std::string& vertexPrefix, const std::string& fragmentPrefix, const std::string& vertexBody, const std::string& fragmentBody, bool modifiesGeometry ) { - // if geometry type matches and there is some real data in the strings - if( ( actualGeometryType & expectedGeometryType )&& - ( ( vertexPrefix.length() > 0 )|| - ( fragmentPrefix.length() > 0 )|| - ( vertexBody.length() > 0 )|| - ( fragmentBody.length() > 0 ) ) ) + // if there is some real data in the strings + if( ( vertexPrefix.length() > 0 ) || + ( fragmentPrefix.length() > 0 ) || + ( vertexBody.length() > 0 ) || + ( fragmentBody.length() > 0 ) ) { std::string vertexSource = vertexPrefix; std::string fragmentSource = fragmentPrefix; - // create complete shader program strings for the given geometry type - unsigned int index = 0; - switch( expectedGeometryType ) - { - case GEOMETRY_TYPE_IMAGE: - { - index = 0; - break; - } - case GEOMETRY_TYPE_UNTEXTURED_MESH: - { - index = 1; - break; - } - case GEOMETRY_TYPE_TEXTURED_MESH: - { - index = 2; - break; - } - case GEOMETRY_TYPE_LAST: - { - DALI_ASSERT_DEBUG(0 && "Wrong geometry type"); - break; - } - } + // Create complete shader program strings: + + vertexSource += customImageShaderWrappers.vertexShaderPrefix; - vertexSource += customShaderWrappers[index].vertexShaderPrefix; // Append the custom vertex shader code if supplied, otherwise append the default if ( vertexBody.length() > 0 ) { @@ -159,10 +122,11 @@ void WrapAndSetProgram( Internal::ShaderEffect& effect, } else { - vertexSource.append( customShaderWrappers[index].vertexShaderPostfix ); + vertexSource.append( customImageShaderWrappers.vertexShaderPostfix ); } - fragmentSource += customShaderWrappers[index].fragmentShaderPrefix; + fragmentSource += customImageShaderWrappers.fragmentShaderPrefix; + // Append the custom fragment shader code if supplied, otherwise append the default if ( fragmentBody.length() > 0 ) { @@ -170,10 +134,10 @@ void WrapAndSetProgram( Internal::ShaderEffect& effect, } else { - fragmentSource.append( customShaderWrappers[index].fragmentShaderPostfix ); + fragmentSource.append( customImageShaderWrappers.fragmentShaderPostfix ); } - effect.SendProgramMessage( expectedGeometryType, vertexSource, fragmentSource, modifiesGeometry ); + effect.SendProgramMessage( vertexSource, fragmentSource, modifiesGeometry ); } } @@ -290,34 +254,30 @@ void ShaderEffect::SetUniform( const std::string& name, Property::Value value, U } } -void ShaderEffect::SetPrograms( GeometryType geometryType, const string& vertexSource, const string& fragmentSource ) +void ShaderEffect::SetPrograms( const string& vertexSource, const string& fragmentSource ) { - SetPrograms( geometryType, "", "", vertexSource, fragmentSource ); + SetPrograms( "", "", vertexSource, fragmentSource ); } -void ShaderEffect::SetPrograms( GeometryType geometryType, - const std::string& vertexPrefix, const std::string& fragmentPrefix, +void ShaderEffect::SetPrograms( const std::string& vertexPrefix, const std::string& fragmentPrefix, const std::string& vertexSource, const std::string& fragmentSource ) { bool modifiesGeometry = true; // check if the vertex shader is empty (means it cannot modify geometry) - if( (vertexPrefix.length() == 0 )&&( vertexSource.length() == 0 ) ) + if( (vertexPrefix.length() == 0) && (vertexSource.length() == 0) ) { modifiesGeometry = false; } // check the hint second - if( (mGeometryHints & Dali::ShaderEffect::HINT_DOESNT_MODIFY_GEOMETRY ) != 0 ) + if( ( mGeometryHints & Dali::ShaderEffect::HINT_DOESNT_MODIFY_GEOMETRY ) != 0 ) { modifiesGeometry = false; } - WrapAndSetProgram( *this, geometryType, GEOMETRY_TYPE_IMAGE, vertexPrefix, fragmentPrefix, vertexSource, fragmentSource, modifiesGeometry ); - WrapAndSetProgram( *this, geometryType, GEOMETRY_TYPE_TEXTURED_MESH, vertexPrefix, fragmentPrefix, vertexSource, fragmentSource, modifiesGeometry ); - WrapAndSetProgram( *this, geometryType, GEOMETRY_TYPE_UNTEXTURED_MESH, vertexPrefix, fragmentPrefix, vertexSource, fragmentSource, modifiesGeometry ); + WrapAndSetProgram( *this, vertexPrefix, fragmentPrefix, vertexSource, fragmentSource, modifiesGeometry ); } -void ShaderEffect::SendProgramMessage( GeometryType geometryType, - const string& vertexSource, const string& fragmentSource, +void ShaderEffect::SendProgramMessage( const string& vertexSource, const string& fragmentSource, bool modifiesGeometry ) { ThreadLocalStorage& tls = ThreadLocalStorage::Get(); @@ -326,10 +286,10 @@ void ShaderEffect::SendProgramMessage( GeometryType geometryType, ResourceTicketPtr ticket( shaderFactory.Load(vertexSource, fragmentSource, shaderHash) ); - DALI_LOG_INFO( Debug::Filter::gShader, Debug::General, "ShaderEffect: SetProgram(geometryType %d ticket.id:%d)\n", geometryType, ticket->GetId() ); + DALI_LOG_INFO( Debug::Filter::gShader, Debug::General, "ShaderEffect: SetProgram(ticket.id:%d)\n", ticket->GetId() ); // Add shader program to scene-object using a message to the UpdateManager - SetShaderProgramMessage( mEventThreadServices.GetUpdateManager(), *mSceneObject, geometryType, ticket->GetId(), shaderHash, modifiesGeometry ); + SetShaderProgramMessage( mEventThreadServices.GetUpdateManager(), *mSceneObject, ticket->GetId(), shaderHash, modifiesGeometry ); mTickets.push_back(ticket); // add ticket to collection to keep it alive. } @@ -458,32 +418,7 @@ void ShaderEffect::SetDefaultProperty( Property::Index index, const Property::Va std::string vertex = GetShader("vertex", propertyValue); std::string fragment = GetShader("fragment", propertyValue); - GeometryType geometryType = GEOMETRY_TYPE_IMAGE; - - if( propertyValue.HasKey("geometry-type") ) - { - Property::Value geometryValue = propertyValue.GetValue("geometry-type"); - DALI_ASSERT_ALWAYS(geometryValue.GetType() == Property::STRING && "Geometry type is not a string" ); - - std::string s = geometryValue.Get(); - if(s == "GEOMETRY_TYPE_IMAGE") - { - geometryType = GEOMETRY_TYPE_IMAGE; - } - else if( s == "GEOMETRY_TYPE_UNTEXTURED_MESH") - { - geometryType = GEOMETRY_TYPE_UNTEXTURED_MESH; - } - else if( s == "GEOMETRY_TYPE_TEXTURED_MESH") - { - geometryType = GEOMETRY_TYPE_TEXTURED_MESH; - } - else - { - DALI_ASSERT_ALWAYS(!"Geometry type unknown" ); - } - } - SetPrograms( geometryType, vertexPrefix, fragmentPrefix, vertex, fragment ); + SetPrograms( vertexPrefix, fragmentPrefix, vertex, fragment ); break; } diff --git a/dali/internal/event/effects/shader-effect-impl.h b/dali/internal/event/effects/shader-effect-impl.h index b5fbf39..9f80091 100644 --- a/dali/internal/event/effects/shader-effect-impl.h +++ b/dali/internal/event/effects/shader-effect-impl.h @@ -78,31 +78,27 @@ public: * @param[in] vertexSource The source code for the vertex shader * @param[in] fragmentSource The source code for the fragment shader */ - void SetPrograms( GeometryType geometryType, const std::string& vertexSource, const std::string& fragmentSource ); + void SetPrograms( const std::string& vertexSource, const std::string& fragmentSource ); /** - * Add a GeometryType specific default program to this ShaderEffect. + * Add a default program to this ShaderEffect. * This overload allows the optional prefixing for both the vertex and fragment shader. * A useful prefix may be shader \#defines for conditional compilation. - * @param[in] geometryType The GeometryType rendered by the shader program * @param[in] vertexPrefix The prefix source code for the vertex shader * @param[in] fragmentPrefix The prefix source code for the fragment shader * @param[in] vertexSource The source code for the vertex shader * @param[in] fragmentSource The source code for the fragment shader */ - void SetPrograms( GeometryType geometryType, - const std::string& vertexPrefix, const std::string& fragmentPrefix, + void SetPrograms( const std::string& vertexPrefix, const std::string& fragmentPrefix, const std::string& vertexSource, const std::string& fragmentSource ); /** * Send shader program to scene-graph object. - * @param[in] geometryType The GeometryType rendered by the shader program * @param[in] vertexSource The source code for the vertex shader * @param[in] fragmentSource The source code for the fragment shader * @param[in] modifiesGeometry True if the shader modifies geometry */ - void SendProgramMessage( GeometryType geometryType, - const std::string& vertexSource, const std::string& fragmentSource, + void SendProgramMessage( const std::string& vertexSource, const std::string& fragmentSource, bool modifiesGeometry ); /** diff --git a/dali/internal/event/effects/shader-factory.cpp b/dali/internal/event/effects/shader-factory.cpp index a3b819c..f276ef6 100644 --- a/dali/internal/event/effects/shader-factory.cpp +++ b/dali/internal/event/effects/shader-factory.cpp @@ -118,7 +118,7 @@ void ShaderFactory::LoadDefaultShaders() { mDefaultShader = ShaderEffect::New(); - mDefaultShader->SendProgramMessage( GEOMETRY_TYPE_IMAGE, ImageVertex, ImageFragment, false ); + mDefaultShader->SendProgramMessage( ImageVertex, ImageFragment, false ); } } // namespace Internal diff --git a/dali/internal/event/effects/shader-impl.cpp b/dali/internal/event/effects/shader-impl.cpp index 73817c9..c7be729 100644 --- a/dali/internal/event/effects/shader-impl.cpp +++ b/dali/internal/event/effects/shader-impl.cpp @@ -278,7 +278,7 @@ void Shader::Initialize( mTicket = ResourceTicketPtr( shaderFactory.Load(vertexSource, fragmentSource, shaderHash) ); // Add shader program to scene-object using a message to the UpdateManager - SetShaderProgramMessage( updateManager, *mSceneObject, GEOMETRY_TYPE_IMAGE, mTicket->GetId(), shaderHash, false ); + SetShaderProgramMessage( updateManager, *mSceneObject, mTicket->GetId(), shaderHash, false ); } Shader::~Shader() diff --git a/dali/internal/render/renderers/render-renderer.cpp b/dali/internal/render/renderers/render-renderer.cpp index 7b7f2cd..5477ec2 100644 --- a/dali/internal/render/renderers/render-renderer.cpp +++ b/dali/internal/render/renderers/render-renderer.cpp @@ -78,20 +78,13 @@ bool NewRenderer::CheckResources() return true; } -void NewRenderer::ResolveGeometryTypes( BufferIndex bufferIndex, GeometryType& outType, ShaderSubTypes& outSubType ) -{ - // @todo MESH_REWORK Remove after merge - - // Do nothing -} - bool NewRenderer::IsOutsideClipSpace( Context& context, const Matrix& modelMatrix, const Matrix& modelViewProjectionMatrix ) { // @todo MESH_REWORK Add clipping return false; } -void NewRenderer::DoSetUniforms( Context& context, BufferIndex bufferIndex, Shader* shader, Program* program, unsigned int programIndex, ShaderSubTypes subType ) +void NewRenderer::DoSetUniforms( Context& context, BufferIndex bufferIndex, Shader* shader, Program* program, unsigned int programIndex ) { // Do nothing, we're going to set up the uniforms with our own code instead } diff --git a/dali/internal/render/renderers/render-renderer.h b/dali/internal/render/renderers/render-renderer.h index b01d4b1..997dba4 100644 --- a/dali/internal/render/renderers/render-renderer.h +++ b/dali/internal/render/renderers/render-renderer.h @@ -83,13 +83,6 @@ public: // Implementation of Renderer virtual bool CheckResources(); /** - * @copydoc SceneGraph::Renderer::ResolveGeometryTypes() - */ - virtual void ResolveGeometryTypes( BufferIndex bufferIndex, - GeometryType& outType, - ShaderSubTypes& outSubType ); - - /** * @copydoc SceneGraph::Renderer::IsOutsideClipSpace() */ virtual bool IsOutsideClipSpace( Context& context, @@ -99,7 +92,7 @@ public: // Implementation of Renderer /** * @copydoc SceneGraph::Renderer::DoSetUniforms() */ - virtual void DoSetUniforms( Context& context, BufferIndex bufferIndex, Shader* shader, Program* program, unsigned int programIndex, ShaderSubTypes subType ); + virtual void DoSetUniforms( Context& context, BufferIndex bufferIndex, Shader* shader, Program* program, unsigned int programIndex ); /** * @copydoc SceneGraph::Renderer::DoSetCullFaceMode diff --git a/dali/internal/render/renderers/scene-graph-image-renderer.cpp b/dali/internal/render/renderers/scene-graph-image-renderer.cpp index c7c4f8d..b4f8390 100644 --- a/dali/internal/render/renderers/scene-graph-image-renderer.cpp +++ b/dali/internal/render/renderers/scene-graph-image-renderer.cpp @@ -230,12 +230,6 @@ bool ImageRenderer::CheckResources() return true; } -void ImageRenderer::ResolveGeometryTypes( BufferIndex bufferIndex, GeometryType& outType, ShaderSubTypes& outSubType ) -{ - outType = GEOMETRY_TYPE_IMAGE; - outSubType = SHADER_DEFAULT; -} - bool ImageRenderer::IsOutsideClipSpace( Context& context, const Matrix& modelMatrix, const Matrix& modelViewProjectionMatrix ) { context.IncrementRendererCount(); diff --git a/dali/internal/render/renderers/scene-graph-image-renderer.h b/dali/internal/render/renderers/scene-graph-image-renderer.h index 3d9e27a..226501b 100644 --- a/dali/internal/render/renderers/scene-graph-image-renderer.h +++ b/dali/internal/render/renderers/scene-graph-image-renderer.h @@ -116,11 +116,6 @@ public: virtual bool CheckResources(); /** - * @copydoc Dali::Internal::SceneGraph::Renderer::ResolveGeometryTypes() - */ - virtual void ResolveGeometryTypes( BufferIndex bufferIndex, GeometryType& outType, ShaderSubTypes& outSubType ); - - /** * @copydoc Dali::Internal::SceneGraph::Renderer::IsOutsideClipSpace() */ virtual bool IsOutsideClipSpace( Context& context, const Matrix& modelMatrix, const Matrix& modelViewProjectionMatrix ); diff --git a/dali/internal/render/renderers/scene-graph-renderer.cpp b/dali/internal/render/renderers/scene-graph-renderer.cpp index 9bc1dc2..e612695 100644 --- a/dali/internal/render/renderers/scene-graph-renderer.cpp +++ b/dali/internal/render/renderers/scene-graph-renderer.cpp @@ -184,17 +184,19 @@ void Renderer::Render( Context& context, const Matrix& modelMatrix = mDataProvider.GetModelMatrix( bufferIndex ); Matrix::Multiply( gModelViewProjectionMatrix, modelViewMatrix, projectionMatrix ); - // Get the program to use - GeometryType geometryType=GEOMETRY_TYPE_IMAGE; - ShaderSubTypes subType=SHADER_DEFAULT; - ResolveGeometryTypes( bufferIndex, geometryType, subType ); - unsigned int programIndex = 0; - Program* program = mShader->GetProgram( context, geometryType, subType, programIndex ); + // Get the program to use: + Program* program = mShader->GetProgram(); if( !program ) { // if program is NULL it means this is a custom shader with non matching geometry type so we need to use default shaders program - program = defaultShader.GetProgram( context, geometryType, subType, programIndex ); - DALI_ASSERT_ALWAYS( program && "Default shader is missing a geometry type!!" ); + program = defaultShader.GetProgram(); + DALI_ASSERT_DEBUG( program && "Default shader should always have a program available." ); + if( !program ) + { + DALI_LOG_ERROR( "Failed to get program for shader at address %p.", (void*) &*mShader ); + return; + } + } // Check culling (does not need the program to be in use) @@ -232,16 +234,16 @@ void Renderer::Render( Context& context, } //@todo MESH_REWORK Remove after removing ImageRenderer - DoSetUniforms(context, bufferIndex, mShader, program, programIndex, subType ); + DoSetUniforms(context, bufferIndex, mShader, program ); // subclass rendering and actual draw call DoRender( context, textureCache, bufferIndex, *program, modelViewMatrix, viewMatrix ); } // can be overridden by deriving class -void Renderer::DoSetUniforms(Context& context, BufferIndex bufferIndex, Shader* shader, Program* program, unsigned int programIndex, ShaderSubTypes subType ) +void Renderer::DoSetUniforms(Context& context, BufferIndex bufferIndex, Shader* shader, Program* program ) { - shader->SetUniforms( context, *program, bufferIndex, programIndex, subType ); + shader->SetUniforms( context, *program, bufferIndex ); } // can be overridden by deriving class diff --git a/dali/internal/render/renderers/scene-graph-renderer.h b/dali/internal/render/renderers/scene-graph-renderer.h index d66e525..c5ebb7c 100644 --- a/dali/internal/render/renderers/scene-graph-renderer.h +++ b/dali/internal/render/renderers/scene-graph-renderer.h @@ -153,17 +153,6 @@ private: virtual bool CheckResources() = 0; /** - * @deprecated - Not needed in final MESH_REWORK - * @todo MESH_REWORK Remove this API - * - * Resolve the derived renderers geometry type and subtype - * @param[in] bufferIndex The index of the previous update buffer. - * @param[out] outType The geometry type - * @param[out] outSubType The geometry subtype - */ - virtual void ResolveGeometryTypes( BufferIndex bufferIndex, GeometryType& outType, ShaderSubTypes& outSubType ) = 0; - - /** * Checks if renderer is culled. * @param[in] modelMatrix The model matrix. * @param[in] modelViewProjectionMatrix The MVP matrix. @@ -175,7 +164,7 @@ private: * Called from Render prior to DoRender(). * @todo MESH_REWORK Remove after merge */ - virtual void DoSetUniforms( Context& context, BufferIndex bufferIndex, Shader* shader, Program* program, unsigned int programIndex, ShaderSubTypes subType ); + virtual void DoSetUniforms( Context& context, BufferIndex bufferIndex, Shader* shader, Program* program ); /** * Called from Render prior to DoRender(). Default method to set CullFaceMode diff --git a/dali/internal/render/shader-source/textured-mesh.txt b/dali/internal/render/shader-source/textured-mesh.txt deleted file mode 100644 index 5051e39..0000000 --- a/dali/internal/render/shader-source/textured-mesh.txt +++ /dev/null @@ -1,117 +0,0 @@ - - -uniform mediump mat4 uProjection; -uniform mediump mat4 uModelView; -uniform mediump mat4 uMvpMatrix; - -uniform bool uTextureMapped; -uniform mediump vec4 uCustomTextureCoords; -attribute highp vec2 aTexCoord; -varying mediump vec2 vTexCoord; - -uniform mat3 uModelViewIT; -attribute mediump vec3 aNormal; -varying mediump vec3 vNormal; - -attribute mediump vec3 aPosition; -varying mediump vec4 vVertex; - -#define MAX_BONES_PER_MESH 12 - -#ifdef USE_BONES -uniform int uBoneCount; -uniform mediump mat4 uBoneMatrices[MAX_BONES_PER_MESH]; -uniform mediump mat3 uBoneMatricesIT[MAX_BONES_PER_MESH]; -attribute mediump vec4 aBoneWeights; -attribute mediump vec4 aBoneIndices; -#endif - -void main() -{ - mediump vec4 vertexPosition = vec4(aPosition, 1.0); - -#ifdef USE_BONES - if(uBoneCount > 0) - { - mediump vec4 boneWeights = aBoneWeights; - mediump ivec4 boneIndices = ivec4(aBoneIndices); - mediump vec3 vertexNormal; - - // re-calculate the final weight - boneWeights.w = 1.0 - dot(boneWeights.xyz, vec3(1.0, 1.0, 1.0)); - - mediump vec4 bonePos = (uBoneMatrices[boneIndices.x] * vertexPosition) * boneWeights.x; - bonePos += (uBoneMatrices[boneIndices.y] * vertexPosition) * boneWeights.y; - bonePos += (uBoneMatrices[boneIndices.z] * vertexPosition) * boneWeights.z; - bonePos += (uBoneMatrices[boneIndices.w] * vertexPosition) * boneWeights.w; - - vertexNormal = (uBoneMatricesIT[boneIndices.x] * aNormal) * boneWeights.x; - vertexNormal += (uBoneMatricesIT[boneIndices.y] * aNormal) * boneWeights.y; - vertexNormal += (uBoneMatricesIT[boneIndices.z] * aNormal) * boneWeights.z; - vertexNormal += (uBoneMatricesIT[boneIndices.w] * aNormal) * boneWeights.w; - vertexNormal = normalize(vertexNormal); - - vertexPosition = uProjection * bonePos; - vVertex = bonePos; - vNormal = vertexNormal; - } - else - { -#endif - vertexPosition = uMvpMatrix * vec4(aPosition, 1.0); - vVertex = uModelView * vec4(aPosition, 1.0); - vNormal = uModelViewIT * aNormal; -#ifdef USE_BONES - } -#endif - gl_Position = vertexPosition; - - mediump vec2 start = uCustomTextureCoords.xy; - mediump vec2 scale = uCustomTextureCoords.zw; - vTexCoord = vec2(start.x + aTexCoord.x * scale.x, start.y + aTexCoord.y * scale.y); -} - - - - - -struct Material -{ - mediump float mOpacity; - mediump float mShininess; - lowp vec4 mAmbient; - lowp vec4 mDiffuse; - lowp vec4 mSpecular; - lowp vec4 mEmissive; -}; - -uniform sampler2D sTexture; -uniform sampler2D sOpacityTexture; -uniform sampler2D sNormalMapTexture; -uniform sampler2D sEffect; -varying mediump vec2 vTexCoord; - -uniform Material uMaterial; - -uniform lowp vec4 uColor; -varying highp vec4 vVertex; -varying highp vec3 vNormal; - -void main() -{ - // sample the texture for the initial color - mediump vec4 fragColor = texture2D(sTexture, vTexCoord); - - // apply material properties - fragColor.rgb *= (uMaterial.mAmbient + uMaterial.mDiffuse).rgb; - - // apply material alpha/opacity to alpha channel - fragColor.a *= uMaterial.mOpacity * uMaterial.mDiffuse.a; - - // and finally, apply Actor color - fragColor *= uColor; - - gl_FragColor = fragColor; -} - - diff --git a/dali/internal/render/shader-source/untextured-mesh.txt b/dali/internal/render/shader-source/untextured-mesh.txt deleted file mode 100644 index a2cd5b9..0000000 --- a/dali/internal/render/shader-source/untextured-mesh.txt +++ /dev/null @@ -1,131 +0,0 @@ - -uniform mediump mat4 uProjection; -uniform mediump mat4 uModelView; -uniform mediump mat4 uMvpMatrix; - -uniform bool uTextureMapped; -uniform mediump vec4 uCustomTextureCoords; -attribute mediump vec2 aTexCoord; -varying mediump vec2 vTexCoord; - -uniform mat3 uModelViewIT; -attribute mediump vec3 aNormal; -varying mediump vec3 vNormal; - -attribute mediump vec3 aPosition; -varying mediump vec4 vVertex; -#define USE_NORMALS -#define MAX_BONES_PER_MESH 12 - -#ifdef USE_BONES -uniform int uBoneCount; -uniform mediump mat4 uBoneMatrices[MAX_BONES_PER_MESH]; -uniform mediump mat3 uBoneMatricesIT[MAX_BONES_PER_MESH]; -attribute mediump vec4 aBoneWeights; -attribute mediump vec4 aBoneIndices; -#endif - -#ifdef USE_COLOR -attribute lowp vec3 aColor; -varying mediump vec3 vColor; -#endif - -void main() -{ - mediump vec4 vertexPosition = vec4(aPosition, 1.0); - -#ifdef USE_BONES - if(uBoneCount > 0) - { - mediump vec4 boneWeights = aBoneWeights; - mediump ivec4 boneIndices = ivec4(aBoneIndices); - mediump vec3 vertexNormal; - - // re-calculate the final weight - boneWeights.w = 1.0 - dot(boneWeights.xyz, vec3(1.0, 1.0, 1.0)); - - mediump vec4 bonePos = (uBoneMatrices[boneIndices.x] * vertexPosition) * boneWeights.x; - bonePos += (uBoneMatrices[boneIndices.y] * vertexPosition) * boneWeights.y; - bonePos += (uBoneMatrices[boneIndices.z] * vertexPosition) * boneWeights.z; - bonePos += (uBoneMatrices[boneIndices.w] * vertexPosition) * boneWeights.w; - - vertexNormal = (uBoneMatricesIT[boneIndices.x] * aNormal) * boneWeights.x; - vertexNormal += (uBoneMatricesIT[boneIndices.y] * aNormal) * boneWeights.y; - vertexNormal += (uBoneMatricesIT[boneIndices.z] * aNormal) * boneWeights.z; - vertexNormal += (uBoneMatricesIT[boneIndices.w] * aNormal) * boneWeights.w; - vertexNormal = normalize(vertexNormal); - - vertexPosition = uProjection * bonePos; - vVertex = bonePos; - vNormal = vertexNormal; - } - else - { -#endif - vertexPosition = uMvpMatrix * vec4(aPosition, 1.0); - vVertex = uModelView * vec4(aPosition, 1.0); - vNormal = uModelViewIT * aNormal; -#ifdef USE_BONES - } -#endif - gl_Position = vertexPosition; - -#ifdef USE_COLOR - vColor = aColor; -#endif -} - - - - - -struct Material -{ - mediump float mOpacity; - mediump float mShininess; - lowp vec4 mAmbient; - lowp vec4 mDiffuse; - lowp vec4 mSpecular; - lowp vec4 mEmissive; -}; - -uniform sampler2D sTexture; -uniform sampler2D sOpacityTexture; -uniform sampler2D sNormalMapTexture; -uniform sampler2D sEffect; -varying mediump vec2 vTexCoord; - -uniform Material uMaterial; - -uniform lowp vec4 uColor; -varying highp vec4 vVertex; -varying highp vec3 vNormal; - -#ifdef USE_COLOR -varying mediump vec3 vColor; -#endif - -void main() -{ -#ifdef USE_COLOR - - // set initial color to vertex color - mediump vec4 fragColor = vec4(vColor, 1.0); - -#else - - // set initial color to material color - mediump vec4 fragColor = uMaterial.mAmbient + uMaterial.mDiffuse; - -#endif - - // apply material alpha/opacity to alpha channel - fragColor.a *= uMaterial.mOpacity * uMaterial.mDiffuse.a; - - // and finally, apply Actor color - fragColor *= uColor; - - gl_FragColor = fragColor; -} - - diff --git a/dali/internal/render/shaders/scene-graph-shader.cpp b/dali/internal/render/shaders/scene-graph-shader.cpp index fed282e..e72367c 100644 --- a/dali/internal/render/shaders/scene-graph-shader.cpp +++ b/dali/internal/render/shaders/scene-graph-shader.cpp @@ -73,31 +73,6 @@ template <> struct ParameterType< Dali::ShaderEffect::UniformCoordinateType > : namespace SceneGraph { -namespace // unnamed namespace -{ - -// Convert Geometry type bitmask to an array index -inline unsigned int GetGeometryTypeIndex(GeometryType type) -{ - unsigned int index = Log::value; - if ( type & GEOMETRY_TYPE_IMAGE ) - { - index = Log::value; - } - else if ( type & GEOMETRY_TYPE_UNTEXTURED_MESH ) - { - index = Log::value; - } - else if ( type & GEOMETRY_TYPE_TEXTURED_MESH ) - { - index = Log::value; - } - return index; -} - -} // unnamed namespace - - Shader::Shader( Dali::ShaderEffect::GeometryHints& hints ) : mGeometryHints( hints ), mGridDensity( Dali::ShaderEffect::DEFAULT_GRID_DENSITY ), @@ -228,8 +203,7 @@ void Shader::SetCoordinateTypeInRender( unsigned int index, Dali::ShaderEffect:: mUniformMetadata[ index ]->SetCoordinateType( type ); } -void Shader::SetProgram( GeometryType geometryType, - Integration::ResourceId resourceId, +void Shader::SetProgram( Integration::ResourceId resourceId, Integration::ShaderDataPtr shaderData, ProgramCache* programCache, bool modifiesGeometry ) @@ -237,42 +211,18 @@ void Shader::SetProgram( GeometryType geometryType, DALI_LOG_TRACE_METHOD_FMT(Debug::Filter::gShader, "%d\n", resourceId); mProgram = Program::New( *programCache, shaderData, modifiesGeometry ); - // Implement: mProgram = programCache->GetProgram( shaderData, modifiesGeometry ); // The program cache owns the Program object so we don't need to worry here. } -bool Shader::AreSubtypesRequired(GeometryType geometryType) -{ - DALI_ASSERT_DEBUG(geometryType < GEOMETRY_TYPE_LAST); - return false; -} - -Program* Shader::GetProgram( Context& context, - GeometryType type, - ShaderSubTypes subType, - unsigned int& programIndex ) -{ - DALI_ASSERT_DEBUG(type < GEOMETRY_TYPE_LAST); - DALI_DEBUG_OSTREAM(debugStream); - - return mProgram; -} - Program* Shader::GetProgram() { return mProgram; } - void Shader::SetUniforms( Context& context, Program& program, - BufferIndex bufferIndex, - unsigned int programIndex, - ShaderSubTypes subType ) + BufferIndex bufferIndex ) { - DALI_ASSERT_DEBUG( programIndex < Log::value ); - DALI_DEBUG_OSTREAM(debugStream); - if( mRenderTextureId && ( mTexture == NULL ) ) { mTexture = mTextureCache->GetTexture( mRenderTextureId ); @@ -310,12 +260,12 @@ void Shader::SetUniforms( Context& context, if ( metadata.name.length() > 0 ) { // 0 means program has not got a cache index for this uniform - if( 0 == metadata.cacheIndeces[ programIndex ][ subType ] ) + if( 0 == metadata.cacheIndex ) { // register cacheindex for this program - metadata.cacheIndeces[ programIndex ][ subType ] = program.RegisterUniform( metadata.name ); + metadata.cacheIndex = program.RegisterUniform( metadata.name ); } - loc = program.GetUniformLocation( metadata.cacheIndeces[ programIndex ][ subType ] ); + loc = program.GetUniformLocation( metadata.cacheIndex ); // if we find uniform with location if ( Program::UNIFORM_UNKNOWN != loc ) diff --git a/dali/internal/render/shaders/scene-graph-shader.h b/dali/internal/render/shaders/scene-graph-shader.h index 1c88575..83a65b0 100644 --- a/dali/internal/render/shaders/scene-graph-shader.h +++ b/dali/internal/render/shaders/scene-graph-shader.h @@ -239,45 +239,20 @@ public: /** * @brief Set the program for a geometry type. - * @param[in] geometryType The type of the object (geometry) that is to be rendered. * @param[in] resourceId The resource ID for the program. * @param[in] shaderData The program's vertex/fragment source and optionally compiled bytecode * @param[in] programCache Owner of the Programs - * @param[in] modifiesGeometry True if the vertex shader changes geometry + * @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( /** @deprecated This is currently ignored and will soon disappear. */ - GeometryType geometryType, - Integration::ResourceId resourceId, + void SetProgram( Integration::ResourceId resourceId, Integration::ShaderDataPtr shaderData, ProgramCache* programCache, bool modifiesGeometry ); /** - * Determine if subtypes are required for the given geometry type - * @deprecated - * @param[in] geometryType The type of the object (geometry) that is to be rendered. - * @return TRUE if subtypes are required, FALSE if there is only one subtype available - */ - bool AreSubtypesRequired(GeometryType geometryType); - - /** - * Get the program associated with the given type and subtype - * @deprecated - * @param[in] context the context used to render. - * @param[in] type the type of the object (geometry) that is being rendered. - * @param[in] subType Identifier for geometry types with specialised default shaders - * @param[out] programIndex returns the program index to be passed onto SetUniforms. - * @return the program to use. - */ - Program* GetProgram( Context& context, - GeometryType type, - ShaderSubTypes subType, - unsigned int& programIndex ); - - /** * Get the program built for this shader - * @deprecated - * @return the program to use. + * @return The program built from the shader sources. */ Program* GetProgram(); @@ -293,14 +268,13 @@ public: */ void SetUniforms( Context& context, Program& program, - BufferIndex bufferIndex, - unsigned int programIndex, - ShaderSubTypes subType = SHADER_DEFAULT ); + BufferIndex bufferIndex ); private: // Data Dali::ShaderEffect::GeometryHints mGeometryHints; ///< shader geometry hints for building the geometry float mGridDensity; ///< grid density + Texture* mTexture; ///< Raw Pointer to Texture Integration::ResourceId mRenderTextureId; ///< Copy of the texture ID for the render thread Integration::ResourceId mUpdateTextureId; ///< Copy of the texture ID for update thread diff --git a/dali/internal/render/shaders/uniform-meta.h b/dali/internal/render/shaders/uniform-meta.h index 8cb92b7..7f066d2 100644 --- a/dali/internal/render/shaders/uniform-meta.h +++ b/dali/internal/render/shaders/uniform-meta.h @@ -61,9 +61,9 @@ public: UniformMeta( const UniformMeta& meta ) : name( meta.name ), property( meta.property ), + cacheIndex( meta.cacheIndex ), coordinateType( meta.coordinateType ) { - memcpy( cacheIndeces, meta.cacheIndeces, sizeof(cacheIndeces) ); } /** @@ -83,9 +83,9 @@ private: UniformMeta( const std::string& uniformName, const PropertyBase& prop, Dali::ShaderEffect::UniformCoordinateType coordType ) : name( uniformName ), property( prop ), + cacheIndex( 0 ), coordinateType( coordType ) { - memset( cacheIndeces, 0, sizeof(cacheIndeces) ); } // Undefined @@ -95,9 +95,10 @@ public: std::string name; ///< name of uniform to set/animate const PropertyBase& property; ///< reference to the corresponding property - unsigned int cacheIndeces[ Log::value ][ SHADER_SUBTYPE_LAST ]; ///< internal program cache index, per program + unsigned int cacheIndex; ///< internal program cache index Dali::ShaderEffect::UniformCoordinateType coordinateType; ///< The coordinate type of the uniform + }; } // namespace SceneGraph diff --git a/dali/internal/update/manager/update-manager.cpp b/dali/internal/update/manager/update-manager.cpp index e106262..53391bc 100644 --- a/dali/internal/update/manager/update-manager.cpp +++ b/dali/internal/update/manager/update-manager.cpp @@ -613,9 +613,10 @@ void UpdateManager::RemoveShader( Shader* shader ) DALI_ASSERT_DEBUG(false); } -void UpdateManager::SetShaderProgram( Shader* shader, GeometryType geometryType, ResourceId resourceId, size_t shaderHash, bool modifiesGeometry ) +void UpdateManager::SetShaderProgram( Shader* shader, + ResourceId resourceId, size_t shaderHash, bool modifiesGeometry ) { - DALI_LOG_TRACE_METHOD_FMT(Debug::Filter::gShader, " - (geometryType:%d id:%d hash:%d)\n", geometryType, resourceId, shaderHash); + DALI_LOG_TRACE_METHOD_FMT(Debug::Filter::gShader, " - (id:%d hash:%d)\n", resourceId, shaderHash); DALI_ASSERT_ALWAYS( NULL != shader && "shader is uninitialized" ); @@ -625,13 +626,13 @@ void UpdateManager::SetShaderProgram( Shader* shader, GeometryType geometryType, shaderData->SetHashValue( shaderHash ); shaderData->SetResourceId( resourceId ); - typedef MessageValue5< Shader, GeometryType, Integration::ResourceId, Integration::ShaderDataPtr, ProgramCache*, bool> DerivedType; + typedef MessageValue4< Shader, Integration::ResourceId, Integration::ShaderDataPtr, ProgramCache*, bool> DerivedType; // Reserve some memory inside the render queue unsigned int* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) ); // Construct message in the render queue memory; note that delete should not be called on the return value - new (slot) DerivedType( shader, &Shader::SetProgram, geometryType, resourceId, shaderData, mImpl->renderManager.GetProgramCache(), modifiesGeometry ); + new (slot) DerivedType( shader, &Shader::SetProgram, resourceId, shaderData, mImpl->renderManager.GetProgramCache(), modifiesGeometry ); } } diff --git a/dali/internal/update/manager/update-manager.h b/dali/internal/update/manager/update-manager.h index da8a493..6812a87 100644 --- a/dali/internal/update/manager/update-manager.h +++ b/dali/internal/update/manager/update-manager.h @@ -306,14 +306,13 @@ public: void RemoveShader(Shader* shader); /** - * Set the shader program for a specified GeometryType to a Shader object + * Set the shader program for a Shader object * @param[in] shader The shader to modify - * @param[in] geometryType The GeometryType to map to the program * @param[in] resourceId A ResourceManager ticket ID for the program data (source and compiled binary) * @param[in] shaderHash hash key created with vertex and fragment shader code * @param[in] modifiesGeometry True if the vertex shader modifies geometry */ - void SetShaderProgram( Shader* shader, GeometryType geometryType, Integration::ResourceId resourceId, size_t shaderHash, bool modifiesGeometry ); + void SetShaderProgram( Shader* shader, Integration::ResourceId resourceId, size_t shaderHash, bool modifiesGeometry ); /** * Add a newly created gesture. @@ -727,18 +726,17 @@ inline void RemoveShaderMessage( UpdateManager& manager, Shader& shader ) inline void SetShaderProgramMessage( UpdateManager& manager, Shader& shader, - GeometryType geometryType, Integration::ResourceId resourceId, size_t shaderHash, bool modifiesGeometry ) { - typedef MessageValue5< UpdateManager, Shader*, GeometryType, Integration::ResourceId, size_t, bool > LocalType; + typedef MessageValue4< UpdateManager, Shader*, Integration::ResourceId, size_t, bool > LocalType; // Reserve some memory inside the message queue unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) ); // Construct message in the message queue memory; note that delete should not be called on the return value - new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, &shader, geometryType, resourceId, shaderHash, modifiesGeometry ); + new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, &shader, resourceId, shaderHash, modifiesGeometry ); } inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color ) diff --git a/dali/public-api/shader-effects/shader-effect.cpp b/dali/public-api/shader-effects/shader-effect.cpp index 742d37b..d8c09e0 100644 --- a/dali/public-api/shader-effects/shader-effect.cpp +++ b/dali/public-api/shader-effects/shader-effect.cpp @@ -52,12 +52,12 @@ ShaderEffect& ShaderEffect::operator=(const ShaderEffect& rhs) return *this; } -ShaderEffect ShaderEffect::New( const std::string& vertexShader, const std::string& fragmentShader, GeometryType type, GeometryHints hints) +ShaderEffect ShaderEffect::New( const std::string& vertexShader, const std::string& fragmentShader, GeometryHints hints) { // @todo MESH_REWORK - Assert only image geometry type is passed. Internal::ShaderEffectPtr internal = Internal::ShaderEffect::New( hints ); - internal->SetPrograms( type, vertexShader, fragmentShader ); + internal->SetPrograms( vertexShader, fragmentShader ); return ShaderEffect( internal.Get() ); } @@ -66,13 +66,12 @@ ShaderEffect ShaderEffect::NewWithPrefix( const std::string& vertexShaderPrefix, const std::string& vertexShader, const std::string& fragmentShaderPrefix, const std::string& fragmentShader, - GeometryType type, GeometryHints hints) { // @todo MESH_REWORK - Assert only image geometry type is passed. Internal::ShaderEffectPtr internal = Internal::ShaderEffect::New( hints ); - internal->SetPrograms( type, vertexShaderPrefix, fragmentShaderPrefix, vertexShader, fragmentShader ); + internal->SetPrograms( vertexShaderPrefix, fragmentShaderPrefix, vertexShader, fragmentShader ); return ShaderEffect( internal.Get() ); } diff --git a/dali/public-api/shader-effects/shader-effect.h b/dali/public-api/shader-effects/shader-effect.h index c38aa0d..ad1282e 100644 --- a/dali/public-api/shader-effects/shader-effect.h +++ b/dali/public-api/shader-effects/shader-effect.h @@ -61,19 +61,7 @@ class ShaderEffect; } /** - * @brief GeometryType determines how geometry is shaped. - */ -enum GeometryType -{ - GEOMETRY_TYPE_IMAGE = 0x01, ///< image, with flat color or texture - GEOMETRY_TYPE_UNTEXTURED_MESH = 0x02, ///< Complex meshes, with flat color - GEOMETRY_TYPE_TEXTURED_MESH = 0x04, ///< Complex meshes, with texture - GEOMETRY_TYPE_LAST = 0x08 - // @todo MESH_REWORK - Remove these geometry types. -}; - -/** - * @brief Shader effects provide a visual effect for actors. + * @brief Shader effects provide a visual effect for image actors. * * @deprecated Use classes Dali::Shader, Dali::Material, and Dali::Sampler to implement * any new programmable shading effects. @@ -189,14 +177,11 @@ public: * * @param vertexShader code for the effect. If you pass in an empty string, the default version will be used * @param fragmentShader code for the effect. If you pass in an empty string, the default version will be used - * @param type GeometryType to define the shape of the geometry. Only GEOMETRY_TYPE_IMAGE is accepted for this - * parameter. Any other value will lead to an error. * @param hints GeometryHints to define the geometry of the rendered object * @return A handle to a shader effect */ static ShaderEffect New( const std::string& vertexShader, const std::string& fragmentShader, - GeometryType type = GeometryType(GEOMETRY_TYPE_IMAGE), GeometryHints hints = GeometryHints(HINT_NONE) ); /** @@ -205,8 +190,6 @@ public: * @param vertexShader code for the effect. If you pass in an empty string, the default version will be used * @param fragmentShaderPrefix code for the effect. It will be inserted before the default uniforms (ideal for \#defines) * @param fragmentShader code for the effect. If you pass in an empty string, the default version will be used - * @param type GeometryType to define the shape of the geometry. Only GEOMETRY_TYPE_IMAGE is accepted for this - * parameter. Any other value will lead to an error. * @param hints GeometryHints to define the geometry of the rendered object * @return A handle to a shader effect */ @@ -214,7 +197,6 @@ public: const std::string& vertexShader, const std::string& fragmentShaderPrefix, const std::string& fragmentShader, - GeometryType type = GeometryType(GEOMETRY_TYPE_IMAGE), GeometryHints hints = GeometryHints(HINT_NONE) ); /** -- 2.7.4