Re: [Mesa-dev] [PATCH 1/3] mesa: merge the driver functions DrawBuffers and DrawBuffer
On 26/04/18 23:41, Ian Romanick wrote: On 04/24/2018 07:00 PM, Timothy Arceri wrote: On 25/04/18 07:34, Ian Romanick wrote: On 04/24/2018 09:28 AM, Ian Romanick wrote: On 04/23/2018 08:23 PM, Timothy Arceri wrote: On 24/04/18 10:13, Dieter Nützel wrote: Hello Timo, what about 2 and 3, #1 landed. It turns out the old radeon classic drivers do make use of the param dropped in patch 2 so I've decided to drop that patch, although the use of that param might be a bug as the intel drivers changed their behavior to fix a bug (however it's not a simple change). This sounds familiar, and I might have a patch for that. Let me root around in my git branches to see if I can find it... I'm definitely in favor of cleaning up a bunch of the dd interfaces. I sent these to the list in September 2015: https://patchwork.freedesktop.org/patch/60786/ https://patchwork.freedesktop.org/patch/60794/ For those two patches: Acked-by: Timothy ArceriPushed. That should unblock these patches. :) Thanks. I've pushed the api clean-up patch. I don't recall what testing I did exactly, and I didn't put anything useful in the commit message. :( I'd still like to push patch 3 but it's tripping up some old hardware in Intels CI system. I'm not sure whats going on yet. Dieter ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] mesa: merge the driver functions DrawBuffers and DrawBuffer
On 04/24/2018 07:00 PM, Timothy Arceri wrote: > > > On 25/04/18 07:34, Ian Romanick wrote: >> On 04/24/2018 09:28 AM, Ian Romanick wrote: >>> On 04/23/2018 08:23 PM, Timothy Arceri wrote: On 24/04/18 10:13, Dieter Nützel wrote: > Hello Timo, > > what about 2 and 3, #1 landed. It turns out the old radeon classic drivers do make use of the param dropped in patch 2 so I've decided to drop that patch, although the use of that param might be a bug as the intel drivers changed their behavior to fix a bug (however it's not a simple change). >>> >>> This sounds familiar, and I might have a patch for that. Let me root >>> around in my git branches to see if I can find it... I'm definitely in >>> favor of cleaning up a bunch of the dd interfaces. >> >> I sent these to the list in September 2015: >> >> https://patchwork.freedesktop.org/patch/60786/ >> https://patchwork.freedesktop.org/patch/60794/ > > For those two patches: > > Acked-by: Timothy ArceriPushed. That should unblock these patches. :) >> I don't recall what testing I did exactly, and I didn't put anything >> useful in the commit message. :( >> I'd still like to push patch 3 but it's tripping up some old hardware in Intels CI system. I'm not sure whats going on yet. > Dieter >>> ___ >>> mesa-dev mailing list >>> mesa-dev@lists.freedesktop.org >>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] mesa: merge the driver functions DrawBuffers and DrawBuffer
On 25/04/18 07:34, Ian Romanick wrote: On 04/24/2018 09:28 AM, Ian Romanick wrote: On 04/23/2018 08:23 PM, Timothy Arceri wrote: On 24/04/18 10:13, Dieter Nützel wrote: Hello Timo, what about 2 and 3, #1 landed. It turns out the old radeon classic drivers do make use of the param dropped in patch 2 so I've decided to drop that patch, although the use of that param might be a bug as the intel drivers changed their behavior to fix a bug (however it's not a simple change). This sounds familiar, and I might have a patch for that. Let me root around in my git branches to see if I can find it... I'm definitely in favor of cleaning up a bunch of the dd interfaces. I sent these to the list in September 2015: https://patchwork.freedesktop.org/patch/60786/ https://patchwork.freedesktop.org/patch/60794/ For those two patches: Acked-by: Timothy ArceriI don't recall what testing I did exactly, and I didn't put anything useful in the commit message. :( I'd still like to push patch 3 but it's tripping up some old hardware in Intels CI system. I'm not sure whats going on yet. Dieter ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] mesa: merge the driver functions DrawBuffers and DrawBuffer
On 04/24/2018 09:28 AM, Ian Romanick wrote: > On 04/23/2018 08:23 PM, Timothy Arceri wrote: >> On 24/04/18 10:13, Dieter Nützel wrote: >>> Hello Timo, >>> >>> what about 2 and 3, #1 landed. >> >> It turns out the old radeon classic drivers do make use of the param >> dropped in patch 2 so I've decided to drop that patch, although the use >> of that param might be a bug as the intel drivers changed their behavior >> to fix a bug (however it's not a simple change). > > This sounds familiar, and I might have a patch for that. Let me root > around in my git branches to see if I can find it... I'm definitely in > favor of cleaning up a bunch of the dd interfaces. I sent these to the list in September 2015: https://patchwork.freedesktop.org/patch/60786/ https://patchwork.freedesktop.org/patch/60794/ I don't recall what testing I did exactly, and I didn't put anything useful in the commit message. :( >> I'd still like to push patch 3 but it's tripping up some old hardware in >> Intels CI system. I'm not sure whats going on yet. >> >>> Dieter > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] mesa: merge the driver functions DrawBuffers and DrawBuffer
On 04/23/2018 08:23 PM, Timothy Arceri wrote: > On 24/04/18 10:13, Dieter Nützel wrote: >> Hello Timo, >> >> what about 2 and 3, #1 landed. > > It turns out the old radeon classic drivers do make use of the param > dropped in patch 2 so I've decided to drop that patch, although the use > of that param might be a bug as the intel drivers changed their behavior > to fix a bug (however it's not a simple change). This sounds familiar, and I might have a patch for that. Let me root around in my git branches to see if I can find it... I'm definitely in favor of cleaning up a bunch of the dd interfaces. > I'd still like to push patch 3 but it's tripping up some old hardware in > Intels CI system. I'm not sure whats going on yet. > >> Dieter ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/3] mesa: merge the driver functions DrawBuffers and DrawBuffer
On 24/04/18 10:13, Dieter Nützel wrote: Hello Timo, what about 2 and 3, #1 landed. It turns out the old radeon classic drivers do make use of the param dropped in patch 2 so I've decided to drop that patch, although the use of that param might be a bug as the intel drivers changed their behavior to fix a bug (however it's not a simple change). I'd still like to push patch 3 but it's tripping up some old hardware in Intels CI system. I'm not sure whats going on yet. Dieter Am 15.04.2018 18:16, schrieb Brian Paul: The series looks OK to me. Reviewed-by: Brian PaulOn 04/13/2018 10:45 PM, Timothy Arceri wrote: The extra params we unused by the drivers that used DrawBuffers. --- src/mesa/drivers/common/driverfuncs.c | 1 - src/mesa/drivers/dri/nouveau/nouveau_state.c | 4 ++-- src/mesa/main/buffers.c | 8 ++-- src/mesa/main/dd.h | 2 -- src/mesa/state_tracker/st_cb_fbo.c | 9 - 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 11134b69e94..b7ac2b5b434 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -134,7 +134,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->ColorMaterial = NULL; driver->CullFace = NULL; driver->DrawBuffer = NULL; - driver->DrawBuffers = NULL; driver->FrontFace = NULL; driver->DepthFunc = NULL; driver->DepthMask = NULL; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c index e2b01043675..91ca95b5907 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_buffers(struct gl_context *ctx, GLsizei n, const GLenum *buffers) +nouveau_draw_buffer(struct gl_context *ctx, GLenum buffers) { nouveau_validate_framebuffer(ctx); context_dirty(ctx, FRAMEBUFFER); @@ -519,7 +519,7 @@ nouveau_state_init(struct gl_context *ctx) ctx->Driver.DepthFunc = nouveau_depth_func; ctx->Driver.DepthMask = nouveau_depth_mask; ctx->Driver.ReadBuffer = nouveau_read_buffer; - ctx->Driver.DrawBuffers = nouveau_draw_buffers; + ctx->Driver.DrawBuffer = nouveau_draw_buffer; ctx->Driver.Enable = nouveau_enable; ctx->Driver.Fogfv = nouveau_fog; ctx->Driver.Lightfv = nouveau_light; diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 5492227de08..7bb5725d085 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -304,9 +304,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.DrawBuffers) - ctx->Driver.DrawBuffers(ctx, 1, ); - else if (ctx->Driver.DrawBuffer) + if (ctx->Driver.DrawBuffer) ctx->Driver.DrawBuffer(ctx, buffer); } } @@ -587,9 +585,7 @@ draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb, GLsizei n, * may not be valid. */ if (fb == ctx->DrawBuffer) { - if (ctx->Driver.DrawBuffers) - ctx->Driver.DrawBuffers(ctx, n, buffers); - else if (ctx->Driver.DrawBuffer) + if (ctx->Driver.DrawBuffer) ctx->Driver.DrawBuffer(ctx, n > 0 ? buffers[0] : GL_NONE); } } diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 64ddd818835..d85d89ef50c 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -612,8 +612,6 @@ struct dd_function_table { void (*DepthRange)(struct gl_context *ctx); /** Specify the current buffer for writing */ void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer ); - /** Specify the buffers for writing for fragment programs*/ - void (*DrawBuffers)(struct gl_context *ctx, GLsizei n, const GLenum *buffers); /** 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 f859133e399..696a08fd65b 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -714,13 +714,12 @@ st_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) * created FBOs. */ static void -st_DrawBuffers(struct gl_context *ctx, GLsizei count, const GLenum *buffers) +st_DrawBuffer(struct gl_context *ctx, GLenum buffer) { struct st_context *st = st_context(ctx); struct gl_framebuffer *fb = ctx->DrawBuffer; - (void) count; - (void) buffers; + (void) buffer; if (_mesa_is_winsys_fbo(fb)) { GLuint i; @@ -737,7 +736,7 @@ st_DrawBuffers(struct
Re: [Mesa-dev] [PATCH 1/3] mesa: merge the driver functions DrawBuffers and DrawBuffer
Hello Timo, what about 2 and 3, #1 landed. Dieter Am 15.04.2018 18:16, schrieb Brian Paul: The series looks OK to me. Reviewed-by: Brian PaulOn 04/13/2018 10:45 PM, Timothy Arceri wrote: The extra params we unused by the drivers that used DrawBuffers. --- src/mesa/drivers/common/driverfuncs.c| 1 - src/mesa/drivers/dri/nouveau/nouveau_state.c | 4 ++-- src/mesa/main/buffers.c | 8 ++-- src/mesa/main/dd.h | 2 -- src/mesa/state_tracker/st_cb_fbo.c | 9 - 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 11134b69e94..b7ac2b5b434 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -134,7 +134,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->ColorMaterial = NULL; driver->CullFace = NULL; driver->DrawBuffer = NULL; - driver->DrawBuffers = NULL; driver->FrontFace = NULL; driver->DepthFunc = NULL; driver->DepthMask = NULL; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c index e2b01043675..91ca95b5907 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_buffers(struct gl_context *ctx, GLsizei n, const GLenum *buffers) +nouveau_draw_buffer(struct gl_context *ctx, GLenum buffers) { nouveau_validate_framebuffer(ctx); context_dirty(ctx, FRAMEBUFFER); @@ -519,7 +519,7 @@ nouveau_state_init(struct gl_context *ctx) ctx->Driver.DepthFunc = nouveau_depth_func; ctx->Driver.DepthMask = nouveau_depth_mask; ctx->Driver.ReadBuffer = nouveau_read_buffer; - ctx->Driver.DrawBuffers = nouveau_draw_buffers; + ctx->Driver.DrawBuffer = nouveau_draw_buffer; ctx->Driver.Enable = nouveau_enable; ctx->Driver.Fogfv = nouveau_fog; ctx->Driver.Lightfv = nouveau_light; diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 5492227de08..7bb5725d085 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -304,9 +304,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.DrawBuffers) - ctx->Driver.DrawBuffers(ctx, 1, ); - else if (ctx->Driver.DrawBuffer) + if (ctx->Driver.DrawBuffer) ctx->Driver.DrawBuffer(ctx, buffer); } } @@ -587,9 +585,7 @@ draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb, GLsizei n, * may not be valid. */ if (fb == ctx->DrawBuffer) { - if (ctx->Driver.DrawBuffers) - ctx->Driver.DrawBuffers(ctx, n, buffers); - else if (ctx->Driver.DrawBuffer) + if (ctx->Driver.DrawBuffer) ctx->Driver.DrawBuffer(ctx, n > 0 ? buffers[0] : GL_NONE); } } diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 64ddd818835..d85d89ef50c 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -612,8 +612,6 @@ struct dd_function_table { void (*DepthRange)(struct gl_context *ctx); /** Specify the current buffer for writing */ void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer ); - /** Specify the buffers for writing for fragment programs*/ - void (*DrawBuffers)(struct gl_context *ctx, GLsizei n, const GLenum *buffers); /** 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 f859133e399..696a08fd65b 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -714,13 +714,12 @@ st_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) * created FBOs. */ static void -st_DrawBuffers(struct gl_context *ctx, GLsizei count, const GLenum *buffers) +st_DrawBuffer(struct gl_context *ctx, GLenum buffer) { struct st_context *st = st_context(ctx); struct gl_framebuffer *fb = ctx->DrawBuffer; - (void) count; - (void) buffers; + (void) buffer; if (_mesa_is_winsys_fbo(fb)) { GLuint i; @@ -737,7 +736,7 @@ st_DrawBuffers(struct gl_context *ctx, GLsizei count, const GLenum *buffers) /** - * Called via glReadBuffer. As with st_DrawBuffers, we use this function + * Called via glReadBuffer. As with st_DrawBuffer, we use this function * to check if we need to allocate a renderbuffer on demand. */ static void @@ -869,7 +868,7 @@ st_init_fbo_functions(struct dd_function_table *functions) functions->FinishRenderTexture
Re: [Mesa-dev] [PATCH 1/3] mesa: merge the driver functions DrawBuffers and DrawBuffer
The series looks OK to me. Reviewed-by: Brian PaulOn 04/13/2018 10:45 PM, Timothy Arceri wrote: The extra params we unused by the drivers that used DrawBuffers. --- src/mesa/drivers/common/driverfuncs.c| 1 - src/mesa/drivers/dri/nouveau/nouveau_state.c | 4 ++-- src/mesa/main/buffers.c | 8 ++-- src/mesa/main/dd.h | 2 -- src/mesa/state_tracker/st_cb_fbo.c | 9 - 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 11134b69e94..b7ac2b5b434 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -134,7 +134,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->ColorMaterial = NULL; driver->CullFace = NULL; driver->DrawBuffer = NULL; - driver->DrawBuffers = NULL; driver->FrontFace = NULL; driver->DepthFunc = NULL; driver->DepthMask = NULL; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c index e2b01043675..91ca95b5907 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_buffers(struct gl_context *ctx, GLsizei n, const GLenum *buffers) +nouveau_draw_buffer(struct gl_context *ctx, GLenum buffers) { nouveau_validate_framebuffer(ctx); context_dirty(ctx, FRAMEBUFFER); @@ -519,7 +519,7 @@ nouveau_state_init(struct gl_context *ctx) ctx->Driver.DepthFunc = nouveau_depth_func; ctx->Driver.DepthMask = nouveau_depth_mask; ctx->Driver.ReadBuffer = nouveau_read_buffer; - ctx->Driver.DrawBuffers = nouveau_draw_buffers; + ctx->Driver.DrawBuffer = nouveau_draw_buffer; ctx->Driver.Enable = nouveau_enable; ctx->Driver.Fogfv = nouveau_fog; ctx->Driver.Lightfv = nouveau_light; diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 5492227de08..7bb5725d085 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -304,9 +304,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.DrawBuffers) - ctx->Driver.DrawBuffers(ctx, 1, ); - else if (ctx->Driver.DrawBuffer) + if (ctx->Driver.DrawBuffer) ctx->Driver.DrawBuffer(ctx, buffer); } } @@ -587,9 +585,7 @@ draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb, GLsizei n, * may not be valid. */ if (fb == ctx->DrawBuffer) { - if (ctx->Driver.DrawBuffers) - ctx->Driver.DrawBuffers(ctx, n, buffers); - else if (ctx->Driver.DrawBuffer) + if (ctx->Driver.DrawBuffer) ctx->Driver.DrawBuffer(ctx, n > 0 ? buffers[0] : GL_NONE); } } diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 64ddd818835..d85d89ef50c 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -612,8 +612,6 @@ struct dd_function_table { void (*DepthRange)(struct gl_context *ctx); /** Specify the current buffer for writing */ void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer ); - /** Specify the buffers for writing for fragment programs*/ - void (*DrawBuffers)(struct gl_context *ctx, GLsizei n, const GLenum *buffers); /** 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 f859133e399..696a08fd65b 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -714,13 +714,12 @@ st_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) * created FBOs. */ static void -st_DrawBuffers(struct gl_context *ctx, GLsizei count, const GLenum *buffers) +st_DrawBuffer(struct gl_context *ctx, GLenum buffer) { struct st_context *st = st_context(ctx); struct gl_framebuffer *fb = ctx->DrawBuffer; - (void) count; - (void) buffers; + (void) buffer; if (_mesa_is_winsys_fbo(fb)) { GLuint i; @@ -737,7 +736,7 @@ st_DrawBuffers(struct gl_context *ctx, GLsizei count, const GLenum *buffers) /** - * Called via glReadBuffer. As with st_DrawBuffers, we use this function + * Called via glReadBuffer. As with st_DrawBuffer, we use this function * to check if we need to allocate a renderbuffer on demand. */ static void @@ -869,7 +868,7 @@ st_init_fbo_functions(struct dd_function_table *functions) functions->FinishRenderTexture = st_finish_render_texture; functions->ValidateFramebuffer = st_validate_framebuffer; -
[Mesa-dev] [PATCH 1/3] mesa: merge the driver functions DrawBuffers and DrawBuffer
The extra params we unused by the drivers that used DrawBuffers. --- src/mesa/drivers/common/driverfuncs.c| 1 - src/mesa/drivers/dri/nouveau/nouveau_state.c | 4 ++-- src/mesa/main/buffers.c | 8 ++-- src/mesa/main/dd.h | 2 -- src/mesa/state_tracker/st_cb_fbo.c | 9 - 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 11134b69e94..b7ac2b5b434 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -134,7 +134,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->ColorMaterial = NULL; driver->CullFace = NULL; driver->DrawBuffer = NULL; - driver->DrawBuffers = NULL; driver->FrontFace = NULL; driver->DepthFunc = NULL; driver->DepthMask = NULL; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c index e2b01043675..91ca95b5907 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_buffers(struct gl_context *ctx, GLsizei n, const GLenum *buffers) +nouveau_draw_buffer(struct gl_context *ctx, GLenum buffers) { nouveau_validate_framebuffer(ctx); context_dirty(ctx, FRAMEBUFFER); @@ -519,7 +519,7 @@ nouveau_state_init(struct gl_context *ctx) ctx->Driver.DepthFunc = nouveau_depth_func; ctx->Driver.DepthMask = nouveau_depth_mask; ctx->Driver.ReadBuffer = nouveau_read_buffer; - ctx->Driver.DrawBuffers = nouveau_draw_buffers; + ctx->Driver.DrawBuffer = nouveau_draw_buffer; ctx->Driver.Enable = nouveau_enable; ctx->Driver.Fogfv = nouveau_fog; ctx->Driver.Lightfv = nouveau_light; diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 5492227de08..7bb5725d085 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -304,9 +304,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.DrawBuffers) - ctx->Driver.DrawBuffers(ctx, 1, ); - else if (ctx->Driver.DrawBuffer) + if (ctx->Driver.DrawBuffer) ctx->Driver.DrawBuffer(ctx, buffer); } } @@ -587,9 +585,7 @@ draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb, GLsizei n, * may not be valid. */ if (fb == ctx->DrawBuffer) { - if (ctx->Driver.DrawBuffers) - ctx->Driver.DrawBuffers(ctx, n, buffers); - else if (ctx->Driver.DrawBuffer) + if (ctx->Driver.DrawBuffer) ctx->Driver.DrawBuffer(ctx, n > 0 ? buffers[0] : GL_NONE); } } diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 64ddd818835..d85d89ef50c 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -612,8 +612,6 @@ struct dd_function_table { void (*DepthRange)(struct gl_context *ctx); /** Specify the current buffer for writing */ void (*DrawBuffer)( struct gl_context *ctx, GLenum buffer ); - /** Specify the buffers for writing for fragment programs*/ - void (*DrawBuffers)(struct gl_context *ctx, GLsizei n, const GLenum *buffers); /** 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 f859133e399..696a08fd65b 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -714,13 +714,12 @@ st_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) * created FBOs. */ static void -st_DrawBuffers(struct gl_context *ctx, GLsizei count, const GLenum *buffers) +st_DrawBuffer(struct gl_context *ctx, GLenum buffer) { struct st_context *st = st_context(ctx); struct gl_framebuffer *fb = ctx->DrawBuffer; - (void) count; - (void) buffers; + (void) buffer; if (_mesa_is_winsys_fbo(fb)) { GLuint i; @@ -737,7 +736,7 @@ st_DrawBuffers(struct gl_context *ctx, GLsizei count, const GLenum *buffers) /** - * Called via glReadBuffer. As with st_DrawBuffers, we use this function + * Called via glReadBuffer. As with st_DrawBuffer, we use this function * to check if we need to allocate a renderbuffer on demand. */ static void @@ -869,7 +868,7 @@ st_init_fbo_functions(struct dd_function_table *functions) functions->FinishRenderTexture = st_finish_render_texture; functions->ValidateFramebuffer = st_validate_framebuffer; - functions->DrawBuffers = st_DrawBuffers; + functions->DrawBuffer = st_DrawBuffer; functions->ReadBuffer = st_ReadBuffer; functions->MapRenderbuffer = st_MapRenderbuffer; --