mesa: Remove the pretense of aux buffer support

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>
This commit is contained in:
Adam Jackson
2021-03-24 12:40:51 -04:00
committed by Marge Bot
parent 78dfab95b8
commit d21b8afa3d
16 changed files with 10 additions and 94 deletions

View 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;

View 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",

View 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;

View 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",

View 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;

View 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;

View File

@@ -746,8 +746,7 @@ radeonCreateBuffer( __DRIscreen *driScrnPriv,
swDepth,
swStencil,
swAccum,
swAlpha,
GL_FALSE /* aux */);
swAlpha);
driDrawPriv->driverPrivate = (void *) rfb;
return (driDrawPriv->driverPrivate != NULL);

View 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:

View 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;

View 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:

View 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" ],

View File

@@ -122,8 +122,6 @@ typedef enum
BUFFER_DEPTH,
BUFFER_STENCIL,
BUFFER_ACCUM,
/* optional aux buffer */
BUFFER_AUX0,
/* generic renderbuffers */
BUFFER_COLOR0,
BUFFER_COLOR1,

View 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;

View 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

View File

@@ -428,50 +428,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
@@ -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
}

View 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 */