Re: [Mesa-dev] [PATCH 05/12] nir: rename global/local to private/function memory

2019-01-10 Thread Karol Herbst
On Thu, Jan 10, 2019 at 2:33 AM Ian Romanick wrote: > > On 1/8/19 9:57 PM, Kenneth Graunke wrote: > > On Tuesday, December 4, 2018 10:26:43 AM PST Karol Herbst wrote: > >> the naming is a bit confusing no matter how you look at it. Within SPIR-V > >> "global&qu

Re: [Mesa-dev] [PATCH 05/12] nir: rename global/local to private/function memory

2019-01-10 Thread Karol Herbst
On Thu, Jan 10, 2019 at 1:06 PM Karol Herbst wrote: > > On Thu, Jan 10, 2019 at 2:33 AM Ian Romanick wrote: > > > > On 1/8/19 9:57 PM, Kenneth Graunke wrote: > > > On Tuesday, December 4, 2018 10:26:43 AM PST Karol Herbst wrote: > > >> the naming is

Re: [Mesa-dev] [PATCH 05/12] nir: rename global/local to private/function memory

2019-01-11 Thread Karol Herbst
" On Fri, Jan 11, 2019 at 5:19 PM Kenneth Graunke wrote: > > On Wednesday, January 9, 2019 5:33:22 PM PST Ian Romanick wrote: > > On 1/8/19 9:57 PM, Kenneth Graunke wrote: > > > On Tuesday, December 4, 2018 10:26:43 AM PST Karol Herbst wrote: > > >> the n

Re: [Mesa-dev] [PATCH 05/12] nir: rename global/local to private/function memory

2019-01-11 Thread Karol Herbst
On Fri, Jan 11, 2019 at 8:50 PM Kenneth Graunke wrote: > > On Friday, January 11, 2019 9:32:20 AM PST Eric Anholt wrote: > > Jason Ekstrand writes: > > > > > On Fri, Jan 11, 2019 at 11:11 AM Kenneth Graunke > > > wrote: > > > > > >> On Friday, January 11, 2019 8:33:41 AM PST Jason Ekstrand

Re: [Mesa-dev] [PATCH 05/12] nir: rename global/local to private/function memory

2019-01-09 Thread Karol Herbst
On Wed, Jan 9, 2019 at 6:57 AM Kenneth Graunke wrote: > > On Tuesday, December 4, 2018 10:26:43 AM PST Karol Herbst wrote: > > the naming is a bit confusing no matter how you look at it. Within SPIR-V > > "global" memory is memory accessible from all threads. glsl

Re: [Mesa-dev] [PATCH] nvir: Always split 64-bit IMAD/IMUL operations

2018-09-14 Thread Karol Herbst
Hi Dylan, this patch only matters for debug builds (DEBUG set), but your merge result looks correct nonetheless. Thanks On Fri, Sep 14, 2018 at 6:16 PM, Dylan Baker wrote: > Quoting Pierre Moreau (2017-12-04 15:51:04) >> Those operations do not map to actual hardware instructions, therefore >>

[Mesa-dev] [PATCH] WIP nv50/ir: optimize immediates mov to const buffer

2019-03-02 Thread Karol Herbst
some instructions can read from a const buffer but not long immediates, some instructions can take an immediate and a const buffer, but not two immediates. Put immediates we can't load propagate into the driver const buffer, so that shaders can read from there instead doing some movs writing the

Re: [Mesa-dev] [PATCH] android: nouveau: add support for nir

2019-03-17 Thread Karol Herbst
On Sun, Mar 17, 2019 at 10:52 PM Mauro Rossi wrote: > > Add the necessary build rules for android, to avoid building errors. > > Fixes: f014ae3 ("nouveau: add support for nir") > Signed-off-by: Mauro Rossi > --- > src/gallium/drivers/nouveau/Android.mk | 7 ++- > 1 file changed, 6

Re: [Mesa-dev] [PATCH] android: nouveau: add support for nir

2019-03-17 Thread Karol Herbst
On Sun, Mar 17, 2019 at 11:56 PM Mauro Rossi wrote: > > Hi Karol, > > On Sun, Mar 17, 2019 at 11:25 PM Karol Herbst wrote: > > > > On Sun, Mar 17, 2019 at 10:52 PM Mauro Rossi wrote: > > > > > > Add the necessary build rules for android, to avoid b

Re: [Mesa-dev] [PATCH] nir: Constant values are per-column not per-component

