Cut performance cost in QSGContext::prepareMaterial()
authorGunnar Sletta <gunnar.sletta@digia.com>
Sat, 18 May 2013 06:20:30 +0000 (08:20 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 23 May 2013 09:22:56 +0000 (11:22 +0200)
commit0e9cd8b4098661bf611fa73a787c58c85e7d7338
tree2be51fc45238e147531c5ba87b090bd83ffecf72
parentc23dfece55e12c18a19a72ccf8ea617eaea50ba6
Cut performance cost in QSGContext::prepareMaterial()

The hash-lookup in this function is costing us a lot, and
since we're looking up the same materials again and again,
and the material has a place holder for it, we can store it
directly in the material at no extra cost. This was a 10%
gain in this particular benchmark.

Change-Id: I46b67791ce39f453fa86d1ee82f6f5c7785b46a1
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
src/quick/scenegraph/coreapi/qsgmaterial.cpp
src/quick/scenegraph/coreapi/qsgmaterial.h
src/quick/scenegraph/qsgcontext.cpp