[Mesa-stable] [Mesa-dev] [PATCH] spirv: Fix loading an entire block at once.

Jason Ekstrand jason at jlekstrand.net
Sat Dec 9 06:13:28 UTC 2017


On Fri, Dec 8, 2017 at 9:36 AM, Emil Velikov <emil.l.velikov at gmail.com>
wrote:

> On 3 December 2017 at 14:40, Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
> wrote:
> > There is no chain, so  checking the length ends with a SEGFAULT.
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103579
> > Cc: <mesa-stable at lists.freedesktop.org>
> I'm not 100% sure if a missing chain does not hint to an issue elsewhere?
>
> Patch does what it says on the tin - I would use something simpler (as
> below), but regardless
> Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
>
>
> > ---
> >  src/compiler/spirv/vtn_variables.c | 58 ++++++++++++++++++++----------
> --------
> >  1 file changed, 30 insertions(+), 28 deletions(-)
> >
> > diff --git a/src/compiler/spirv/vtn_variables.c
> b/src/compiler/spirv/vtn_variables.c
> > index c57f5541319..242f4f916aa 100644
> > --- a/src/compiler/spirv/vtn_variables.c
> > +++ b/src/compiler/spirv/vtn_variables.c
> > @@ -518,35 +518,37 @@ vtn_pointer_to_offset(struct vtn_builder *b,
> struct vtn_pointer *ptr,
> >     *index_out = get_vulkan_resource_index(b, ptr, &type, &idx);
> >
> >     nir_ssa_def *offset = nir_imm_int(&b->nb, 0);
>
> +   if (!ptr->chain) {
> +      return;
>

That doesn't quite work.  There's another out-parameter we have to set.

You could do something weird with the for loop such as

for (; ptr->chain && idx < ptr->chain->length; i++)

Either way,

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

One of these days, we should probably just make push constants work like
all of the other direct-offset things.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20171208/e4d9dab0/attachment.html>


More information about the mesa-stable mailing list