PIPE_CAP_MIN_TEXEL_OFFSET = 50,
PIPE_CAP_MAX_TEXEL_OFFSET = 51,
PIPE_CAP_CONDITIONAL_RENDER = 52,
- PIPE_CAP_TEXTURE_BARRIER = 53
+ PIPE_CAP_TEXTURE_BARRIER = 53,
+ PIPE_CAP_TGSI_CAN_COMPACT_VARYINGS = 54, /* temporary */
+ PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS = 55 /* temporary */
};
/**
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;
+ }
}
}
}
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]);
+ }
}
}
* Texture borders are deprecated in GL 3.0.
**/
GLboolean StripTextureBorder;
+
+ /**
+ * For drivers which can do a better job at eliminating unused varyings
+ * and uniforms than the GLSL compiler.
+ *
+ * XXX Remove these as soon as a better solution is available.
+ */
+ GLboolean GLSLSkipStrictMaxVaryingLimitCheck;
+ GLboolean GLSLSkipStrictMaxUniformLimitCheck;
};