2019-03-20 Thread Karol Herbst
Reviewed-by: Karol Herbst On Wed, Mar 20, 2019 at 1:22 PM Lionel Landwerlin wrote: > > Reviewed-by: Lionel Landwerlin > > On 19/03/2019 19:15, Jason Ekstrand wrote: > > --- > > src/compiler/nir/nir.h | 3 ++- > > 1 file changed, 2 insertions(+), 1 deleti

Re: [Mesa-dev] [PATCH 33/34] nv50/ir/nir: handle user clip planes for each emitted vertex

2019-03-11 Thread Karol Herbst
On Tue, Mar 12, 2019 at 1:09 AM Ilia Mirkin wrote: > > On Mon, Mar 11, 2019 at 8:05 PM Karol Herbst wrote: > > > > v9: convert to C++ style comments > > Signed-off-by: Karol Herbst > > --- > > src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 6

[Mesa-dev] [PATCH 28/34] nv50/ir/nir: implement ssbo intrinsics

2019-03-11 Thread Karol Herbst
v4: use loadFrom helper v5: support indirect buffer access v8: don't require C++11 features Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 90 +++ 1 file changed, 90 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen

[Mesa-dev] [PATCH 11/34] nv50/ir/nir: add loadFrom and storeTo helpler

2019-03-11 Thread Karol Herbst
v8: don't require C++11 features Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 72 +++ 1 file changed, 72 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen

[Mesa-dev] [PATCH 15/34] nv50/ir/nir: implement nir_alu_instr handling

2019-03-11 Thread Karol Herbst
to make it easier to grep them add handling for fpow Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 562 +- 1 file changed, 561 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium

[Mesa-dev] [PATCH 10/34] nv50/ir/nir: run assignSlots

2019-03-11 Thread Karol Herbst
checking to slots Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 642 ++ 1 file changed, 642 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index

[Mesa-dev] [PATCH 13/34] nv50/ir/nir: implement nir_load_const_instr

2019-03-11 Thread Karol Herbst
v8: fix loading 8/16 bit constants Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 28 +++ 1 file changed, 28 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers

[Mesa-dev] [PATCH 22/34] nv50/ir/nir: implement nir_instr_type_tex

2019-03-11 Thread Karol Herbst
txf with a uniform constant 0 lod Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 234 ++ 1 file changed, 234 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/cod

[Mesa-dev] [PATCH 09/34] nv50/ir/nir: add nir type helper functions

2019-03-11 Thread Karol Herbst
v4: treat imul as unsigned v5: remove pointless !! v7: inot is unsigned as well v8: don't require C++11 features v9: convert to C++ style comments improve formatting print error in all cases where codegen doesn't support a given type Signed-off-by: Karol Herbst Acked-by: Pierre Moreau

[Mesa-dev] [PATCH 19/34] nv50/ir/nir: implement intrinsic_discard(_if)

2019-03-11 Thread Karol Herbst
v9: use getSSA instead of new_LValue Signed-off-by: Karol Herbst --- .../drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen

[Mesa-dev] [PATCH 18/34] nv50/ir/nir: implement load_(interpolated_)input/output

2019-03-11 Thread Karol Herbst
->prop.fp.readsSampleLocations for at_sample interpolation don't require C++11 features v9: convert to C++ style comments Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 135 ++ 1 file changed, 135 insertions(+) diff --git a/src/gallium/driv

[Mesa-dev] [PATCH 16/34] nv50/ir/nir: implement nir_intrinsic_load_uniform

2019-03-11 Thread Karol Herbst
v2: use new getIndirect helper fixes symbols for 64 bit types v4: use smarter getIndirect helper simplify address calculation use loadFrom helper v8: don't require C++11 features Signed-off-by: Karol Herbst --- .../drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 10

[Mesa-dev] [PATCH 14/34] nv50/ir/nir: add skeleton for nir_intrinsic_instr

2019-03-11 Thread Karol Herbst
Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau --- .../nouveau/codegen/nv50_ir_from_nir.cpp| 17 + 1 file changed, 17 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp

[Mesa-dev] [PATCH 03/34] nv50/ir: move common converter code in base class

2019-03-11 Thread Karol Herbst
v2: remove TGSI related bits Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau --- src/gallium/drivers/nouveau/Makefile.sources | 2 + .../nouveau/codegen/nv50_ir_from_common.cpp | 107 ++ .../nouveau/codegen/nv50_ir_from_common.h | 58 ++ .../nouveau

[Mesa-dev] [PATCH 00/34] Nouveau NIR patches

2019-03-11 Thread Karol Herbst
by the spoken of patch. Can be enabled by setting NV50_PROG_USE_NIR=1 Chanelogs attached to the patches directly and nothing really new since the last time I posted that series, mostly just fixing compatibility with master. Have fun. Karol Herbst (34): prog_to_nir: fix write from vps to PSIZ nvc0

