intel: Add an assert for glCopyTexSubImage() being called on MSAA buffers.
authorEric Anholt <eric@anholt.net>
Fri, 24 May 2013 20:37:13 +0000 (13:37 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 28 May 2013 19:40:44 +0000 (12:40 -0700)
This is just in case someone else trips over this due to our weird reuse
of this code in glBlitFramebuffer().

Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/intel/intel_tex_copy.c

index 94e90da5eaa87cc991ebf6d854caa7555484cf93..4a13b9ae2c2e4cdab6d3b7c633b19e9daf78d6f4 100644 (file)
@@ -62,6 +62,12 @@ intel_copy_texsubimage(struct intel_context *intel,
 
    intel_prepare_render(intel);
 
+   /* glCopyTexSubImage() can't be called on multisampled renderbuffers or
+    * textures.
+    */
+   assert(!irb->Base.Base.NumSamples);
+   assert(!intelImage->base.Base.NumSamples);
+
    if (!intelImage->mt || !irb || !irb->mt) {
       if (unlikely(INTEL_DEBUG & DEBUG_PERF))
         fprintf(stderr, "%s fail %p %p (0x%08x)\n",