[Mesa-dev] [PATCH] r600: fix resq for buffer images.

Roland Scheidegger sroland at vmware.com
Fri Feb 2 16:29:45 UTC 2018


Am 02.02.2018 um 08:29 schrieb Dave Airlie:
> From: Dave Airlie <airlied at redhat.com>
> 
> If this is an image buffer, we need to calculate the correct resource
> id.
> 
> Fixes:
> KHR-GL45.shader_image_size.*
> 
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/gallium/drivers/r600/r600_shader.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
> index 9a0d6b5dd1..8c4460a5d5 100644
> --- a/src/gallium/drivers/r600/r600_shader.c
> +++ b/src/gallium/drivers/r600/r600_shader.c
> @@ -8821,7 +8821,10 @@ static int tgsi_resq(struct r600_shader_ctx *ctx)
>  	    (inst->Src[0].Register.File == TGSI_FILE_IMAGE && inst->Memory.Texture == TGSI_TEXTURE_BUFFER)) {
>  		if (ctx->bc->chip_class < EVERGREEN)
>  			ctx->shader->uses_tex_buffers = true;
> -		return r600_do_buffer_txq(ctx, 0, ctx->shader->image_size_const_offset);
> +		unsigned offset = 0;
> +		if (inst->Src[0].Register.File == TGSI_FILE_IMAGE)
> +			offset += R600_IMAGE_REAL_RESOURCE_OFFSET - R600_MAX_CONST_BUFFERS + ctx->shader->image_size_const_offset;
Can't the offset actually be handled by r600_do_buffer_txq() somehow?
I'm always getting very confused about those offsets in any case...
But looks like it should be correct to me.

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


> +		return r600_do_buffer_txq(ctx, 0, offset);
>  	}
>  
>  	if (inst->Memory.Texture == TGSI_TEXTURE_CUBE_ARRAY &&
> 



More information about the mesa-dev mailing list