From 17e9c3d00c043d650f8e2114f46471c83cdc8117 Mon Sep 17 00:00:00 2001 From: Brad Davis <bdavis@saintandreas.org> Date: Mon, 15 Jan 2018 13:43:19 -0800 Subject: [PATCH] Don't try to set invalid uniforms --- libraries/render-utils/src/text/Font.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/render-utils/src/text/Font.cpp b/libraries/render-utils/src/text/Font.cpp index 8449c58c7c..b6868a2cd4 100644 --- a/libraries/render-utils/src/text/Font.cpp +++ b/libraries/render-utils/src/text/Font.cpp @@ -369,11 +369,15 @@ void Font::drawString(gpu::Batch& batch, float x, float y, const QString& str, c batch.setPipeline(((*color).a < 1.0f || layered) ? _transparentPipeline : _pipeline); batch.setResourceTexture(_fontLoc, _texture); - batch._glUniform1i(_outlineLoc, (effectType == OUTLINE_EFFECT)); + if (_outlineLoc >= 0) { + batch._glUniform1i(_outlineLoc, (effectType == OUTLINE_EFFECT)); + } // need the gamma corrected color here glm::vec4 lrgba = ColorUtils::sRGBToLinearVec4(*color); - batch._glUniform4fv(_colorLoc, 1, (const float*)&lrgba); + if (_colorLoc >= 0) { + batch._glUniform4fv(_colorLoc, 1, (const float*)&lrgba); + } batch.setInputFormat(_format); batch.setInputBuffer(0, _verticesBuffer, 0, _format->getChannels().at(0)._stride);