summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2014-12-01 14:16:24 -0800
committerIan Romanick <ian.d.romanick@intel.com>2014-12-03 11:33:49 -0800
commit5eca78a00a5de442aaf541a1095d5cfa6b4f45de (patch)
tree703860484f000f83e36ea259509027392fe9032b /src/glsl/link_varyings.cpp
parenta2f2eebfdfb9c19e45792101fc5cad3dd3f0f4d6 (diff)
downloadexternal_mesa3d-5eca78a00a5de442aaf541a1095d5cfa6b4f45de.zip
external_mesa3d-5eca78a00a5de442aaf541a1095d5cfa6b4f45de.tar.gz
external_mesa3d-5eca78a00a5de442aaf541a1095d5cfa6b4f45de.tar.bz2
linker: Wrap access of producer_var with a NULL check
producer_var could be NULL if consumer_var is not NULL and consumer_is_fs is false. This will occur when the producer is NULL and the consumer is the geometry shader for a program that contains only a geometry shader. This will occur starting with the next patch. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Cc: pavol@klacansky.com Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82585 Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'src/glsl/link_varyings.cpp')
-rw-r--r--src/glsl/link_varyings.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index 1866ab2..43da2c6 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -835,9 +835,11 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var)
* regardless of where they appear. We can trivially satisfy that
* requirement by changing the interpolation type to flat here.
*/
- producer_var->data.centroid = false;
- producer_var->data.sample = false;
- producer_var->data.interpolation = INTERP_QUALIFIER_FLAT;
+ if (producer_var) {
+ producer_var->data.centroid = false;
+ producer_var->data.sample = false;
+ producer_var->data.interpolation = INTERP_QUALIFIER_FLAT;
+ }
if (consumer_var) {
consumer_var->data.centroid = false;