Don't try to set invalid slots in the fade effect

This commit is contained in:
Brad Davis 2018-01-18 16:49:19 -08:00
parent 6fa0ef88ff
commit 0a0e5ab84b

View file

@ -34,8 +34,12 @@ render::ShapePipeline::BatchSetter FadeEffect::getBatchSetter() const {
auto program = shapePipeline.pipeline->getProgram();
auto maskMapLocation = program->getTextures().findLocation("fadeMaskMap");
auto bufferLocation = program->getUniformBuffers().findLocation("fadeParametersBuffer");
batch.setResourceTexture(maskMapLocation, _maskMap);
batch.setUniformBuffer(bufferLocation, _configurations);
if (maskMapLocation != -1) {
batch.setResourceTexture(maskMapLocation, _maskMap);
}
if (bufferLocation != -1) {
batch.setUniformBuffer(bufferLocation, _configurations);
}
};
}