Closed dmnsgn closed 10 months ago
Well that's why program.id is used. As program is cached by flags and those should contain all the required features. Do you have a test case?
Test case:
getGeometryPipeline
:
https://github.com/pex-gl/pex-renderer/blob/41759af9e1652e7c050df58a0821acd8022c4b80/systems/renderer/standard.js#L426-L428TextureSettingsTest
Material_${MaterialID++}
to material component returned value, see test passingI think that id was omitted on purpose to avoid material explosion. For now i would double check if we cache all the flags eg culling and long term find better approach than dirty flag.
Should be fixed in v4 so closing.
New components don't increment material ids: https://github.com/pex-gl/pex-renderer/blob/41759af9e1652e7c050df58a0821acd8022c4b80/components/material.js#L158-L177
As a result, pipeline cache might use the wrong material as the following:
https://github.com/pex-gl/pex-renderer/blob/41759af9e1652e7c050df58a0821acd8022c4b80/systems/renderer/standard.js#L424
translates to
undefined_sharedProgramId_sharedGeometryPrimitive
ingetGeometryPipeline
.