Revert "Fix attribute cache bug"
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 9 Dec 2022 14:00:51 +0000 (23:00 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Fri, 9 Dec 2022 14:00:51 +0000 (23:00 +0900)
This reverts commit 2c55cc6b056f93522e36943d7bbaf770a5aa2170.

automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-abstraction.h
dali/internal/graphics/gles-impl/gles-context.cpp
dali/internal/graphics/gles-impl/gles-graphics-reflection.cpp

index 7ba7834..5e5fde3 100644 (file)
@@ -885,9 +885,6 @@ public:
       case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
         *params = 100;
         break;
-      case GL_ACTIVE_ATTRIBUTES:
-        *params = static_cast<GLint>(mAttribLocs.size());
-        break;
     }
   }
 
index 02d32ee..1d981bc 100644 (file)
@@ -64,13 +64,6 @@ struct Context::Impl
         mProgramVAOCurrentState = iter->second;
         gl.BindVertexArray(iter->second);
       }
-
-      // We should re-check enable attribute usage because geometry might be changed.
-      // @todo : We can remove this loop if we enable vertex attrib by shader's information.
-      for(const auto& attr : vertexInputState.attributes)
-      {
-        gl.EnableVertexAttribArray(attr.location);
-      }
       return;
     }
 
@@ -78,9 +71,6 @@ struct Context::Impl
     gl.GenVertexArrays(1, &vao);
     gl.BindVertexArray(vao);
     mProgramVAOMap[program] = vao;
-    
-    // @todo : Enable vertex attrib only by shader's information, not with Geometry.
-    // Currently, vertexInputState.attributes depend on Geometry's VertexBuffer.
     for(const auto& attr : vertexInputState.attributes)
     {
       gl.EnableVertexAttribArray(attr.location);
index d25ec1d..05776c2 100644 (file)
@@ -220,8 +220,6 @@ void Reflection::BuildVertexAttributeReflection()
   mVertexInputAttributes.clear();
   mVertexInputAttributes.resize(nAttribs);
 
-  int maximumLocation = nAttribs - 1;
-
   name = new GLchar[maxLength];
   for(int i = 0; i < nAttribs; i++)
   {
@@ -230,21 +228,13 @@ void Reflection::BuildVertexAttributeReflection()
 
     if(location >= 0)
     {
-      if(maximumLocation < location)
-      {
-        maximumLocation = location;
-        // Increate continer size s.t. we can use maximumLocation as index.
-        mVertexInputAttributes.resize(maximumLocation + 1u);
-      }
-
       AttributeInfo attributeInfo;
       attributeInfo.location = location;
       attributeInfo.name     = name;
       attributeInfo.format   = GetVertexAttributeTypeFormat(type);
-      mVertexInputAttributes[location] = std::move(attributeInfo);
+      mVertexInputAttributes.insert(mVertexInputAttributes.begin() + location, attributeInfo);
     }
   }
-
   delete[] name;
 }