On Mon, Jul 16, 2018 at 8:32 AM Karol Herbst <kher...@redhat.com> wrote:
> On Mon, Jul 16, 2018 at 5:24 PM, Jason Ekstrand <ja...@jlekstrand.net> > wrote: > > Do we need to do something similar for specialization constants? > > > > I don't think so. The problem here wasn't constants, but simply that > we can end up with non 32 bit shift values inside the SPIR-V, but we > only support 32 bit shifts in nir. It is legal SPIR-V, so we might > just want to fix that. > Right, but you can have 64 or 16-bit specialization constants as well. > > On Mon, Jul 16, 2018 at 7:28 AM Karol Herbst <kher...@redhat.com> wrote: > >> > >> Signed-off-by: Karol Herbst <kher...@redhat.com> > >> --- > >> src/compiler/spirv/vtn_alu.c | 10 ++++++++++ > >> 1 file changed, 10 insertions(+) > >> > >> diff --git a/src/compiler/spirv/vtn_alu.c b/src/compiler/spirv/vtn_alu.c > >> index 5db6c7f0a87..d6f149d12e9 100644 > >> --- a/src/compiler/spirv/vtn_alu.c > >> +++ b/src/compiler/spirv/vtn_alu.c > >> @@ -743,6 +743,16 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode, > >> src[1] = tmp; > >> } > >> > >> + switch (op) { > >> + case nir_op_ishl: > >> + case nir_op_ishr: > >> + case nir_op_ushr: > >> + src[1] = nir_u2u32(&b->nb, src[1]); > >> + break; > >> + default: > >> + break; > >> + } > >> + > >> val->ssa->def = nir_build_alu(&b->nb, op, src[0], src[1], src[2], > >> src[3]); > >> break; > >> } /* default */ > >> -- > >> 2.17.1 > >> > >> _______________________________________________ > >> mesa-dev mailing list > >> mesa-dev@lists.freedesktop.org > >> https://lists.freedesktop.org/mailman/listinfo/mesa-dev >
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev