[Mesa-dev] [PATCH 08/10] i965/vec4: Do not mark used surfaces in VS_OPCODE_GET_BUFFER_SIZE

Francisco Jerez currojerez at riseup.net
Fri Oct 30 06:41:03 PDT 2015


Iago Toral Quiroga <itoral at igalia.com> writes:

> Do it in the visitor, like we do for other opcodes.
> ---
>  src/mesa/drivers/dri/i965/brw_vec4_generator.cpp | 2 --
>  src/mesa/drivers/dri/i965/brw_vec4_nir.cpp       | 6 ++++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
> index 8150c9a..82174f7 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
> @@ -945,8 +945,6 @@ generate_get_buffer_size(struct brw_codegen *p,
>                inst->header_size > 0,
>                BRW_SAMPLER_SIMD_MODE_SIMD4X2,
>                BRW_SAMPLER_RETURN_FORMAT_SINT32);
> -
> -   brw_mark_surface_used(&prog_data->base, surf_index.dw1.ud);
>  }
>  
>  static void
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
> index e6d4c0c..dd35489 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
> @@ -427,8 +427,8 @@ vec4_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
>        nir_const_value *const_uniform_block = nir_src_as_const_value(instr->src[0]);
>        unsigned ssbo_index = const_uniform_block ? const_uniform_block->u[0] : 0;
>  
> -      src_reg surf_index = src_reg(prog_data->base.binding_table.ssbo_start +
> -                                   ssbo_index);
> +      unsigned index = prog_data->base.binding_table.ssbo_start + ssbo_index;
> +      src_reg surf_index = src_reg(index);

"const unsigned index" and get rid of the useless temporary.  With that fixed:

Reviewed-by: Francisco Jerez <currojerez at riseup.net>

>        dst_reg result_dst = get_nir_dest(instr->dest);
>        vec4_instruction *inst = new(mem_ctx)
>           vec4_instruction(VS_OPCODE_GET_BUFFER_SIZE, result_dst);
> @@ -444,6 +444,8 @@ vec4_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
>        emit(MOV(dst_reg(MRF, param_base, glsl_type::int_type, writemask), lod));
>  
>        emit(inst);
> +
> +      brw_mark_surface_used(&prog_data->base, index);
>        break;
>     }
>  
> -- 
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151030/2c64c334/attachment.sig>


More information about the mesa-dev mailing list