[Mesa-dev] [PATCH 05/34] nouveau: add support for nir

2019-03-11 Thread Karol Herbst
fault" fix memory leak when creating compute shaders use debug_get_bool_option as it is available in non debug builds return failure if unsupported IR is encountered don't lower fpow in nir Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau --- src/gallium/drivers/nouveau/Au

[Mesa-dev] [PATCH 04/34] nv50/ir: add lowering helper

2019-03-11 Thread Karol Herbst
of NOT v8: don't require C++11 features Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau --- src/gallium/drivers/nouveau/Makefile.sources | 2 + .../codegen/nv50_ir_lowering_helper.cpp | 275 ++ .../nouveau/codegen/nv50_ir_lowering_helper.h | 53 src/gallium

[Mesa-dev] [PATCH 01/34] prog_to_nir: fix write from vps to PSIZ

2019-03-11 Thread Karol Herbst
Point size is a single component value and drivers might write the full vec4 potentially overwriting other values. Signed-off-by: Karol Herbst --- src/mesa/program/prog_to_nir.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa

[Mesa-dev] [PATCH 06/34] nouveau: fix nir and TGSI shader cache collision

2019-03-11 Thread Karol Herbst
v9: rename variable to driver_flags use constants for shader cache flags Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau --- src/gallium/drivers/nouveau/nouveau_screen.c | 8 +++- src/gallium/drivers/nouveau/nouveau_screen.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion

[Mesa-dev] [PATCH 07/34] nv50/ir/nir: run some passes to make the conversion easier

2019-03-11 Thread Karol Herbst
v2: add constant_folding v6: print non final NIR only for verbose debugging v8: add passes we will need for OpenCL compute shaders v9: move type_size into anonymous namespace convert to C++ style comments lower bools to int32 Signed-off-by: Karol Herbst Acked-by: Pierre Moreau

[Mesa-dev] [PATCH 02/34] nvc0: print the shader type when dumping headers

2019-03-11 Thread Karol Herbst
this makes debugging the shader header a little easier Acked-by: Pierre Moreau Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/nvc0/nvc0_program.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_program.c b/src/gallium/drivers/nouveau/nvc0

[Mesa-dev] [PATCH 08/34] nv50/ir/nir: track defs and provide easy access functions

2019-03-11 Thread Karol Herbst
stdlibs replace '(*it).' with 'it->' Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 150 ++ 1 file changed, 150 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/code

[Mesa-dev] [PATCH 27/34] nv50/ir/nir: implement nir_intrinsic_load_ubo

2019-03-11 Thread Karol Herbst
v4: use loadFrom helper v8: don't require C++11 features Signed-off-by: Karol Herbst --- .../drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau

[Mesa-dev] [PATCH 31/34] nv50/ir/nir: implement load_per_vertex_output

2019-03-11 Thread Karol Herbst
v4: use smarter getIndirect helper use new getSlotAddress helper v5: use loadFrom helper v8: don't require C++11 features Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 23 +++ 1 file changed, 23 insertions(+) diff --git a/src/gallium

[Mesa-dev] [PATCH 30/34] nv50/ir/nir: add memory barriers

2019-03-11 Thread Karol Herbst
v5: add more barrier intrinsics Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 21 +++ 1 file changed, 21 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen

[Mesa-dev] [PATCH 33/34] nv50/ir/nir: handle user clip planes for each emitted vertex

2019-03-11 Thread Karol Herbst
v9: convert to C++ style comments Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen

[Mesa-dev] [PATCH 25/34] nv50/ir/nir: implement variable indexing

2019-03-11 Thread Karol Herbst
v5: use loadFrom helper v8: don't require C++11 features v9: convert to C++ style comments Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 58 +++ 1 file changed, 58 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp

[Mesa-dev] [PATCH 24/34] nv50/ir/nir: implement vote and ballot

2019-03-11 Thread Karol Herbst
-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 48 +++ 1 file changed, 48 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index ab3bf7f843a..7a10a408b70 100644

[Mesa-dev] [PATCH 17/34] nv50/ir/nir: implement nir_intrinsic_store_(per_vertex_)output

2019-03-11 Thread Karol Herbst
Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 57 ++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index dc8dbcfb48b

[Mesa-dev] [PATCH 23/34] nv50/ir/nir: add skeleton getOperation for intrinsics

2019-03-11 Thread Karol Herbst
v7: don't assert in default case for getSubOp Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 22 +++ 1 file changed, 22 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src

[Mesa-dev] [PATCH 20/34] nv50/ir/nir: implement loading system values

