[Mesa-dev] [PATCH 04/22] i965/meta: Silence unused parameter warnings
Ian Romanick
idr at freedesktop.org
Thu Feb 18 18:24:00 UTC 2016
On 02/18/2016 07:18 AM, Iago Toral wrote:
> On Wed, 2016-02-17 at 17:57 -0800, Ian Romanick wrote:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> The brw and irb parameters to get_buffer_rect appear to be unused since
>> the function was introduced in 2f28a0d. They seem unnecessary, and this
>> was probably just something Kristian overlooked.
>
> get_buffer_rect in brw_meta_fast_clear.c does not seem to receive an irb
> parameter and it certainly uses its rect parameter. Also, the patch does
> not modify this function at all... Maybe you did not mean to include
> this in the commit log?
>
>> The ctx parameter to brw_meta_mirror_clip_and_scissor appears to be
>> unused since e187c2f when read_fb and draw_fb were added as explicit
>> parameters to the function.
>>
>> This still leaves one unused parameter warning in the file. The 'layer'
>> parameter brw_meta_stencil_blit to is not used, but it should be. See
>> bug #93704 for more details.
>>
>> brw_meta_fast_clear.c: In function 'get_buffer_rect':
>> brw_meta_fast_clear.c:315:37: warning: unused parameter 'brw' [-Wunused-parameter]
>> get_buffer_rect(struct brw_context *brw, struct gl_framebuffer *fb,
>> ^
>
> Ah, looking a bit more into it, this comes from another patch that you
> already pushed, see 1cb49eedb52c3.
Yes... I split the original patch up, and it looks like I didn't fix the
commit message. I could have sworn that I did. It must have been some
sort of rebase fail. I'll fix it.
>> brw_meta_fast_clear.c:316:44: warning: unused parameter 'irb' [-Wunused-parameter]
>> struct intel_renderbuffer *irb, struct rect *rect)
>> ^
>> brw_meta_stencil_blit.c: In function 'setup_coord_coeff':
>> brw_meta_stencil_blit.c:271:26: warning: unused parameter 'prog' [-Wunused-parameter]
>> setup_coord_coeff(GLuint prog, GLuint multiplier, GLuint offset,
>> ^
>> brw_meta_util.c: In function 'brw_meta_mirror_clip_and_scissor':
>> brw_meta_util.c:106:59: warning: unused parameter 'ctx' [-Wunused-parameter]
>> brw_meta_mirror_clip_and_scissor(const struct gl_context *ctx,
>> ^
>>
>> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
>> Cc: Kristian Høgsberg <krh at bitplanet.net>
>> ---
>> src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 4 +---
>> src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c | 11 ++++-------
>> src/mesa/drivers/dri/i965/brw_meta_util.c | 3 +--
>> src/mesa/drivers/dri/i965/brw_meta_util.h | 3 +--
>> 4 files changed, 7 insertions(+), 14 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
>> index 05fff91..163b97a 100644
>> --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
>> @@ -135,15 +135,13 @@ try_blorp_blit(struct brw_context *brw,
>> GLfloat dstX0, GLfloat dstY0, GLfloat dstX1, GLfloat dstY1,
>> GLenum filter, GLbitfield buffer_bit)
>> {
>> - struct gl_context *ctx = &brw->ctx;
>> -
>> /* Sync up the state of window system buffers. We need to do this before
>> * we go looking for the buffers.
>> */
>> intel_prepare_render(brw);
>>
>> bool mirror_x, mirror_y;
>> - if (brw_meta_mirror_clip_and_scissor(ctx, read_fb, draw_fb,
>> + if (brw_meta_mirror_clip_and_scissor(read_fb, draw_fb,
>> &srcX0, &srcY0, &srcX1, &srcY1,
>> &dstX0, &dstY0, &dstX1, &dstY1,
>> &mirror_x, &mirror_y))
>> diff --git a/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c b/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c
>> index 5cfaec6..b1a4950 100644
>> --- a/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c
>> +++ b/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c
>> @@ -240,7 +240,7 @@ setup_drawing_rect(GLuint prog, const struct blit_dims *dims)
>> * src_x = src_x0 + (dst_x1 -dst_x - 0.5) * scale
>> */
>> static void
>> -setup_coord_coeff(GLuint prog, GLuint multiplier, GLuint offset,
>> +setup_coord_coeff(GLuint multiplier, GLuint offset,
>> int src_0, int src_1, int dst_0, int dst_1, bool mirror)
>> {
>> const float scale = ((float)(src_1 - src_0)) / (dst_1 - dst_0);
>> @@ -266,14 +266,12 @@ setup_coord_coeff(GLuint prog, GLuint multiplier, GLuint offset,
>> static void
>> setup_coord_transform(GLuint prog, const struct blit_dims *dims)
>> {
>> - setup_coord_coeff(prog,
>> - _mesa_GetUniformLocation(prog, "src_x_scale"),
>> + setup_coord_coeff(_mesa_GetUniformLocation(prog, "src_x_scale"),
>> _mesa_GetUniformLocation(prog, "src_x_off"),
>> dims->src_x0, dims->src_x1, dims->dst_x0, dims->dst_x1,
>> dims->mirror_x);
>>
>> - setup_coord_coeff(prog,
>> - _mesa_GetUniformLocation(prog, "src_y_scale"),
>> + setup_coord_coeff(_mesa_GetUniformLocation(prog, "src_y_scale"),
>> _mesa_GetUniformLocation(prog, "src_y_off"),
>> dims->src_y0, dims->src_y1, dims->dst_y0, dims->dst_y1,
>> dims->mirror_y);
>> @@ -303,7 +301,6 @@ setup_program(struct brw_context *brw, bool msaa_tex)
>> "i965 stencil blit",
>> prog_id);
>> ralloc_free(fs_source);
>> -
>> return *prog_id;
>> }
>>
>> @@ -502,7 +499,7 @@ brw_meta_fbo_stencil_blit(struct brw_context *brw,
>> dst_mt = dst_mt->stencil_mt;
>>
>> bool mirror_x, mirror_y;
>> - if (brw_meta_mirror_clip_and_scissor(ctx, read_fb, draw_fb,
>> + if (brw_meta_mirror_clip_and_scissor(read_fb, draw_fb,
>> &src_x0, &src_y0, &src_x1, &src_y1,
>> &dst_x0, &dst_y0, &dst_x1, &dst_y1,
>> &mirror_x, &mirror_y))
>> diff --git a/src/mesa/drivers/dri/i965/brw_meta_util.c b/src/mesa/drivers/dri/i965/brw_meta_util.c
>> index a3b0604..07b5691 100644
>> --- a/src/mesa/drivers/dri/i965/brw_meta_util.c
>> +++ b/src/mesa/drivers/dri/i965/brw_meta_util.c
>> @@ -103,8 +103,7 @@ clip_or_scissor(bool mirror,
>> }
>>
>> bool
>> -brw_meta_mirror_clip_and_scissor(const struct gl_context *ctx,
>> - const struct gl_framebuffer *read_fb,
>> +brw_meta_mirror_clip_and_scissor(const struct gl_framebuffer *read_fb,
>> const struct gl_framebuffer *draw_fb,
>> GLfloat *srcX0, GLfloat *srcY0,
>> GLfloat *srcX1, GLfloat *srcY1,
>> diff --git a/src/mesa/drivers/dri/i965/brw_meta_util.h b/src/mesa/drivers/dri/i965/brw_meta_util.h
>> index dc9dff2..d8fd3a1 100644
>> --- a/src/mesa/drivers/dri/i965/brw_meta_util.h
>> +++ b/src/mesa/drivers/dri/i965/brw_meta_util.h
>> @@ -32,8 +32,7 @@ extern "C" {
>> #endif
>>
>> bool
>> -brw_meta_mirror_clip_and_scissor(const struct gl_context *ctx,
>> - const struct gl_framebuffer *read_fb,
>> +brw_meta_mirror_clip_and_scissor(const struct gl_framebuffer *read_fb,
>> const struct gl_framebuffer *draw_fb,
>> GLfloat *srcX0, GLfloat *srcY0,
>> GLfloat *srcX1, GLfloat *srcY1,
More information about the mesa-dev
mailing list