[Mesa-dev] [PATCH 10/22] nir/vtn: add caps for some cl related capabilities

Jason Ekstrand jason at jlekstrand.net
Wed Nov 21 21:43:39 UTC 2018


patches 6 and 10 are

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Tue, Nov 13, 2018 at 9:49 AM Karol Herbst <kherbst at redhat.com> wrote:

> From: Rob Clark <robdclark at gmail.com>
>
> vtn supports these, so don't squalk if user is happy with enabling
> these.
>
> Signed-off-by: Karol Herbst <kherbst at redhat.com>
> ---
>  src/compiler/shader_info.h         |  3 +++
>  src/compiler/spirv/spirv_to_nir.c  | 16 +++++++++++++---
>  src/compiler/spirv/vtn_variables.c |  6 ++++--
>  3 files changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h
> index 65bc0588d67..5286cf8fc5f 100644
> --- a/src/compiler/shader_info.h
> +++ b/src/compiler/shader_info.h
> @@ -62,6 +62,9 @@ struct spirv_supported_capabilities {
>     bool post_depth_coverage;
>     bool transform_feedback;
>     bool geometry_streams;
> +   bool address;
> +   bool kernel;
> +   bool int8;
>  };
>
>  typedef struct shader_info {
> diff --git a/src/compiler/spirv/spirv_to_nir.c
> b/src/compiler/spirv/spirv_to_nir.c
> index d7dd5a67cc4..db2ee51340c 100644
> --- a/src/compiler/spirv/spirv_to_nir.c
> +++ b/src/compiler/spirv/spirv_to_nir.c
> @@ -792,8 +792,10 @@ struct_member_decoration_cb(struct vtn_builder *b,
>     case SpvDecorationFPRoundingMode:
>     case SpvDecorationFPFastMathMode:
>     case SpvDecorationAlignment:
> -      vtn_warn("Decoration only allowed for CL-style kernels: %s",
> -               spirv_decoration_to_string(dec->decoration));
> +      if (!b->kernel_mode) {
> +         vtn_warn("Decoration only allowed for CL-style kernels: %s",
> +                  spirv_decoration_to_string(dec->decoration));
> +      }
>        break;
>
>     case SpvDecorationHlslSemanticGOOGLE:
> @@ -3428,7 +3430,6 @@ vtn_handle_preamble_instruction(struct vtn_builder
> *b, SpvOp opcode,
>        case SpvCapabilityFloat16:
>        case SpvCapabilityInt64Atomics:
>        case SpvCapabilityStorageImageMultisample:
> -      case SpvCapabilityInt8:
>        case SpvCapabilitySparseResidency:
>        case SpvCapabilityMinLod:
>           vtn_warn("Unsupported SPIR-V capability: %s",
> @@ -3457,8 +3458,17 @@ vtn_handle_preamble_instruction(struct vtn_builder
> *b, SpvOp opcode,
>           spv_check_supported(geometry_streams, cap);
>           break;
>
> +      case SpvCapabilityInt8:
> +         spv_check_supported(int8, cap);
> +         break;
> +
>        case SpvCapabilityAddresses:
> +         spv_check_supported(address, cap);
> +         break;
>        case SpvCapabilityKernel:
> +         spv_check_supported(kernel, cap);
> +         break;
> +
>        case SpvCapabilityImageBasic:
>        case SpvCapabilityImageReadWrite:
>        case SpvCapabilityImageMipmap:
> diff --git a/src/compiler/spirv/vtn_variables.c
> b/src/compiler/spirv/vtn_variables.c
> index c5cf345d02a..e7654b768af 100644
> --- a/src/compiler/spirv/vtn_variables.c
> +++ b/src/compiler/spirv/vtn_variables.c
> @@ -1371,8 +1371,10 @@ apply_var_decoration(struct vtn_builder *b,
>     case SpvDecorationFPRoundingMode:
>     case SpvDecorationFPFastMathMode:
>     case SpvDecorationAlignment:
> -      vtn_warn("Decoration only allowed for CL-style kernels: %s",
> -               spirv_decoration_to_string(dec->decoration));
> +      if (!b->kernel_mode) {
> +         vtn_warn("Decoration only allowed for CL-style kernels: %s",
> +                  spirv_decoration_to_string(dec->decoration));
> +      }
>        break;
>
>     case SpvDecorationHlslSemanticGOOGLE:
> --
> 2.19.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181121/d9dbb374/attachment-0001.html>


More information about the mesa-dev mailing list