diff options
author | marha <marha@users.sourceforge.net> | 2014-07-01 09:29:23 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-07-01 09:29:23 +0200 |
commit | b6fac85cb1bb78f48ed81aaf42ba6b840b2d6cad (patch) | |
tree | 2cf97060ce44345489da6d1bcbbe568d2b2ea666 /mesalib/src/glsl/ast_type.cpp | |
parent | ac314766fd4f60b8ee0346b7586c1a5a6f533e11 (diff) | |
parent | cfc5bafcb2db8c6e05d7be6bb7315960be08c0d8 (diff) | |
download | vcxsrv-b6fac85cb1bb78f48ed81aaf42ba6b840b2d6cad.tar.gz vcxsrv-b6fac85cb1bb78f48ed81aaf42ba6b840b2d6cad.tar.bz2 vcxsrv-b6fac85cb1bb78f48ed81aaf42ba6b840b2d6cad.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
fontconfig mesa pixman git update 1 July 2014
Diffstat (limited to 'mesalib/src/glsl/ast_type.cpp')
-rw-r--r-- | mesalib/src/glsl/ast_type.cpp | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/mesalib/src/glsl/ast_type.cpp b/mesalib/src/glsl/ast_type.cpp index 77053d5b1..017f23d0e 100644 --- a/mesalib/src/glsl/ast_type.cpp +++ b/mesalib/src/glsl/ast_type.cpp @@ -125,9 +125,13 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc, /* Uniform block layout qualifiers get to overwrite each * other (rightmost having priority), while all other * qualifiers currently don't allow duplicates. + * + * Geometry shaders can have several layout qualifiers + * assigning different stream values. */ - if ((this->flags.i & q.flags.i & ~(ubo_mat_mask.flags.i | + if ((state->stage != MESA_SHADER_GEOMETRY) && + (this->flags.i & q.flags.i & ~(ubo_mat_mask.flags.i | ubo_layout_mask.flags.i | ubo_binding_mask.flags.i)) != 0) { _mesa_glsl_error(loc, state, @@ -154,6 +158,39 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc, this->max_vertices = q.max_vertices; } + if (state->stage == MESA_SHADER_GEOMETRY && + state->has_explicit_attrib_stream()) { + if (q.flags.q.stream && q.stream >= state->ctx->Const.MaxVertexStreams) { + _mesa_glsl_error(loc, state, + "`stream' value is larger than MAX_VERTEX_STREAMS - 1 " + "(%d > %d)", + q.stream, state->ctx->Const.MaxVertexStreams - 1); + } + if (this->flags.q.explicit_stream && + this->stream >= state->ctx->Const.MaxVertexStreams) { + _mesa_glsl_error(loc, state, + "`stream' value is larger than MAX_VERTEX_STREAMS - 1 " + "(%d > %d)", + this->stream, state->ctx->Const.MaxVertexStreams - 1); + } + + if (!this->flags.q.explicit_stream) { + if (q.flags.q.stream) { + this->flags.q.stream = 1; + this->stream = q.stream; + } else if (!this->flags.q.stream && this->flags.q.out) { + /* Assign default global stream value */ + this->flags.q.stream = 1; + this->stream = state->out_qualifier->stream; + } + } else { + if (q.flags.q.explicit_stream) { + _mesa_glsl_error(loc, state, + "duplicate layout `stream' qualifier"); + } + } + } + if ((q.flags.i & ubo_mat_mask.flags.i) != 0) this->flags.i &= ~ubo_mat_mask.flags.i; if ((q.flags.i & ubo_layout_mask.flags.i) != 0) |