diff options
author | Marek Olšák <maraeo@gmail.com> | 2011-12-10 04:14:46 +0100 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2011-12-13 17:49:00 +0100 |
commit | df809ae92343bb83c162ea4c807cefb67686717d (patch) | |
tree | b4d6e1eea8c6c445948f88be30783afa6ba8c4e9 /src/glsl | |
parent | 8a11d40c4e8d3338571a8d85638d0100e1a2aafb (diff) | |
download | external_mesa3d-df809ae92343bb83c162ea4c807cefb67686717d.zip external_mesa3d-df809ae92343bb83c162ea4c807cefb67686717d.tar.gz external_mesa3d-df809ae92343bb83c162ea4c807cefb67686717d.tar.bz2 |
mesa: add const flags to skip MaxVarying and MaxUniform linker checks (v2)
This is only temporary until a better solution is available.
v2: print warnings and add gallium CAPs
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/linker.cpp | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 3527088..b8a7126 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -1815,18 +1815,34 @@ assign_varying_locations(struct gl_context *ctx, if (ctx->API == API_OPENGLES2 || prog->Version == 100) { if (varying_vectors > ctx->Const.MaxVarying) { - linker_error(prog, "shader uses too many varying vectors " - "(%u > %u)\n", - varying_vectors, ctx->Const.MaxVarying); - return false; + 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; + } } } else { const unsigned float_components = varying_vectors * 4; if (float_components > ctx->Const.MaxVarying * 4) { - linker_error(prog, "shader uses too many varying components " - "(%u > %u)\n", - float_components, ctx->Const.MaxVarying * 4); - return false; + 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; + } } } @@ -1960,8 +1976,15 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog) } if (sh->num_uniform_components > max_uniform_components[i]) { - linker_error(prog, "Too many %s shader uniform components", - shader_names[i]); + if (ctx->Const.GLSLSkipStrictMaxUniformLimitCheck) { + linker_warning(prog, "Too many %s shader uniform components, " + "but the driver will try to optimize them out; " + "this is non-portable out-of-spec behavior\n", + shader_names[i]); + } else { + linker_error(prog, "Too many %s shader uniform components", + shader_names[i]); + } } } |