Karol Herbst <kher...@redhat.com> writes: > On Mon, Jul 23, 2018 at 7:02 PM, Eric Anholt <e...@anholt.net> wrote: >> Karol Herbst <kher...@redhat.com> writes: >> >>> this allows to replace some nir_load_system_value calls with the specific >>> system value constructor >>> >>> Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net> >>> Signed-off-by: Karol Herbst <kher...@redhat.com> >>> --- >>> src/compiler/nir/nir_builder_opcodes_h.py | 21 +++++++++++++++++++-- >>> 1 file changed, 19 insertions(+), 2 deletions(-) >>> >>> diff --git a/src/compiler/nir/nir_builder_opcodes_h.py >>> b/src/compiler/nir/nir_builder_opcodes_h.py >>> index 72cf5b4549d..0440875dade 100644 >>> --- a/src/compiler/nir/nir_builder_opcodes_h.py >>> +++ b/src/compiler/nir/nir_builder_opcodes_h.py >>> @@ -55,11 +55,28 @@ nir_load_system_value(nir_builder *build, >>> nir_intrinsic_op op, int index) >>> return &load->dest.ssa; >>> } >>> >>> +<% >>> +def sysval_decl_list(opcode): >>> + res = '' >>> + if opcode.indices: >>> + res += ', unsigned ' + opcode.indices[0].lower() >>> + return res >>> + >>> +def sysval_arg_list(opcode): >>> + args = [] >>> + if opcode.indices: >>> + args.append(opcode.indices[0].lower()) >>> + else: >>> + args.append('0') >>> + return ', '.join(args) >>> +%> >> >> I was confused why only indices[0] was used, but it looks like system >> values can only have one index. Maybe assert(len(opcode.indices) <= 1)? >> Other than that, these are: >> >> Reviewed-by: Eric Anholt <e...@anholt.net> > > maybe a static assert that verifies this instead? We could put it > inside nir_intrinsics_c.py and add a note that nir_load_system_value > needs to be adjusted in case we want more.
Either way is fine with me.
signature.asc
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev