[Mesa-dev] [PATCH] r600: fix buffer resinfo opcode translation.

Roland Scheidegger sroland at vmware.com
Thu Feb 1 01:18:58 UTC 2018


Ah I see now how that's supposed to work...
Previous to adding GET_BUFFER_RESINFO the op was just a fixed zero, and
the op for this is the same on eg/cm (and we should not hit it with
r600). But indeed that looks more like the code elsewhere...

Reviewed-by: Roland Scheidegger <sroland at vmware.com>

Am 01.02.2018 um 01:33 schrieb Dave Airlie:
> From: Dave Airlie <airlied at redhat.com>
> 
> The vtx operations never got translated, so things worked by
> 0 being equal to 0, translate them so we can use the proper buffer
> resinfo code.
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/gallium/drivers/r600/r600_asm.c    | 2 +-
>  src/gallium/drivers/r600/r600_shader.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
> index 92c2bdf..21d069d 100644
> --- a/src/gallium/drivers/r600/r600_asm.c
> +++ b/src/gallium/drivers/r600/r600_asm.c
> @@ -1510,7 +1510,7 @@ int cm_bytecode_add_cf_end(struct r600_bytecode *bc)
>  /* common to all 3 families */
>  static int r600_bytecode_vtx_build(struct r600_bytecode *bc, struct r600_bytecode_vtx *vtx, unsigned id)
>  {
> -	bc->bytecode[id] = S_SQ_VTX_WORD0_VTX_INST(vtx->op) |
> +	bc->bytecode[id] = S_SQ_VTX_WORD0_VTX_INST(r600_isa_fetch_opcode(bc->isa->hw_class, vtx->op)) |
>  			S_SQ_VTX_WORD0_BUFFER_ID(vtx->buffer_id) |
>  			S_SQ_VTX_WORD0_FETCH_TYPE(vtx->fetch_type) |
>  			S_SQ_VTX_WORD0_SRC_GPR(vtx->src_gpr) |
> diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
> index be02412..46e2d08 100644
> --- a/src/gallium/drivers/r600/r600_shader.c
> +++ b/src/gallium/drivers/r600/r600_shader.c
> @@ -6939,7 +6939,7 @@ static int r600_do_buffer_txq(struct r600_shader_ctx *ctx, int reg_idx, int offs
>  	} else {
>  		struct r600_bytecode_vtx vtx;
>  		memset(&vtx, 0, sizeof(vtx));
> -		vtx.op = FETCH_OP_GDS_MIN_UINT; /* aka GET_BUFFER_RESINFO */
> +		vtx.op = FETCH_OP_GET_BUFFER_RESINFO;
>  		vtx.buffer_id = id + R600_MAX_CONST_BUFFERS;
>  		vtx.fetch_type = SQ_VTX_FETCH_NO_INDEX_OFFSET;
>  		vtx.src_gpr = 0;
> 



More information about the mesa-dev mailing list