mesa: If validation fails in a debug context just emit a debug message
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 13 Jun 2016 16:59:10 +0000 (09:59 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 16 Jun 2016 16:33:54 +0000 (09:33 -0700)
There are quite a few pipelines that desktop applications (including a
bunch of piglit test) can expect to have run but don't meet the GLES
requirements.  Instead of failing validation, just emit a debug message.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96358
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Cc: Gregory Hainaut <gregory.hainaut@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/mesa/main/pipelineobj.c

index 5a46cfe2dcda357e872811a8d42736a84d7f646d..9ecbcc9e9f6e2ff77afd33e5c691d8ba49f0889c 100644 (file)
@@ -929,8 +929,21 @@ _mesa_validate_program_pipeline(struct gl_context* ctx,
     * application has created a debug context.
     */
    if ((_mesa_is_gles(ctx) || (ctx->Const.ContextFlags & GL_CONTEXT_FLAG_DEBUG_BIT)) &&
-       !_mesa_validate_pipeline_io(pipe))
-      return GL_FALSE;
+       !_mesa_validate_pipeline_io(pipe)) {
+      if (_mesa_is_gles(ctx))
+         return GL_FALSE;
+
+      static GLuint msg_id = 0;
+
+      _mesa_gl_debug(ctx, &msg_id,
+                     MESA_DEBUG_SOURCE_API,
+                     MESA_DEBUG_TYPE_PORTABILITY,
+                     MESA_DEBUG_SEVERITY_MEDIUM,
+                     "glValidateProgramPipeline: pipeline %u does not meet "
+                     "strict OpenGL ES 3.1 requirements and may not be "
+                     "portable across desktop hardware\n",
+                     pipe->Name);
+   }
 
    pipe->Validated = GL_TRUE;
    return GL_TRUE;