[Mesa-dev] [PATCH v2 08/22] include/pipe: Define SPIRV as an IR

Pierre Moreau pierre.morrow at free.fr
Tue Jan 23 22:08:25 UTC 2018


On 2018-01-23 — 13:33, Francisco Jerez wrote:
> Pierre Moreau <pierre.morrow at free.fr> writes:
> 
> > On 2018-01-23 — 14:07, Jan Vesely wrote:
> >> On Tue, 2018-01-23 at 01:33 +0100, Pierre Moreau wrote:
> >> > Signed-off-by: Pierre Moreau <pierre.morrow at free.fr>
> >> > ---
> >> >  src/gallium/include/pipe/p_defines.h | 1 +
> >> >  1 file changed, 1 insertion(+)
> >> > 
> >> > diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
> >> > index b34e7a8570..082d4c4d87 100644
> >> > --- a/src/gallium/include/pipe/p_defines.h
> >> > +++ b/src/gallium/include/pipe/p_defines.h
> >> > @@ -896,6 +896,7 @@ enum pipe_shader_ir
> >> >     PIPE_SHADER_IR_LLVM,
> >> >     PIPE_SHADER_IR_NATIVE,
> >> >     PIPE_SHADER_IR_NIR,
> >> > +   PIPE_SHADER_IR_SPIRV
> >> 
> >> Why is this needed/useful? presumably the pipe driver will convert
> >> SPIRV to NIR or LLVM anyway, why not convert it in clover and pass one
> >> of the already existing IRs ?
> >> 
> >> Jan
> >
> > It is true it’s not really needed for this series, it’s mainly for my SPIR-V
> > frontend for Nouveau. I could drop it from this series for now, especially if
> > SPIR-V get directly translated to another IR and never stays as such, or going
> > the opposite and always keeping SPIR-V until the very last moment.
> >
> 
> I don't have any objection against plumbing through SPIRV directly if
> that's the path you're planning to pursue.  But wouldn't it make sense
> to have working back-end code able to consume it as input before adding
> a new IR to the pipe driver interface?  Otherwise this is basically dead
> code.

A one liner, but still dead code nonetheless. You are right, it should be part
of the series adding a SPIR-V consumer to Nouveau.

I guess half of this series is dead code as well, as there is currently nothing
that can be done with the SPIR-V binary: 1) no driver can consume it directly,
2) it can’t be translated to LLVM IR because there is no upstream code for that
currently, and 3) spirv_to_nir does not currently support OpenCL SPIR-V.

> 
> > Pierre
> >
> >> 
> >> >  };
> >> >  
> >> >  /**





More information about the mesa-dev mailing list