intel: do not create renderbuffers out of planar images
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Wed, 27 Mar 2013 13:32:21 +0000 (15:32 +0200)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 2 Aug 2013 05:56:03 +0000 (08:56 +0300)
v2 (Chad): emit 'GL_INVALID_OPERATION' and description of error

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/intel_fbo.c

index e746cb434e3bc4dbb0b9647d599cc374ec70139a..059b3eac492d0ded9d55cfb9d35bca81b3752591 100644 (file)
@@ -261,6 +261,13 @@ intel_image_target_renderbuffer_storage(struct gl_context *ctx,
    if (image == NULL)
       return;
 
+   if (image->planar_format && image->planar_format->nplanes > 1) {
+      _mesa_error(ctx, GL_INVALID_OPERATION,
+            "glEGLImageTargetRenderbufferStorage(planar buffers are not "
+               "supported as render targets.");
+      return;
+   }
+
    /* __DRIimage is opaque to the core so it has to be checked here */
    switch (image->format) {
    case MESA_FORMAT_RGBA8888_REV: