radv: Check for GFX9 for 1D arrays in image_size intrinsic.

Submitted by Bas Nieuwenhuizen on Oct. 1, 2017, 8:07 a.m.

Details

Message ID 20171001080729.16236-1-bas@basnieuwenhuizen.nl
State New
Headers show
Series "radv: Check for GFX9 for 1D arrays in image_size intrinsic." ( rev: 2 ) in Mesa

Not browsing as part of any series.

Commit Message

Bas Nieuwenhuizen Oct. 1, 2017, 8:07 a.m.
Only on GFX9 we implement them as 2D images.

This fixes:
dEQP-VK.image.image_size.1d_array.readonly_12x34
dEQP-VK.image.image_size.1d_array.readonly_1x1
dEQP-VK.image.image_size.1d_array.readonly_32x32
dEQP-VK.image.image_size.1d_array.readonly_7x1
dEQP-VK.image.image_size.1d_array.readonly_writeonly_12x34
dEQP-VK.image.image_size.1d_array.readonly_writeonly_1x1
dEQP-VK.image.image_size.1d_array.readonly_writeonly_32x32
dEQP-VK.image.image_size.1d_array.readonly_writeonly_7x1
dEQP-VK.image.image_size.1d_array.writeonly_12x34
dEQP-VK.image.image_size.1d_array.writeonly_1x1
dEQP-VK.image.image_size.1d_array.writeonly_32x32
dEQP-VK.image.image_size.1d_array.writeonly_7x1

Fixes: 1bcb953e166 "radv: handle GFX9 1D textures"
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 979978ee06867a531b8d56cee252f5c83920a339)
---
 src/amd/common/ac_nir_to_llvm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 94e457d8ff8..95cc8e56092 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3609,7 +3609,8 @@  static LLVMValueRef visit_image_size(struct nir_to_llvm_context *ctx,
 		z = LLVMBuildSDiv(ctx->builder, z, six, "");
 		res = LLVMBuildInsertElement(ctx->builder, res, z, two, "");
 	}
-	if (glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_1D &&
+	if (ctx->options->chip_class >= GFX9 &&
+	    glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_1D &&
 	    glsl_sampler_type_is_array(type)) {
 		LLVMValueRef layers = LLVMBuildExtractElement(ctx->builder, res, two, "");
 		res = LLVMBuildInsertElement(ctx->builder, res, layers,

Comments

Small clarification: my understanding is that this patch is intended
only for 17.2 stable release, right?

As we already have 979978ee06867a5 in master for this.



On Sun, 2017-10-01 at 10:07 +0200, Bas Nieuwenhuizen wrote:
> Only on GFX9 we implement them as 2D images.
> 
> This fixes:
> dEQP-VK.image.image_size.1d_array.readonly_12x34
> dEQP-VK.image.image_size.1d_array.readonly_1x1
> dEQP-VK.image.image_size.1d_array.readonly_32x32
> dEQP-VK.image.image_size.1d_array.readonly_7x1
> dEQP-VK.image.image_size.1d_array.readonly_writeonly_12x34
> dEQP-VK.image.image_size.1d_array.readonly_writeonly_1x1
> dEQP-VK.image.image_size.1d_array.readonly_writeonly_32x32
> dEQP-VK.image.image_size.1d_array.readonly_writeonly_7x1
> dEQP-VK.image.image_size.1d_array.writeonly_12x34
> dEQP-VK.image.image_size.1d_array.writeonly_1x1
> dEQP-VK.image.image_size.1d_array.writeonly_32x32
> dEQP-VK.image.image_size.1d_array.writeonly_7x1
> 
> Fixes: 1bcb953e166 "radv: handle GFX9 1D textures"
> Reviewed-by: Dave Airlie <airlied@redhat.com>
> (cherry picked from commit 979978ee06867a531b8d56cee252f5c83920a339)
> ---
>  src/amd/common/ac_nir_to_llvm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index 94e457d8ff8..95cc8e56092 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -3609,7 +3609,8 @@ static LLVMValueRef visit_image_size(struct nir_to_llvm_context *ctx,
>  		z = LLVMBuildSDiv(ctx->builder, z, six, "");
>  		res = LLVMBuildInsertElement(ctx->builder, res, z, two, "");
>  	}
> -	if (glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_1D &&
> +	if (ctx->options->chip_class >= GFX9 &&
> +	    glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_1D &&
>  	    glsl_sampler_type_is_array(type)) {
>  		LLVMValueRef layers = LLVMBuildExtractElement(ctx->builder, res, two, "");
>  		res = LLVMBuildInsertElement(ctx->builder, res, layers,
Yes, that is correct.

On 2 Oct 2017 11:20, "Juan A. Suarez Romero" <jasuarez@igalia.com> wrote:

> Small clarification: my understanding is that this patch is intended
> only for 17.2 stable release, right?
>
> As we already have 979978ee06867a5 in master for this.
>
>
>
> On Sun, 2017-10-01 at 10:07 +0200, Bas Nieuwenhuizen wrote:
> > Only on GFX9 we implement them as 2D images.
> >
> > This fixes:
> > dEQP-VK.image.image_size.1d_array.readonly_12x34
> > dEQP-VK.image.image_size.1d_array.readonly_1x1
> > dEQP-VK.image.image_size.1d_array.readonly_32x32
> > dEQP-VK.image.image_size.1d_array.readonly_7x1
> > dEQP-VK.image.image_size.1d_array.readonly_writeonly_12x34
> > dEQP-VK.image.image_size.1d_array.readonly_writeonly_1x1
> > dEQP-VK.image.image_size.1d_array.readonly_writeonly_32x32
> > dEQP-VK.image.image_size.1d_array.readonly_writeonly_7x1
> > dEQP-VK.image.image_size.1d_array.writeonly_12x34
> > dEQP-VK.image.image_size.1d_array.writeonly_1x1
> > dEQP-VK.image.image_size.1d_array.writeonly_32x32
> > dEQP-VK.image.image_size.1d_array.writeonly_7x1
> >
> > Fixes: 1bcb953e166 "radv: handle GFX9 1D textures"
> > Reviewed-by: Dave Airlie <airlied@redhat.com>
> > (cherry picked from commit 979978ee06867a531b8d56cee252f5c83920a339)
> > ---
> >  src/amd/common/ac_nir_to_llvm.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_
> llvm.c
> > index 94e457d8ff8..95cc8e56092 100644
> > --- a/src/amd/common/ac_nir_to_llvm.c
> > +++ b/src/amd/common/ac_nir_to_llvm.c
> > @@ -3609,7 +3609,8 @@ static LLVMValueRef visit_image_size(struct
> nir_to_llvm_context *ctx,
> >               z = LLVMBuildSDiv(ctx->builder, z, six, "");
> >               res = LLVMBuildInsertElement(ctx->builder, res, z, two,
> "");
> >       }
> > -     if (glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_1D &&
> > +     if (ctx->options->chip_class >= GFX9 &&
> > +         glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_1D &&
> >           glsl_sampler_type_is_array(type)) {
> >               LLVMValueRef layers = LLVMBuildExtractElement(ctx->builder,
> res, two, "");
> >               res = LLVMBuildInsertElement(ctx->builder, res, layers,
>