diff options
author | marha <marha@users.sourceforge.net> | 2013-07-04 13:38:47 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-07-04 13:38:47 +0200 |
commit | 2ecad38adbeaa652daaab8f2a6d112921b7e74eb (patch) | |
tree | adce02d84ceeb4be5fef88a1ba490b1294685a5b /mesalib/src/glsl/link_varyings.cpp | |
parent | 28d1f604563d9c738a4c5630364d0e6b4e9b13ff (diff) | |
download | vcxsrv-2ecad38adbeaa652daaab8f2a6d112921b7e74eb.tar.gz vcxsrv-2ecad38adbeaa652daaab8f2a6d112921b7e74eb.tar.bz2 vcxsrv-2ecad38adbeaa652daaab8f2a6d112921b7e74eb.zip |
fontconfig mesa libxcb git update 4 jul 2013
libxcb commit 8b6bb1a71977116d382f45eef803aedd3e313d37
libxcb/xcb-proto commit e6a246e50e62cbcba33d0e1d2371e69e6e089383
fontconfig commit d420e1df983871ab18b0f07976596fdf0ce78847
mesa commit bbd1e60198548a12be3405fc32dd39a87e8968ab
Diffstat (limited to 'mesalib/src/glsl/link_varyings.cpp')
-rw-r--r-- | mesalib/src/glsl/link_varyings.cpp | 67 |
1 files changed, 32 insertions, 35 deletions
diff --git a/mesalib/src/glsl/link_varyings.cpp b/mesalib/src/glsl/link_varyings.cpp index 4fdbdc199..51cbdaa0e 100644 --- a/mesalib/src/glsl/link_varyings.cpp +++ b/mesalib/src/glsl/link_varyings.cpp @@ -1113,16 +1113,12 @@ assign_varying_locations(struct gl_context *ctx, } } - unsigned varying_vectors = 0; - if (consumer) { foreach_list(node, consumer->ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); - if ((var == NULL) || (var->mode != ir_var_shader_in)) - continue; - - if (var->is_unmatched_generic_inout) { + if (var && var->mode == ir_var_shader_in && + var->is_unmatched_generic_inout) { if (prog->Version <= 120) { /* On page 25 (page 31 of the PDF) of the GLSL 1.20 spec: * @@ -1148,45 +1144,46 @@ assign_varying_locations(struct gl_context *ctx, * value is written by the previous stage. */ var->mode = ir_var_auto; - } else if (is_varying_var(consumer->Type, var)) { - /* The packing rules are used for vertex shader inputs are also - * used for fragment shader inputs. - */ - varying_vectors += count_attribute_slots(var->type); } } } + return true; +} + +bool +check_against_varying_limit(struct gl_context *ctx, + struct gl_shader_program *prog, + gl_shader *consumer) +{ + unsigned varying_vectors = 0; + + foreach_list(node, consumer->ir) { + ir_variable *const var = ((ir_instruction *) node)->as_variable(); + + if (var && var->mode == ir_var_shader_in && + is_varying_var(consumer->Type, var)) { + /* The packing rules used for vertex shader inputs are also + * used for fragment shader inputs. + */ + varying_vectors += count_attribute_slots(var->type); + } + } + if (ctx->API == API_OPENGLES2 || prog->IsES) { if (varying_vectors > ctx->Const.MaxVarying) { - if (ctx->Const.GLSLSkipStrictMaxVaryingLimitCheck) { - linker_warning(prog, "shader uses too many varying vectors " - "(%u > %u), but the driver will try to optimize " - "them out; this is non-portable out-of-spec " - "behavior\n", - varying_vectors, ctx->Const.MaxVarying); - } else { - linker_error(prog, "shader uses too many varying vectors " - "(%u > %u)\n", - varying_vectors, ctx->Const.MaxVarying); - return false; - } + linker_error(prog, "shader uses too many varying vectors " + "(%u > %u)\n", + varying_vectors, ctx->Const.MaxVarying); + return false; } } else { const unsigned float_components = varying_vectors * 4; if (float_components > ctx->Const.MaxVarying * 4) { - if (ctx->Const.GLSLSkipStrictMaxVaryingLimitCheck) { - linker_warning(prog, "shader uses too many varying components " - "(%u > %u), but the driver will try to optimize " - "them out; this is non-portable out-of-spec " - "behavior\n", - float_components, ctx->Const.MaxVarying * 4); - } else { - linker_error(prog, "shader uses too many varying components " - "(%u > %u)\n", - float_components, ctx->Const.MaxVarying * 4); - return false; - } + linker_error(prog, "shader uses too many varying components " + "(%u > %u)\n", + float_components, ctx->Const.MaxVarying * 4); + return false; } } |