[Mesa-dev] [PATCH 2/3] mesa: drop the buffer mode param from the DrawBuffer driver function

Timothy Arceri tarceri at itsqueeze.com
Sat Apr 14 04:45:22 UTC 2018


No drivers used it.
---
 src/mesa/drivers/common/driverfuncs.c        | 2 +-
 src/mesa/drivers/dri/i915/intel_buffers.c    | 2 +-
 src/mesa/drivers/dri/i965/intel_buffers.c    | 2 +-
 src/mesa/drivers/dri/nouveau/nouveau_state.c | 2 +-
 src/mesa/main/buffers.c                      | 7 ++-----
 src/mesa/main/dd.h                           | 2 +-
 src/mesa/state_tracker/st_cb_fbo.c           | 4 +---
 7 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index b7ac2b5b434..e783262773e 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -306,5 +306,5 @@ _mesa_init_driver_state(struct gl_context *ctx)
                                  ctx->Stencil.ZPassFunc[1]);
 
 
-   ctx->Driver.DrawBuffer(ctx, ctx->Color.DrawBuffer[0]);
+   ctx->Driver.DrawBuffer(ctx);
 }
diff --git a/src/mesa/drivers/dri/i915/intel_buffers.c b/src/mesa/drivers/dri/i915/intel_buffers.c
index 386e032443a..26ba3df7d7a 100644
--- a/src/mesa/drivers/dri/i915/intel_buffers.c
+++ b/src/mesa/drivers/dri/i915/intel_buffers.c
@@ -53,7 +53,7 @@ intel_check_front_buffer_rendering(struct intel_context *intel)
 }
 
 static void
-intelDrawBuffer(struct gl_context * ctx, GLenum mode)
+intelDrawBuffer(struct gl_context *ctx)
 {
    if (_mesa_is_front_buffer_drawing(ctx->DrawBuffer)) {
       struct intel_context *const intel = intel_context(ctx);
diff --git a/src/mesa/drivers/dri/i965/intel_buffers.c b/src/mesa/drivers/dri/i965/intel_buffers.c
index fd522cc4f4d..dae56e3362c 100644
--- a/src/mesa/drivers/dri/i965/intel_buffers.c
+++ b/src/mesa/drivers/dri/i965/intel_buffers.c
@@ -33,7 +33,7 @@
 #include "main/renderbuffer.h"
 
 static void
-intelDrawBuffer(struct gl_context * ctx, GLenum mode)
+intelDrawBuffer(struct gl_context *ctx)
 {
    if (_mesa_is_front_buffer_drawing(ctx->DrawBuffer)) {
       struct brw_context *const brw = brw_context(ctx);
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c
index 91ca95b5907..a05c8be854a 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_state.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_state.c
@@ -115,7 +115,7 @@ nouveau_read_buffer(struct gl_context *ctx, GLenum buffer)
 }
 
 static void
-nouveau_draw_buffer(struct gl_context *ctx, GLenum buffers)
+nouveau_draw_buffer(struct gl_context *ctx)
 {
 	nouveau_validate_framebuffer(ctx);
 	context_dirty(ctx, FRAMEBUFFER);
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 7bb5725d085..53dae410253 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -305,7 +305,7 @@ draw_buffer(struct gl_context *ctx, struct gl_framebuffer *fb,
    /* Call device driver function only if fb is the bound draw buffer */
    if (fb == ctx->DrawBuffer) {
       if (ctx->Driver.DrawBuffer)
-         ctx->Driver.DrawBuffer(ctx, buffer);
+         ctx->Driver.DrawBuffer(ctx);
    }
 }
 
@@ -580,13 +580,10 @@ draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb, GLsizei n,
 
    /*
     * Call device driver function if fb is the bound draw buffer.
-    * Note that n can be equal to 0,
-    * in which case we don't want to reference buffers[0], which
-    * may not be valid.
     */
    if (fb == ctx->DrawBuffer) {
       if (ctx->Driver.DrawBuffer)
-         ctx->Driver.DrawBuffer(ctx, n > 0 ? buffers[0] : GL_NONE);
+         ctx->Driver.DrawBuffer(ctx);
    }
 }
 
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index d85d89ef50c..a110e928cda 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -611,7 +611,7 @@ struct dd_function_table {
    /** Specify mapping of depth values from NDC to window coordinates */
    void (*DepthRange)(struct gl_context *ctx);
    /** Specify the current buffer for writing */
-   void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer );
+   void (*DrawBuffer)( struct gl_context *ctx);
    /** Enable or disable server-side gl capabilities */
    void (*Enable)(struct gl_context *ctx, GLenum cap, GLboolean state);
    /** Specify fog parameters */
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 696a08fd65b..5691097ae82 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -714,13 +714,11 @@ st_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
  * created FBOs.
  */
 static void
-st_DrawBuffer(struct gl_context *ctx, GLenum buffer)
+st_DrawBuffer(struct gl_context *ctx)
 {
    struct st_context *st = st_context(ctx);
    struct gl_framebuffer *fb = ctx->DrawBuffer;
 
-   (void) buffer;
-
    if (_mesa_is_winsys_fbo(fb)) {
       GLuint i;
       /* add the renderbuffers on demand */
-- 
2.17.0



More information about the mesa-dev mailing list