On Mon, Mar 6, 2017 at 11:15 PM, Iago Toral Quiroga <[email protected]>
wrote:

> This situation can happen if we failed to allocate memory for the shader.
> ---
>  src/intel/vulkan/anv_private.h | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_
> private.h
> index c73196a..d3e32bc 100644
> --- a/src/intel/vulkan/anv_private.h
> +++ b/src/intel/vulkan/anv_private.h
> @@ -1551,6 +1551,9 @@ anv_shader_bin_destroy(struct anv_device *device,
> struct anv_shader_bin *shader)
>  static inline void
>  anv_shader_bin_ref(struct anv_shader_bin *shader)
>  {
> +   if (!shader)
> +      return;
>

I don't think this makes sense.


> +
>     assert(shader->ref_cnt >= 1);
>     __sync_fetch_and_add(&shader->ref_cnt, 1);
>  }
> @@ -1558,6 +1561,9 @@ anv_shader_bin_ref(struct anv_shader_bin *shader)
>  static inline void
>  anv_shader_bin_unref(struct anv_device *device, struct anv_shader_bin
> *shader)
>  {
> +   if (!shader)
> +      return;
>

This one is probably ok


> +
>     assert(shader->ref_cnt >= 1);
>     if (__sync_fetch_and_add(&shader->ref_cnt, -1) == 1)
>        anv_shader_bin_destroy(device, shader);
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to