aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics
diff options
context:
space:
mode:
authorJohannes Schickel2016-03-23 22:37:07 +0100
committerJohannes Schickel2016-03-23 22:37:16 +0100
commit8161effc68e3853f4c92536ab06ed9736684f6bf (patch)
treea2980113e711f834fdcdaf54c53fc545e32f79ac /backends/graphics
parent2ebffd2da5e9669a804a1dd8761ccd0d27533733 (diff)
downloadscummvm-rg350-8161effc68e3853f4c92536ab06ed9736684f6bf.tar.gz
scummvm-rg350-8161effc68e3853f4c92536ab06ed9736684f6bf.tar.bz2
scummvm-rg350-8161effc68e3853f4c92536ab06ed9736684f6bf.zip
OPENGL: Add assertions to check for valid attribute state.
Diffstat (limited to 'backends/graphics')
-rw-r--r--backends/graphics/opengl/pipelines/shader.cpp12
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() {