2019-03-11 Thread Karol Herbst
-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 122 ++ 1 file changed, 122 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index 5c372794e02..43c9a468f5a 100644

[Mesa-dev] [PATCH 29/34] nv50/ir/nir: implement images

2019-03-11 Thread Karol Herbst
instructions don't require C++11 features v9: implement MS images rebase on master (image modifiers) fix regressions due to variable src compnents replace '(*it).' with 'it->' convert to C++ style comments Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.

[Mesa-dev] [PATCH 34/34] nv50ir/nir: move immediates before use

2019-03-11 Thread Karol Herbst
Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 59 +-- 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index

[Mesa-dev] [PATCH 26/34] nv50/ir/nir: implement geometry shader nir_intrinsics

2019-03-11 Thread Karol Herbst
v4: use smarter getIndirect helper use new getSlotAddress helper use loadFrom helper v8: don't require C++11 features Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 27 +++ 1 file changed, 27 insertions(+) diff --git a/src/gallium

[Mesa-dev] [PATCH 21/34] nv50/ir/nir: implement nir_ssa_undef_instr

2019-03-11 Thread Karol Herbst
v2: use mkOp v8: don't require C++11 features Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau --- .../drivers/nouveau/codegen/nv50_ir_from_nir.cpp| 13 + 1 file changed, 13 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src

[Mesa-dev] [PATCH 12/34] nv50/ir/nir: parse NIR shader info

2019-03-11 Thread Karol Herbst
v2: parse a few more fields v3: add special handling for GL_ISOLINES v8: set info->prop.fp.readsSampleLocations don't require C++11 features v9: replace '(*it).' with 'it->' convert to C++ style comments Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp

[Mesa-dev] [PATCH 32/34] nv50/ir/nir: implement intrinsic shader_clock

2019-03-11 Thread Karol Herbst
v9: mark as fixed Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 8 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index

Re: [Mesa-dev] [PATCH] kmsro: Silence warning if missing

2019-02-07 Thread Karol Herbst
Reviewed-by: Karol Herbst On Thu, Feb 7, 2019 at 11:55 PM Eric Anholt wrote: > > Alyssa Rosenzweig writes: > > > Regardless of whether the build uses kmsro, kmsro is the default driver > > descriptor when the static loader is used. Thus, in an edge case where > >

[Mesa-dev] [PATCH v3] nvc0/ir: replace cvt instructions with add to improve shader performance

2019-01-28 Thread Karol Herbst
for registers and const memory rework if clauses merge isCvt into this patch Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/codegen/nv50_ir.h | 1 + .../drivers/nouveau/codegen/nv50_ir_inlines.h | 17 + .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 64

[Mesa-dev] [PATCH v4] nvc0/ir: replace cvt instructions with add to improve shader performance

2019-01-28 Thread Karol Herbst
for registers and const memory rework if clauses merge isCvt into this patch v4: merge isCvt into its use Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 64 +++ .../nouveau/codegen/nv50_ir_lowering_nvc0.h | 1 + 2 files changed, 65 insertions

Re: [Mesa-dev] [PATCH] nvc0/ir: always use CG mode for loads from atomic-only buffers

2019-02-03 Thread Karol Herbst
Reviewed-by: Karol Herbst On Sun, Feb 3, 2019 at 4:10 PM Ilia Mirkin wrote: > > Atomic operations don't update the local cache, which means that we > would have to issue CCTL operations in order to get the updated values. > When we know that a buffer is primarily used for atomi

Re: [Mesa-dev] undefined behaviour in spirv_to_nir.c

2019-05-17 Thread Karol Herbst
ohhh, yeah.. I think we can actually just remove that code, as it shouldn't have any affect on the constants value. On Fri, May 17, 2019 at 4:07 AM Jason Ekstrand wrote: > > I think it's fine but I'm not at my computer right now. > > --Jason > > On May 16, 2019 20:58:03 Dave Airlie wrote: > > >

Re: [Mesa-dev] undefined behaviour in spirv_to_nir.c

2019-05-17 Thread Karol Herbst
ts > out, it probably is safe to just delete. However, I'd feel slightly better > about it if we figured out the right bit size and just called > nir_eval_const_opcode to do a u2u32 on the value. > > --Jason > > On Fri, May 17, 2019 at 1:24 AM Karol Herbst wrote: >> >>

Re: [Mesa-dev] [PATCH] nouveau: fix frees in unsupported IR error paths.

2019-06-18 Thread Karol Herbst
ohh, nvm... I already know... On Tue, Jun 18, 2019 at 11:18 PM Karol Herbst wrote: > > On Tue, Jun 18, 2019 at 11:14 PM Dave Airlie wrote: > > > > From: Dave Airlie > > > > This is pointless in that we won't ever hit those paths in real life, > > but c

Re: [Mesa-dev] [PATCH] nouveau: fix frees in unsupported IR error paths.

2019-06-18 Thread Karol Herbst
On Tue, Jun 18, 2019 at 11:14 PM Dave Airlie wrote: > > From: Dave Airlie > > This is pointless in that we won't ever hit those paths in real life, > but coverity complains. > what does it actually complain about? > Fixes: f014ae3c7cce ("nouveau: add support for nir") > --- >

[Mesa-dev] [PATCH 09/15] clover/llvm: Add functions for compiling from source to SPIR-V

2019-05-11 Thread Karol Herbst
From: Pierre Moreau Reviewed-by: Karol Herbst --- .../state_trackers/clover/llvm/invocation.cpp | 100 +++--- .../state_trackers/clover/llvm/invocation.hpp | 8 ++ src/gallium/state_trackers/clover/meson.build | 2 +- 3 files changed, 92 insertions(+), 18 deletions(-) diff

[Mesa-dev] [PATCH 07/15] clover/spirv: Add functions for parsing arguments, linking programs, etc.

2019-05-11 Thread Karol Herbst
From: Pierre Moreau v2 (Karol Herbst): silence warnings about unhandled enum values --- .../clover/spirv/invocation.cpp | 598 ++ .../clover/spirv/invocation.hpp | 12 + 2 files changed, 610 insertions(+) diff --git a/src/gallium/state_trackers

[Mesa-dev] [PATCH 06/15] clover/spirv: Add functions for validating SPIR-V binaries

2019-05-11 Thread Karol Herbst
From: Pierre Moreau Changes since: * v12: remove autotools (Karol Herbst) * v11: Fix compilation error introduced in v11. * v10: - Reuse format_validation_msg in is_valid_spirv. - Remove LVL2STR macro in format_validation_msg. * v9: Add `clover_cpp_std` to the overrides of the `libclspirv

[Mesa-dev] [PATCH 05/15] meson: Check for SPIRV-Tools and llvm-spirv

2019-05-11 Thread Karol Herbst
From: Pierre Moreau Changes since: * v11 (Karol Herbst): - only set new defines for clover to speed up recompilation - remove autotools * v10: - Add a new flag (`--enable-opencl-spirv` for autotools, and `-Dopencl-spirv=true` for meson) for enabling SPIR-V support in clover

[Mesa-dev] [PATCH 10/15] gallium: add blob field to pipe_llvm_program_header

2019-05-11 Thread Karol Herbst
makes it easier to consume a IR_NATIVE binary Signed-off-by: Karol Herbst Reviewed-by: Francisco Jerez --- src/gallium/drivers/r600/evergreen_compute.c | 4 +--- src/gallium/drivers/radeonsi/si_compute.c | 4 +--- src/gallium/include/pipe/p_state.h

[Mesa-dev] [PATCH 02/15] nv50/ir/nir: don't assert on !main

2019-05-11 Thread Karol Herbst
required for OpenCL Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau --- src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen

[Mesa-dev] [PATCH 01/15] nv50/ir/nir: parse system values first and stop for compute shaders

2019-05-11 Thread Karol Herbst
required by OpenCL Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 61 ++- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers

[Mesa-dev] [PATCH 04/15] nv50/ir/nir: implement load/store_global

2019-05-11 Thread Karol Herbst
required by OpenCL v2: fix setting globalAccess Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 36 +++ 1 file changed, 36 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src

[Mesa-dev] [PATCH 14/15] clover: add support for consuming spirv

2019-05-11 Thread Karol Herbst
v2: rework arguments to compiler::compile_program add assert to device::ir_format Signed-off-by: Karol Herbst Reviewed-by: Francisco Jerez --- src/gallium/include/pipe/p_defines.h | 1 + .../state_trackers/clover/core/compiler.hpp | 68 +++ .../state_trackers

[Mesa-dev] [PATCH 11/15] rename pipe_llvm_program_header to pipe_binary_program_header

2019-05-11 Thread Karol Herbst
We want to use it for other formats as well, so give it a more generic name Signed-off-by: Karol Herbst Reviewed-by: Francisco Jerez --- src/gallium/drivers/r600/evergreen_compute.c | 2 +- src/gallium/drivers/radeonsi/si_compute.c | 2 +- src/gallium/include/pipe

[Mesa-dev] [PATCH 15/15] nvc0: expose spirv support

2019-05-11 Thread Karol Herbst
required for OpenCL Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/nouveau_screen.c | 1 + src/gallium/drivers/nouveau/nouveau_screen.h | 1 + src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 14 +- src/gallium/drivers/nouveau/nvc0/nvc0_screen.h | 2 ++ src

[Mesa-dev] [PATCH 13/15] gallium: add entry_point field to pipe_compute_state

2019-05-11 Thread Karol Herbst
. Signed-off-by: Karol Herbst --- src/gallium/include/pipe/p_state.h| 1 + src/gallium/state_trackers/clover/core/kernel.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index c94dfb0ba78..d043f0d19af 100644

[Mesa-dev] [PATCH 08/15] clover/llvm: Add options for dumping SPIR-V binaries

2019-05-11 Thread Karol Herbst
From: Pierre Moreau Reviewed-by: Karol Herbst --- .../state_trackers/clover/llvm/util.hpp | 4 ++- .../clover/spirv/invocation.cpp | 30 +++ .../clover/spirv/invocation.hpp | 4 +++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH 03/15] nv50/ir/nir: handle kernel inputs

2019-05-11 Thread Karol Herbst
required by OpenCL Signed-off-by: Karol Herbst Reviewed-by: Pierre Moreau --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 21 --- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers

[Mesa-dev] [PATCH 00/15] Clover: support CL through SPIR-V

2019-05-11 Thread Karol Herbst
library to convert llvm to spirv. Karol Herbst (10): nv50/ir/nir: parse system values first and stop for compute shaders nv50/ir/nir: don't assert on !main nv50/ir/nir: handle kernel inputs nv50/ir/nir: implement load/store_global gallium: add blob field to pipe_llvm_program_header

[Mesa-dev] [PATCH 12/15] nir/spirv: add spirv_to_nir_cl

2019-05-11 Thread Karol Herbst
Signed-off-by: Karol Herbst --- src/compiler/Makefile.sources| 1 + src/compiler/nir/meson.build | 1 + src/compiler/spirv/nir_spirv.h | 4 + src/compiler/spirv/spirv_to_nir_cl.c | 124 +++ 4 files changed, 130 insertions(+) create mode 100644

[Mesa-dev] [PATCH] nv50/ir/nir: prefer to shift 1ull instead of 1ll

2019-05-12 Thread Karol Herbst
Signed-off-by: Karol Herbst Suggested-by: Ilia Mirkin --- src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen

[Mesa-dev] [PATCH] nv50/ir/nir: make use of SYSTEM_VALUE_MAX when iterating read sysvals

2019-05-12 Thread Karol Herbst
Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index 7e59b83e8fc

[Mesa-dev] [PATCH] nouveau: handle new CAPS

2019-07-02 Thread Karol Herbst
Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/nv50/nv50_screen.c | 13 + src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 13 + 2 files changed, 26 insertions(+) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50

[Mesa-dev] [PATCH] nvc0: remove nvc0_program.tp.input_patch_size

2019-07-08 Thread Karol Herbst
right now that's dead code Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/codegen/nv50_ir_driver.h | 1 - src/gallium/drivers/nouveau/nvc0/nvc0_program.c | 4 src/gallium/drivers/nouveau/nvc0/nvc0_program.h | 1 - 3 files changed, 6 deletions(-) diff --git a/src

Re: [Mesa-dev] [PATCH] nouveau: handle new CAPS

2019-07-02 Thread Karol Herbst
VATIVES one, but I could add another one for CS_DERIVED_SYSTEM_VALUES > On Tue, Jul 2, 2019 at 11:49 AM Karol Herbst wrote: > > > > Signed-off-by: Karol Herbst > > --- > > src/gallium/drivers/nouveau/nv50/nv50_screen.c | 13 + > > src/gallium/drivers/nouveau/

Re: [Mesa-dev] [PATCH] nv50/ir: Add mul and mod constant optimizations

2019-07-23 Thread Karol Herbst
On Tue, Jul 23, 2019 at 4:50 PM Ilia Mirkin wrote: > > You handle 1/n but not 1%n? TBH, the 1/n code isn't 100% obvious to > me... 1/n = |n|-1 > 0 ? i forget how SLCT works, but I can't > think of a way to finish that expression in terms of |n|-1 and n. And > what about n == 0. I'd just as

Re: [Mesa-dev] [PATCH] nv50/ir: Add mul and mod constant optimizations

2019-07-23 Thread Karol Herbst
yeah.. I am not quite sure myself about it. But skipping on the div emulation seems like a good idea in general. But it's also not common enough to actually care all that much about it. On Tue, Jul 23, 2019 at 5:18 PM Ilia Mirkin wrote: > > On Tue, Jul 23, 2019 at 11:15 AM Karol Herbst

Re: [Mesa-dev] [PATCH] nvc0/ir: Fix assert accessing null pointer

2019-07-24 Thread Karol Herbst
it's only fixing a crash in a build with asserts enabled, but if somebody wants to apply those to stable, then go ahead. On Wed, Jul 24, 2019 at 12:48 PM Juan A. Suarez Romero wrote: > > On Fri, 2019-07-19 at 13:56 +0200, Mark Menzynski wrote: > > Fixes:

Re: [Mesa-dev] [PATCH 2/4] nv50, nvc0: update sampler/view bind functions to accept NULL array

2019-07-26 Thread Karol Herbst
Reviewed-by: Karol Herbst On Fri, Jul 26, 2019 at 5:31 AM Ilia Mirkin wrote: > > Apparently vl (or vdpau) wants to pass that in now. Handle it. > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111213 > Signed-off-by: Ilia Mirkin > Cc: mesa-sta...@lists.freedeskto

Re: [Mesa-dev] [PATCH 3/4] nvc0: allow a non-user buffer to be bound at position 0

2019-07-26 Thread Karol Herbst
Reviewed-by: Karol Herbst On Fri, Jul 26, 2019 at 5:31 AM Ilia Mirkin wrote: > > Previously the code only handled it for positions 1 and up (as would be > for UBO's in GL). It's not a lot of trouble to handle this, and vl or > vdpau want this. > > Bugzilla: https://bu

Re: [Mesa-dev] [PATCH 4/4] nouveau: flip DEBUG -> !NDEBUG

2019-07-26 Thread Karol Herbst
Reviewed-by: Karol Herbst On Fri, Jul 26, 2019 at 5:31 AM Ilia Mirkin wrote: > > The meson conversion chose to change the meaning of DEBUG to "used for > debugging" to be "used for expensive things for debugging", primarily > for nir_validate. Flip things

Re: [Mesa-dev] [PATCH] nv50/ir: handle insn not being there for definition of CVT arg

2019-07-26 Thread Karol Herbst
Reviewed-by: Karol Herbst On Fri, Jul 26, 2019 at 7:03 AM Ilia Mirkin wrote: > > This can happen if it's e.g. a uniform or a function argument. > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111217 > Signed-off-by: Ilia Mirkin > Cc: mesa-sta...@lists.freedeskto

Re: [Mesa-dev] [PATCH] nv50/ir: don't consider the main compute function as taking arguments

2019-07-26 Thread Karol Herbst
OpenCL nir path and that works out quite nicely as now you can just call different entry points without having to deal with this "if this function is the entry point, args get passed differently than being a called function" situation. Anyway, the for the patch itself: Reviewed-by: Karol

Re: [Mesa-dev] [PATCH 3/4] nvc0: allow a non-user buffer to be bound at position 0

2019-07-26 Thread Karol Herbst
t;data" pointer) > > Let me know if you want me to resend. > no, that's fine.. > On Fri, Jul 26, 2019 at 5:51 AM Karol Herbst wrote: > > > > Reviewed-by: Karol Herbst > > > > On Fri, Jul 26, 2019 at 5:31 AM Ilia Mirkin wrote: > > > > > > Pr

[Mesa-dev] [PATCH 1/4] nv50ir: fix memset on non trivial types warning

2019-09-20 Thread Karol Herbst
Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/codegen/nv50_ir.cpp| 4 +--- src/gallium/drivers/nouveau/codegen/nv50_ir.h | 2 +- src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src

[Mesa-dev] [PATCH 2/4] nv50ir: fix unnecessary parentheses warning

2019-09-20 Thread Karol Herbst
Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/codegen/nv50_ir_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_util.h b/src/gallium/drivers/nouveau/codegen/nv50_ir_util.h index 307c23d5e03..b1766f48205 100644

[Mesa-dev] [PATCH 3/4] nv50ir/nir: comparison of integer expressions of different signedness warning

2019-09-20 Thread Karol Herbst
Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index 4e86ab8f8cc

[Mesa-dev] [PATCH 4/4] nv50, nvc0: fix must_check warning of util_dynarray_resize_bytes

2019-09-20 Thread Karol Herbst
Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/nv50/nv50_state.c | 10 +++--- src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 10 +++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers

Re: [Mesa-dev] [clover/spirv] radeonsi/NIR (with Nine) - final linking failed on libOpenCL.so.1.0.0

2019-09-26 Thread Karol Herbst
I think you only need to recompile the translator with -fPIC enabled. At least that's what the error is saying. On Thu, Sep 26, 2019 at 6:53 AM Aaron Watry wrote: > > Pretty sure I'm running into the same thing trying to build clover > with llvm-spirv enabled. If it's a known solution, I

[Mesa-dev] [PATCH] nv50/ir: fix crash in isUniform for undefined values

2019-11-02 Thread Karol Herbst
Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/codegen/nv50_ir.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp index a181a13a3b1..ae07d967221 100644 --- a/src/gallium/drivers

[Mesa-dev] [PATCH] nv50/ir/ra: fix memory corruption when spilling

2019-11-12 Thread Karol Herbst
Poisoned by user:f7 Container overflow: fc Array cookie:ac Intra object redzone:bb ASan internal: fe Left alloca redzone: ca Right alloca redzone:cb Shadow gap: cc ==612087==ABORTING Signed-off-by: Karol Herbs

Re: [Mesa-dev] LLVM + SPIRV-LLVM-Translator - compilation errors

2019-11-14 Thread Karol Herbst
might be that those definitions moved elsewhere or the headers were never directly included. In llvm 9 there are in llvm/InitializePasses.h, but maybe that's changed? And if not, maybe that file needs to be included in SPIRVLowerSPIRBlocks.cpp? On Fri, Nov 15, 2019 at 2:34 AM Dieter Nützel

[Mesa-dev] [PATCH] nouveau: limit reported compute max memory and allocation size

2019-12-05 Thread Karol Herbst
Otherwise applications (like the OpenCL CTS) will try to allocate more memory than what the GPU is actually able to provide. Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/nv50/nv50_screen.c | 7 +-- src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 7 +-- 2 files changed

Re: [Mesa-dev] [PATCH] nv50/ir: implement global atomics and handle it for nir

2019-12-05 Thread Karol Herbst
On Thu, Dec 5, 2019 at 11:57 AM Karol Herbst wrote: > > TGSI doesn't have any concept of global memory right now. > > Signed-off-by: Karol Herbst > --- > .../nouveau/codegen/nv50_ir_from_nir.cpp | 43 +-- > .../nouveau/codegen/nv50_ir_lowering_nvc0.

[Mesa-dev] [PATCH] nv50/ir: remove DUMMY edge type

2019-10-14 Thread Karol Herbst
it was never used Signed-off-by: Karol Herbst --- src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp| 3 --- src/gallium/drivers/nouveau/codegen/nv50_ir_graph.cpp | 8 +--- src/gallium/drivers/nouveau/codegen/nv50_ir_graph.h | 1 - src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp

Re: [Mesa-dev] [PATCH] nv50/ir: remove DUMMY edge type

2019-10-14 Thread Karol Herbst
On Mon, Oct 14, 2019 at 5:10 PM Karol Herbst wrote: > > > > it was never used > > > > Signed-off-by: Karol Herbst > > --- > > src/gallium/drivers/nouveau/codegen/nv50_ir_bb.cpp| 3 --- > > src/gallium/drivers/nouveau/codegen/nv50_ir_graph.cpp | 8 +

Re: [Mesa-dev] [Nouveau] [PATCH] nv50/ir: mark STORE destination inputs as used

2019-10-14 Thread Karol Herbst
Reviewed-by: Karol Herbst On Mon, Oct 14, 2019 at 8:47 AM Ilia Mirkin wrote: > > Observed an issue when looking at the code generatedy by the > image-vertex-attrib-input-output piglit test. Even though the test > itself worked fine (due to TIC 0 being used for the image)

Re: [Mesa-dev] [Nouveau] [PATCH] gm107/ir: fix loading z offset for layered 3d image bindings

2019-10-14 Thread Karol Herbst
I don't think this is a good idea overall. The way simpler solution would be to disable tiling on the z axis for 3d images so that we don't hurt the most common case, 2d images. And that's what I was seeing nvidia doing anyway. So with that we would end up adding a bunch of instructions hurting

[Mesa-dev] [PATCH] nv50/ir: implement global atomics and handle it for nir

2019-12-05 Thread Karol Herbst
TGSI doesn't have any concept of global memory right now. Signed-off-by: Karol Herbst --- .../nouveau/codegen/nv50_ir_from_nir.cpp | 43 +-- .../nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 2 + 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/gallium

Re: [Mesa-dev] [PATCH v2 1/7] nv50/ir: add nv50_ir_prog_info_out

2020-03-05 Thread Karol Herbst
On Wed, Mar 4, 2020 at 6:37 PM Emil Velikov wrote: > > Hi Mark, > > On Fri, 21 Feb 2020 at 12:20, Mark Menzynski wrote: > > > - ret = nv50_ir_generate_code(info); > > + /* these fields might be overwritten by the compiler */ > > + info_out.bin.smemSize = prog->cp.smem_size; > > +

<    4   5   6   7   8   9   10   >