[Mesa-dev] [PATCH] spirv: Fix building with SCons

Ilia Mirkin imirkin at alum.mit.edu
Fri Mar 30 16:45:25 UTC 2018


On Fri, Mar 30, 2018 at 12:40 PM, Brian Paul <brianp at vmware.com> wrote:
> OK, I'll have some patches soon but I'm stuck on one issue.
>
> Around spriv_to_nir.c:2090 we have
>
>       if (operands & SpvImageOperandsConstOffsetsMask) {
>          gather_offsets = vtn_ssa_value(b, w[idx++]);
>          (*p++) = (nir_tex_src){};
>       }
>
> The (nir_tex_src){} expression is not valid for MSVC (syntax error).  I
> haven't figured out exactly what that's supposed to do.
>
> Replacing it with (*p++) = (nir_tex_src)0; works but I'm not sure that's
> correct.
>
> Ilia wrote the line in question.  Ilia?

I believe it's the equivalent of

nir_tex_src foo = {};
*p++ = foo;

Or similarly,

memset(p++, 0, sizeof(nir_tex_src));

[As an aside, I have no recollection of writing this. I did do some
minor feature enablement work for some SPIR-V things, so perhaps that
was it?]

  -ilia


More information about the mesa-dev mailing list