diff options
Diffstat (limited to 'backends/graphics/opengl/pipelines')
-rw-r--r-- | backends/graphics/opengl/pipelines/shader.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backends/graphics/opengl/pipelines/shader.cpp b/backends/graphics/opengl/pipelines/shader.cpp index 84c42e30ed..8e38458f73 100644 --- a/backends/graphics/opengl/pipelines/shader.cpp +++ b/backends/graphics/opengl/pipelines/shader.cpp @@ -32,6 +32,18 @@ ShaderPipeline::ShaderPipeline(Shader *shader) _vertexAttribLocation = shader->getAttributeLocation("position"); _texCoordAttribLocation = shader->getAttributeLocation("texCoordIn"); _colorAttribLocation = shader->getAttributeLocation("blendColorIn"); + + assert(_vertexAttribLocation != -1); + assert(_texCoordAttribLocation != -1); + assert(_colorAttribLocation != -1); + + // One of the attributes needs to be passed through location 0, otherwise + // we get no output for GL contexts due to GL compatibility reasons. Let's + // check whether this ever happens. If this ever gets hit, we need to + // enable location 0 and pass some dummy values through it to fix output. + assert( _vertexAttribLocation == 0 + || _texCoordAttribLocation == 0 + || _colorAttribLocation == 0); } void ShaderPipeline::activateInternal() { |