Fix attribute cache bug 72/285372/4
authorEunki, Hong <eunkiki.hong@samsung.com>
Thu, 8 Dec 2022 09:29:52 +0000 (18:29 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Thu, 15 Dec 2022 13:13:58 +0000 (13:13 +0000)
commitae50a504aebbcfa3f970dad86fba7bc474b03cc0
tree2013bdfdc837433cbfed0612883a050e069a298a
parent2e0025e2267d2d1545b4d1cd51a7fe562af21995
Fix attribute cache bug

1. It is possible that GL_ACTIVE_ATTRIBUTES value is smaller than
location of attributes. If it happend, crashed due to mVertexInputAttributes.insert call.

To fix this crash issue, make mVertexInputAttributes size relative with location value,
not relative with GL_ACTIVE_ATTRIBUTES.
Also, It will guarantee that attribute's location can be index of it's real attrubutes.
(Since vector.insert operation shift the index, it was depend on the location input order.
and also slow)

2. Ensure the enable of vertex attributes.
Since  vertexInputState.attributes generated by Geometry in pipeline-cache system,
Change the attribute's list of geometry at the same shader was not worked.

TODO : Make VAO caching system works well. Currently, VAO doesn't useful.
We should found a way to EnableVertexAttribArray only with shader's information,
not depend on Geometry information.
or, we might need to calculate vertex attribute location list's hash, and use it as key.

Change-Id: I9f2c15617d279cfefbe1f8d72e5a9cbe43a7c564
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
dali/internal/graphics/gles-impl/gles-graphics-reflection.h