Trying to read depth values from a non-existant depth buffer should
generate GL_INVALID_OPERATION.
---
 src/mesa/main/readpix.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 3882e09..9193def 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -660,7 +660,8 @@ _mesa_error_check_format_type(struct gl_context *ctx, 
GLenum format,
       }
       break;
    case GL_DEPTH_COMPONENT:
-      if ((drawing && !_mesa_dest_buffer_exists(ctx, format))) {
+      if ((drawing && !_mesa_dest_buffer_exists(ctx, format)) ||
+          (reading && !_mesa_source_buffer_exists(ctx, format))) {
          _mesa_error(ctx, GL_INVALID_OPERATION,
                      "gl%sPixels(no depth buffer)", readDraw);
          return GL_TRUE;
-- 
1.7.3.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to