mesa: fix glRead/DrawBuffer(GL_AUXn) error value
authorBrian Paul <brianp@vmware.com>
Thu, 12 Mar 2009 20:14:58 +0000 (14:14 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 12 Mar 2009 20:17:27 +0000 (14:17 -0600)
If GL_AUX[123] are passed to glRead/DrawBuffer() when those buffers don't
exist, need to generate GL_INVALID_OPERATION, not GL_INVALID_ENUM.

This regression came from commit 555f0a88182e2b1af809b2d97abdac02814a2f28

src/mesa/main/buffers.c

index 1580487ffd62e7d586eff64e3010ee6f0205d83f..c5f13345f0481cf9a9316f2c6d21d4dbc21231f3 100644 (file)
@@ -119,6 +119,10 @@ draw_buffer_enum_to_bitmask(GLenum buffer)
          return BUFFER_BIT_FRONT_LEFT;
       case GL_AUX0:
          return BUFFER_BIT_AUX0;
+      case GL_AUX1:
+      case GL_AUX2:
+      case GL_AUX3:
+         return 1 << BUFFER_COUNT; /* invalid, but not BAD_MASK */
       case GL_COLOR_ATTACHMENT0_EXT:
          return BUFFER_BIT_COLOR0;
       case GL_COLOR_ATTACHMENT1_EXT:
@@ -170,6 +174,10 @@ read_buffer_enum_to_index(GLenum buffer)
          return BUFFER_FRONT_LEFT;
       case GL_AUX0:
          return BUFFER_AUX0;
+      case GL_AUX1:
+      case GL_AUX2:
+      case GL_AUX3:
+         return BUFFER_COUNT; /* invalid, but not -1 */
       case GL_COLOR_ATTACHMENT0_EXT:
          return BUFFER_COLOR0;
       case GL_COLOR_ATTACHMENT1_EXT: