[Mesa-dev] [PATCH 2/3] spirv: add default handler for new enums

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Wed Jan 25 14:15:46 UTC 2017


Series is

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Wed, Jan 25, 2017, at 06:05, Lionel Landwerlin wrote:
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> ---
>  src/compiler/spirv/spirv_to_nir.c  | 12 ++++++++++++
>  src/compiler/spirv/vtn_variables.c |  3 +++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/src/compiler/spirv/spirv_to_nir.c
> b/src/compiler/spirv/spirv_to_nir.c
> index 968502c5fd..6f18af2018 100644
> --- a/src/compiler/spirv/spirv_to_nir.c
> +++ b/src/compiler/spirv/spirv_to_nir.c
> @@ -561,6 +561,9 @@ struct_member_decoration_cb(struct vtn_builder *b,
>        vtn_warn("Decoration only allowed for CL-style kernels: %s",
>                 spirv_decoration_to_string(dec->decoration));
>        break;
> +
> +   default:
> +      unreachable("Unhandled decoration");
>     }
>  }
>  
> @@ -638,6 +641,9 @@ type_decoration_cb(struct vtn_builder *b,
>        vtn_warn("Decoration only allowed for CL-style kernels: %s",
>                 spirv_decoration_to_string(dec->decoration));
>        break;
> +
> +   default:
> +      unreachable("Unhandled decoration");
>     }
>  }
>  
> @@ -2653,6 +2659,9 @@ vtn_handle_preamble_instruction(struct vtn_builder
> *b, SpvOp opcode,
>        case SpvCapabilityTessellationPointSize:
>           spv_check_supported(tessellation, cap);
>           break;
> +
> +      default:
> +         unreachable("Unhandled capability");
>        }
>        break;
>     }
> @@ -2842,6 +2851,9 @@ vtn_handle_execution_mode(struct vtn_builder *b,
> struct vtn_value *entry_point,
>     case SpvExecutionModeVecTypeHint:
>     case SpvExecutionModeContractionOff:
>        break; /* OpenCL */
> +
> +   default:
> +      unreachable("Unhandled execution mode");
>     }
>  }
>  
> diff --git a/src/compiler/spirv/vtn_variables.c
> b/src/compiler/spirv/vtn_variables.c
> index 4d1ec789cc..05ac91eedd 100644
> --- a/src/compiler/spirv/vtn_variables.c
> +++ b/src/compiler/spirv/vtn_variables.c
> @@ -1139,6 +1139,9 @@ apply_var_decoration(struct vtn_builder *b,
> nir_variable *nir_var,
>        vtn_warn("Decoration only allowed for CL-style kernels: %s",
>                 spirv_decoration_to_string(dec->decoration));
>        break;
> +
> +   default:
> +      unreachable("Unhandled decoration");
>     }
>  }
>  
> -- 
> 2.11.0
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list