mesa: Remove the pretense of aux buffer support
authorAdam Jackson <ajax@redhat.com>
Wed, 24 Mar 2021 16:40:51 +0000 (12:40 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 30 Mar 2021 20:33:51 +0000 (20:33 +0000)
This might be nice to hook up at some point, but it's doing nothing at
the moment and it's not clear to me that it belongs as GL state instead
of winsys state.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9817>

16 files changed:
src/mesa/drivers/dri/common/utils.c
src/mesa/drivers/dri/i915/intel_clear.c
src/mesa/drivers/dri/i915/intel_screen.c
src/mesa/drivers/dri/i965/brw_clear.c
src/mesa/drivers/dri/i965/brw_screen.c
src/mesa/drivers/dri/nouveau/nouveau_screen.c
src/mesa/drivers/dri/radeon/radeon_screen.c
src/mesa/main/buffers.c
src/mesa/main/context.c
src/mesa/main/fbobject.c
src/mesa/main/get_hash_params.py
src/mesa/main/menums.h
src/mesa/main/mtypes.h
src/mesa/swrast/s_clear.c
src/mesa/swrast/s_renderbuffer.c
src/mesa/swrast/s_renderbuffer.h

index 671d33a..7da8768 100644 (file)
@@ -422,6 +422,7 @@ driGetConfigAttribIndex(const __DRIconfig *config,
     __ATTRIB(__DRI_ATTRIB_BLUE_SIZE,                   blueBits);
     case __DRI_ATTRIB_LEVEL:
     case __DRI_ATTRIB_LUMINANCE_SIZE:
+    case __DRI_ATTRIB_AUX_BUFFERS:
         *value = 0;
         break;
     __ATTRIB(__DRI_ATTRIB_ALPHA_SIZE,                  alphaBits);
@@ -458,7 +459,6 @@ driGetConfigAttribIndex(const __DRIconfig *config,
         break;
     __ATTRIB(__DRI_ATTRIB_DOUBLE_BUFFER,               doubleBufferMode);
     __ATTRIB(__DRI_ATTRIB_STEREO,                      stereoMode);
-    __ATTRIB(__DRI_ATTRIB_AUX_BUFFERS,                 numAuxBuffers);
     case __DRI_ATTRIB_TRANSPARENT_TYPE:
     case __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE: /* horrible bc hack */
         *value = GLX_NONE;
index c9722cb..ed9aca9 100644 (file)
@@ -48,7 +48,6 @@ static const char *buffer_names[] = {
    [BUFFER_DEPTH] = "depth",
    [BUFFER_STENCIL] = "stencil",
    [BUFFER_ACCUM] = "accum",
-   [BUFFER_AUX0] = "aux0",
    [BUFFER_COLOR0] = "color0",
    [BUFFER_COLOR1] = "color1",
    [BUFFER_COLOR2] = "color2",
index 60b35d3..f13a750 100644 (file)
@@ -912,8 +912,7 @@ intelCreateBuffer(__DRIscreen * driScrnPriv,
                                   false, /* never sw depth */
                                   false, /* never sw stencil */
                                   mesaVis->accumRedBits > 0,
-                                  false, /* never sw alpha */
-                                  false  /* never sw aux */ );
+                                  false /* never sw alpha */);
    driDrawPriv->driverPrivate = fb;
 
    return true;
index 667d2df..9d6df0f 100644 (file)
@@ -47,7 +47,6 @@ static const char *buffer_names[] = {
    [BUFFER_DEPTH] = "depth",
    [BUFFER_STENCIL] = "stencil",
    [BUFFER_ACCUM] = "accum",
-   [BUFFER_AUX0] = "aux0",
    [BUFFER_COLOR0] = "color0",
    [BUFFER_COLOR1] = "color1",
    [BUFFER_COLOR2] = "color2",
index df420c0..0f2b3f1 100644 (file)
@@ -1857,8 +1857,7 @@ brw_create_buffer(__DRIscreen *dri_screen,
                                   false, /* never sw depth */
                                   false, /* never sw stencil */
                                   mesaVis->accumRedBits > 0,
-                                  false, /* never sw alpha */
-                                  false  /* never sw aux */ );
+                                  false /* never sw alpha */);
    driDrawPriv->driverPrivate = fb;
 
    return true;
index ba85aac..447af09 100644 (file)
@@ -286,7 +286,7 @@ nouveau_create_buffer(__DRIscreen *dri_screen,
        /* Software renderbuffers. */
        _swrast_add_soft_renderbuffers(fb, GL_FALSE, GL_FALSE, GL_FALSE,
                                        visual->accumRedBits > 0,
-                                       GL_FALSE, GL_FALSE);
+                                       GL_FALSE);
 
        drawable->driverPrivate = fb;
 
index f61fe39..f34737c 100644 (file)
@@ -746,8 +746,7 @@ radeonCreateBuffer( __DRIscreen *driScrnPriv,
            swDepth,
            swStencil,
            swAccum,
-           swAlpha,
-           GL_FALSE /* aux */);
+           swAlpha);
     driDrawPriv->driverPrivate = (void *) rfb;
 
     return (driDrawPriv->driverPrivate != NULL);
index 9be0a6f..5930ec4 100644 (file)
@@ -65,7 +65,6 @@ supported_buffer_bitmask(const struct gl_context *ctx,
    }
    else {
       /* A window system framebuffer */
-      GLint i;
       mask = BUFFER_BIT_FRONT_LEFT; /* always have this */
       if (fb->Visual.stereoMode) {
          mask |= BUFFER_BIT_FRONT_RIGHT;
@@ -76,10 +75,6 @@ supported_buffer_bitmask(const struct gl_context *ctx,
       else if (fb->Visual.doubleBufferMode) {
          mask |= BUFFER_BIT_BACK_LEFT;
       }
-
-      for (i = 0; i < fb->Visual.numAuxBuffers; i++) {
-         mask |= (BUFFER_BIT_AUX0 << i);
-      }
    }
 
    return mask;
@@ -161,7 +156,6 @@ draw_buffer_enum_to_bitmask(const struct gl_context *ctx, GLenum buffer)
       case GL_FRONT_LEFT:
          return BUFFER_BIT_FRONT_LEFT;
       case GL_AUX0:
-         return BUFFER_BIT_AUX0;
       case GL_AUX1:
       case GL_AUX2:
       case GL_AUX3:
@@ -220,10 +214,9 @@ read_buffer_enum_to_index(const struct gl_context *ctx, GLenum buffer)
          return BUFFER_FRONT_LEFT;
       case GL_FRONT_LEFT:
          return BUFFER_FRONT_LEFT;
-      case GL_AUX0:
-         return BUFFER_AUX0;
       case GL_FRONT_AND_BACK:
          return BUFFER_FRONT_LEFT;
+      case GL_AUX0:
       case GL_AUX1:
       case GL_AUX2:
       case GL_AUX3:
index eef9106..a8008fa 100644 (file)
@@ -305,7 +305,6 @@ _mesa_initialize_visual( struct gl_config *vis,
    vis->accumBlueBits  = accumBlueBits;
    vis->accumAlphaBits = accumAlphaBits;
 
-   vis->numAuxBuffers = 0;
    vis->sampleBuffers = numSamples > 0 ? 1 : 0;
    vis->samples = numSamples;
 
index f12764e..92375a9 100644 (file)
@@ -374,9 +374,6 @@ get_fb0_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
          return &fb->Attachment[BUFFER_BACK_LEFT];
       return NULL;
    case GL_AUX0:
-      if (fb->Visual.numAuxBuffers == 1) {
-         return &fb->Attachment[BUFFER_AUX0];
-      }
       return NULL;
 
    /* Page 336 (page 352 of the PDF) of the OpenGL 3.0 spec says:
index eb0170f..c451126 100644 (file)
@@ -701,7 +701,7 @@ descriptor=[
   [ "ALPHA_SCALE", "CONTEXT_FLOAT(Pixel.AlphaScale), NO_EXTRA" ],
   [ "ATTRIB_STACK_DEPTH", "CONTEXT_INT(AttribStackDepth), NO_EXTRA" ],
   [ "AUTO_NORMAL", "CONTEXT_BOOL(Eval.AutoNormal), NO_EXTRA" ],
-  [ "AUX_BUFFERS", "BUFFER_INT(Visual.numAuxBuffers), NO_EXTRA" ],
+  [ "AUX_BUFFERS", "CONST(0), NO_EXTRA" ],
   [ "BLUE_BIAS", "CONTEXT_FLOAT(Pixel.BlueBias), NO_EXTRA" ],
   [ "BLUE_SCALE", "CONTEXT_FLOAT(Pixel.BlueScale), NO_EXTRA" ],
   [ "CLIENT_ATTRIB_STACK_DEPTH", "CONTEXT_INT(ClientAttribStackDepth), NO_EXTRA" ],
index d0a1dc4..b78fb26 100644 (file)
@@ -122,8 +122,6 @@ typedef enum
    BUFFER_DEPTH,
    BUFFER_STENCIL,
    BUFFER_ACCUM,
-   /* optional aux buffer */
-   BUFFER_AUX0,
    /* generic renderbuffers */
    BUFFER_COLOR0,
    BUFFER_COLOR1,
index e204688..33f87b2 100644 (file)
@@ -119,10 +119,6 @@ _mesa_varying_slot_in_fs(gl_varying_slot slot)
 #define BUFFER_BIT_BACK_LEFT    (1 << BUFFER_BACK_LEFT)
 #define BUFFER_BIT_FRONT_RIGHT  (1 << BUFFER_FRONT_RIGHT)
 #define BUFFER_BIT_BACK_RIGHT   (1 << BUFFER_BACK_RIGHT)
-#define BUFFER_BIT_AUX0         (1 << BUFFER_AUX0)
-#define BUFFER_BIT_AUX1         (1 << BUFFER_AUX1)
-#define BUFFER_BIT_AUX2         (1 << BUFFER_AUX2)
-#define BUFFER_BIT_AUX3         (1 << BUFFER_AUX3)
 #define BUFFER_BIT_DEPTH        (1 << BUFFER_DEPTH)
 #define BUFFER_BIT_STENCIL      (1 << BUFFER_STENCIL)
 #define BUFFER_BIT_ACCUM        (1 << BUFFER_ACCUM)
@@ -142,7 +138,6 @@ _mesa_varying_slot_in_fs(gl_varying_slot slot)
                             BUFFER_BIT_BACK_LEFT | \
                             BUFFER_BIT_FRONT_RIGHT | \
                             BUFFER_BIT_BACK_RIGHT | \
-                            BUFFER_BIT_AUX0 | \
                             BUFFER_BIT_COLOR0 | \
                             BUFFER_BIT_COLOR1 | \
                             BUFFER_BIT_COLOR2 | \
@@ -175,8 +170,6 @@ struct gl_config
    GLint depthBits;
    GLint stencilBits;
 
-   GLint numAuxBuffers;
-
    /* EXT_visual_rating / GLX 1.2 */
    GLint visualRating;
 
index e409be3..91a19f1 100644 (file)
@@ -290,8 +290,7 @@ _swrast_Clear(struct gl_context *ctx, GLbitfield buffers)
         BUFFER_BIT_BACK_RIGHT |
         BUFFER_BIT_DEPTH |
         BUFFER_BIT_STENCIL |
-        BUFFER_BIT_ACCUM |
-         BUFFER_BIT_AUX0;
+        BUFFER_BIT_ACCUM;
       assert((buffers & (~legalBits)) == 0);
    }
 #endif
index 27e2fce..22122c2 100644 (file)
@@ -429,50 +429,6 @@ add_accum_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
 
 
 /**
- * Add a software-based aux renderbuffer to the given framebuffer.
- * This is a helper routine for device drivers when creating a
- * window system framebuffer (not a user-created render/framebuffer).
- * Once this function is called, you can basically forget about this
- * renderbuffer; core Mesa will handle all the buffer management and
- * rendering!
- *
- * NOTE: color-index aux buffers not supported.
- */
-static GLboolean
-add_aux_renderbuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
-                      GLuint colorBits, GLuint numBuffers)
-{
-   GLuint i;
-
-   if (colorBits > 16) {
-      _mesa_problem(ctx,
-                    "Unsupported colorBits in add_aux_renderbuffers");
-      return GL_FALSE;
-   }
-
-   assert(numBuffers <= MAX_AUX_BUFFERS);
-
-   for (i = 0; i < numBuffers; i++) {
-      struct gl_renderbuffer *rb = _swrast_new_soft_renderbuffer(ctx, 0);
-
-      assert(fb->Attachment[BUFFER_AUX0 + i].Renderbuffer == NULL);
-
-      if (!rb) {
-         _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating aux buffer");
-         return GL_FALSE;
-      }
-
-      assert (colorBits <= 8);
-      rb->InternalFormat = GL_RGBA;
-
-      rb->AllocStorage = soft_renderbuffer_storage;
-      _mesa_attach_and_own_rb(fb, BUFFER_AUX0 + i, rb);
-   }
-   return GL_TRUE;
-}
-
-
-/**
  * Create/attach software-based renderbuffers to the given framebuffer.
  * This is a helper routine for device drivers.  Drivers can just as well
  * call the individual _mesa_add_*_renderbuffer() routines directly.
@@ -483,8 +439,7 @@ _swrast_add_soft_renderbuffers(struct gl_framebuffer *fb,
                                GLboolean depth,
                                GLboolean stencil,
                                GLboolean accum,
-                               GLboolean alpha,
-                               GLboolean aux)
+                               GLboolean alpha)
 {
    GLboolean frontLeft = GL_TRUE;
    GLboolean backLeft = fb->Visual.doubleBufferMode;
@@ -536,18 +491,6 @@ _swrast_add_soft_renderbuffers(struct gl_framebuffer *fb,
                              fb->Visual.accumBlueBits,
                              fb->Visual.accumAlphaBits);
    }
-
-   if (aux) {
-      assert(fb->Visual.numAuxBuffers > 0);
-      add_aux_renderbuffers(NULL, fb, fb->Visual.redBits,
-                            fb->Visual.numAuxBuffers);
-   }
-
-#if 0
-   if (multisample) {
-      /* maybe someday */
-   }
-#endif
 }
 
 
index 9238d8a..e3b6b4d 100644 (file)
@@ -60,8 +60,7 @@ _swrast_add_soft_renderbuffers(struct gl_framebuffer *fb,
                                GLboolean depth,
                                GLboolean stencil,
                                GLboolean accum,
-                               GLboolean alpha,
-                               GLboolean aux);
+                               GLboolean alpha);
 
 
 #endif /* S_RENDERBUFFER_H */