Skip to content

Fix light uniforms not properly being updated

Paul Lemire requested to merge lemirep/qt3d:kde_patch_1 into 5.15
  • We cache commands and only rebuild them when really needed. When we rebuild then, we also store the mapping between uniform location and parameter name
  • When reusing a command, we only update the uniform values but expect the mapping between to remain the same.
  • When dealing with lights however, we can end up in a case where the light type changes, and therefore so does the shader data associated. The command remains cached as nothing really requires a rebuid. Yet, this means we could have more or less parameters than the number of mappings we have stored previously if the shader data defines more or less properties. To account for this, we now rebuild the mapping when building the command or if the number of parameters in the parameter pack is different than at the previous frame.

Change-Id: I2fb03449a33220f5144fc350dbe5f61eec8aa0fa (cherry picked from commit 8760e8254205732a4730f5d98994dd2f87a9f2e8)

Merge request reports