Change VAO hash value function 58/303158/2
authorEunki Hong <eunkiki.hong@samsung.com>
Wed, 20 Dec 2023 22:56:35 +0000 (07:56 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Thu, 21 Dec 2023 00:11:15 +0000 (09:11 +0900)
commitdd7d10717674a84325c3e1be19cd8889f9488f77
tree086808d7d3c56574e9c9b94ef3a7f1235c489a8b
parentc66a109a8d889bd2c6c130a61ac258f7e4aa7967
Change VAO hash value function

Since std::hash<uint32_t>{}(i); just return itself,
we need to make some other method to calculate hash of location.

For example, 0 location doesn't have any mean.
and location with 1, 3 will collision as location 2.

To avoid this hash collision, let we change some hash generate method.

  v = i + 1;
  hash += v << 24;
  v *= v;
  v ^= i;
  hash += v << 16;
  v *= v;
  hash += v;

Note that if we skip v ^= i; operation, collision occured when location is
near 13.

Change-Id: Ie081d9a5e8895988ca7183dfc860176b69c4e337
Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
dali/internal/graphics/gles-impl/gles-context.cpp