[Mesa-dev] [PATCH] i965/fs: Drop "do dual source blending" generator parameter.

Kristian Høgsberg hoegsberg at gmail.com
Thu Aug 14 10:37:46 PDT 2014


On Tue, Aug 12, 2014 at 09:33:40PM -0700, Kenneth Graunke wrote:
> When dual source blending, the visitor already stores a flag in
> brw_wm_prog_data (dual_src_blend) for the state upload code to use.
> The generator also receives this, so there's no need to pass an
> additional flag.

Hooray for fewer boolean args.

Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>

> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp | 2 +-
>  src/mesa/drivers/dri/i965/brw_fs.cpp            | 2 +-
>  src/mesa/drivers/dri/i965/brw_fs.h              | 2 --
>  src/mesa/drivers/dri/i965/brw_fs_generator.cpp  | 4 +---
>  4 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
> index 5a485df..24358a8 100644
> --- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
> @@ -31,7 +31,7 @@ brw_blorp_eu_emitter::brw_blorp_eu_emitter(struct brw_context *brw,
>       generator(brw, mem_ctx,
>                 rzalloc(mem_ctx, struct brw_wm_prog_key),
>                 rzalloc(mem_ctx, struct brw_wm_prog_data),
> -               NULL, NULL, false, false, debug_flag)
> +               NULL, NULL, false, debug_flag)
>  {
>  }
>  
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index cc5ec16..8405502 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -3245,7 +3245,7 @@ brw_wm_fs_emit(struct brw_context *brw,
>     }
>  
>     const unsigned *assembly = NULL;
> -   fs_generator g(brw, mem_ctx, key, prog_data, prog, fp, v.do_dual_src,
> +   fs_generator g(brw, mem_ctx, key, prog_data, prog, fp,
>                    v.runtime_check_aads_emit, INTEL_DEBUG & DEBUG_WM);
>     assembly = g.generate_assembly(&v.instructions, simd16_instructions,
>                                    final_assembly_size);
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
> index e7a82c4..5cad504 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.h
> +++ b/src/mesa/drivers/dri/i965/brw_fs.h
> @@ -573,7 +573,6 @@ public:
>                  struct brw_wm_prog_data *prog_data,
>                  struct gl_shader_program *prog,
>                  struct gl_fragment_program *fp,
> -                bool dual_source_output,
>                  bool runtime_check_aads_emit,
>                  bool debug_flag);
>     ~fs_generator();
> @@ -684,7 +683,6 @@ private:
>     unsigned dispatch_width; /**< 8 or 16 */
>  
>     exec_list discard_halt_patches;
> -   bool dual_source_output;
>     bool runtime_check_aads_emit;
>     const bool debug_flag;
>     void *mem_ctx;
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> index 208b54f..9e260a7 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
> @@ -42,12 +42,10 @@ fs_generator::fs_generator(struct brw_context *brw,
>                             struct brw_wm_prog_data *prog_data,
>                             struct gl_shader_program *prog,
>                             struct gl_fragment_program *fp,
> -                           bool dual_source_output,
>                             bool runtime_check_aads_emit,
>                             bool debug_flag)
>  
>     : brw(brw), key(key), prog_data(prog_data), prog(prog), fp(fp),
> -     dual_source_output(dual_source_output),
>       runtime_check_aads_emit(runtime_check_aads_emit), debug_flag(debug_flag),
>       mem_ctx(mem_ctx)
>  {
> @@ -117,7 +115,7 @@ fs_generator::fire_fb_write(fs_inst *inst,
>        brw_pop_insn_state(p);
>     }
>  
> -   if (this->dual_source_output)
> +   if (prog_data->dual_src_blend)
>        msg_control = BRW_DATAPORT_RENDER_TARGET_WRITE_SIMD8_DUAL_SOURCE_SUBSPAN01;
>     else if (dispatch_width == 16)
>        msg_control = BRW_DATAPORT_RENDER_TARGET_WRITE_SIMD16_SINGLE_SOURCE;
> -- 
> 2.0.2
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list