[Mesa-dev] [PATCH] radv: remove sisched hack for talos

2019-03-15 Thread Timothy Arceri
This was added in 8a7d4092d260 but no longer seems to have any impact on performance. --- src/amd/vulkan/radv_device.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 9570c15af02..56421dbc74b 100644 ---

[Mesa-dev] [PATCH 1/3] radeonsi/nir: call some more var optimisation passes

2019-03-13 Thread Timothy Arceri
shader-db results (VEGA64): Totals from affected shaders: SGPRS: 5328912 -> 5329680 (0.01 %) VGPRS: 2969308 -> 2969164 (-0.00 %) Spilled SGPRs: 37921 -> 37917 (-0.01 %) Spilled VGPRs: 32882 -> 29024 (-11.73 %) Private memory VGPRs: 0 -> 0 (0.00 %) Scratch size: 1400 -> 1200 (-14.29 %) dwords per t

[Mesa-dev] [PATCH 3/3] radv: call nir_opt_combine_stores()

2019-03-13 Thread Timothy Arceri
No change in my vkpipeline-db collection, but given the same change in radeonsi resulted in all positive results it seems worth while. --- src/amd/vulkan/radv_shader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index bd045a0b92f.

[Mesa-dev] [PATCH 2/3] radeonsi/nir: call nir_opt_combine_stores()

2019-03-13 Thread Timothy Arceri
shader-db results (VEGA64): Totals from affected shaders: SGPRS: 4992920 -> 4992920 (0.00 %) VGPRS: 2787092 -> 2786916 (-0.01 %) Spilled SGPRs: 35987 -> 35987 (0.00 %) Spilled VGPRs: 29024 -> 29024 (0.00 %) Private memory VGPRs: 0 -> 0 (0.00 %) Scratch size: 1200 -> 1200 (0.00 %) dwords per thread

Re: [Mesa-dev] [PATCH 11/11] ac: use new LLVM 8 intrinsics in ac_build_buffer_store_dword()

2019-03-13 Thread Timothy Arceri
On 13/3/19 7:07 pm, Samuel Pitoiset wrote: On 3/13/19 9:01 AM, Samuel Pitoiset wrote: On 3/13/19 1:26 AM, Timothy Arceri wrote: This one causes 2000+ piglit tests to fail on radeonsi. For example: ./bin/shader_runner generated_tests/spec/arb_gpu_shader_fp64/execution/conversion/geom

[Mesa-dev] [PATCH] ac/nir_to_llvm: dont add unrequired swizzle to bcsel src

2019-03-12 Thread Timothy Arceri
NIR can produce IR that looks like this: vec1 1 ssa_51 = ilt ssa_32, ssa_50 vec4 32 ssa_54 = intrinsic load_deref (ssa_53) (0) vec4 32 ssa_57 = intrinsic load_deref (ssa_56) (0) vec4 32 ssa_61 = bcsel ssa_51., ssa_54, ssa_57 The swizzle on the first bcsel src c

Re: [Mesa-dev] [PATCH 11/11] ac: use new LLVM 8 intrinsics in ac_build_buffer_store_dword()

2019-03-12 Thread Timothy Arceri
This one causes 2000+ piglit tests to fail on radeonsi. For example: ./bin/shader_runner generated_tests/spec/arb_gpu_shader_fp64/execution/conversion/geom-conversion-explicit-bool-double.shader_test -auto -fbo On 13/3/19 3:19 am, Samuel Pitoiset wrote: New buffer intrinsics have a separate

Re: [Mesa-dev] [PATCH] nir/loop_unroll: Fix out-of-bounds access handling

2019-03-12 Thread Timothy Arceri
fined value. This saves us the effort of trying to construct a value for an arbitrary copy_deref intrinsic. Yes. It turns out this was indeed not required. Thanks for the fix! Reviewed-by: Timothy Arceri Fixes: e8a8937a04 "nir: add partial loop unrolling support" Cc: Timothy Ar

Re: [Mesa-dev] [PATCH 2/2] nir: Remove unused variable unroll_loc

2019-03-11 Thread Timothy Arceri
On 12/3/19 2:09 pm, Alyssa Rosenzweig wrote: A better fix might be to delete the Mesa src tree, that should fix up any warnings :P Huh, so it does! No regressions on dEQP, possibly since all the tests were failing to begin with on Panfrost. I can only assume this was sent out by mistake? T

Re: [Mesa-dev] [PATCH] nir: silence a couple new compiler warnings

2019-03-11 Thread Timothy Arceri
On 12/3/19 1:50 pm, Brian Paul wrote: Thanks, but it looks like Alyssa's patches may be better. -Brian The second patch looks really wrong. Seems like a mistake to me. On 03/11/2019 08:33 PM, Timothy Arceri wrote: Thanks Reviewed-by: Timothy Arceri On 12/3/19 1:12 pm, Brian Paul

Re: [Mesa-dev] [PATCH 2/2] nir: Remove unused variable unroll_loc

2019-03-11 Thread Timothy Arceri
On 12/3/19 1:30 pm, Alyssa Rosenzweig wrote: Fixes a gcc warning. Signed-off-by: Alyssa Rosenzweig --- src/compiler/nir/nir_opt_loop_unroll.c | 4 1 file changed, 4 deletions(-) diff --git a/src/compiler/nir/nir_opt_loop_unroll.c b/src/compiler/nir/nir_opt_loop_unroll.c index 9ab0a9

Re: [Mesa-dev] [PATCH] nir: silence a couple new compiler warnings

2019-03-11 Thread Timothy Arceri
Thanks Reviewed-by: Timothy Arceri On 12/3/19 1:12 pm, Brian Paul wrote: [33/630] Compiling C object 'src/compiler/nir/nir@sta/nir_loop_analyze.c.o'. ../src/compiler/nir/nir_loop_analyze.c: In function ‘try_find_trip_count_vars_in_iand’: ../src/compiler/nir/nir_loop_analyze.c:846:2

Re: [Mesa-dev] [PATCH 2/2] gallium/util: add some const qualifiers in u_bitmask.c

2019-03-05 Thread Timothy Arceri
Series: Reviewed-by: Timothy Arceri ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 5/5] nir: rename glsl_type_is_struct() -> glsl_type_is_struct_or_ifc()

2019-03-04 Thread Timothy Arceri
Replace done using: find ./src -type f -exec sed -i -- \ 's/glsl_type_is_struct(/glsl_type_is_struct_or_ifc(/g' {} \; --- src/amd/common/ac_nir_to_llvm.c | 2 +- src/amd/vulkan/radv_nir_to_llvm.c| 2 +- src/compiler/glsl/gl_nir_link_uniform_initializers.c

[Mesa-dev] [PATCH 3/5] glsl: rename record_location_offset() -> struct_location_offset()

2019-03-04 Thread Timothy Arceri
Replace done using: find ./src -type f -exec sed -i -- \ 's/record_location_offset(/struct_location_offset(/g' {} \; --- src/amd/common/ac_nir_to_llvm.c| 4 ++-- src/compiler/glsl/gl_nir_lower_samplers_as_deref.c | 2 +- src/compiler/glsl_types.cpp| 4 ++

[Mesa-dev] [PATCH 2/5] glsl: rename get_record_instance() -> get_struct_instance()

2019-03-04 Thread Timothy Arceri
Replace done using: find ./src -type f -exec sed -i -- \ 's/get_record_instance(/get_struct_instance(/g' {} \; --- src/compiler/glsl/ast_to_hir.cpp| 2 +- src/compiler/glsl/tests/array_refcount_test.cpp | 2 +- src/compiler/glsl_types.cpp | 6 +++--- src/compile

[Mesa-dev] [PATCH 4/5] glsl: rename record_types -> struct_types

2019-03-04 Thread Timothy Arceri
--- src/compiler/glsl_types.cpp | 16 src/compiler/glsl_types.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp index bc9bf1380b2..50320a46e98 100644 --- a/src/compiler/glsl_types.cpp +++ b/src

[Mesa-dev] [PATCH 1/5] glsl: rename is_record() -> is_struct()

2019-03-04 Thread Timothy Arceri
Replace was done using: find ./src -type f -exec sed -i -- \ 's/is_record(/is_struct(/g' {} \; --- src/compiler/glsl/ast_function.cpp| 4 +-- src/compiler/glsl/ast_to_hir.cpp | 22 ++-- src/compiler/glsl/glsl_parser_extras.cpp | 2 +- src/compiler/glsl/hir_f

[Mesa-dev] [PATCH] st/glsl_to_nir: fix incorrect arrary access

2019-03-01 Thread Timothy Arceri
This fixes a segfault when we try to access the array using a -1 when the array wasn't allocated in the first place. Before 7536af670b75 we would just access a pre-allocated array that was also load/stored to/from the shader cache. But now the cache will no longer allocate these arrays if they are

[Mesa-dev] [PATCH 3/3] nir: drop the variable name when serializing

2019-02-28 Thread Timothy Arceri
We know NIR can handle this because the shaders coming from spirv don't have names. Dropping the name makes the shaders more generic which can make it better when using the serialized NIR as a key for in memory shader caches such as what we do for radeonsi. Also it just means we can write/read les

[Mesa-dev] [PATCH 1/3] nir: just drop the register name when serializing

2019-02-28 Thread Timothy Arceri
We know NIR can handle this because the shaders coming from spirv don't have names. Dropping the name makes the shaders more generic which can make it better when using the serialized NIR as a key for in memory shader caches such as what we do for radeonsi. Also it just means we can write/read les

[Mesa-dev] [PATCH 2/3] nir: drop name and label when serializing

2019-02-28 Thread Timothy Arceri
Dropping these makes the shaders more generic which can make it better when using the serialized NIR as a key for in memory shader caches such as what we do for radeonsi. Also it just means we can write/read less to and from the disk cache. --- src/compiler/nir/nir_serialize.c | 17 --

[Mesa-dev] [PATCH] glsl: fix shader cache for packed param list

2019-02-26 Thread Timothy Arceri
Some types of params such as some builtins are always padded. We need to keep track of this so we can restore the list correctly. Here we also remove a couple of cache entries that are not actually required as they get rebuilt by the _mesa_add_parameter() calls. This patch fixes a bunch of arb_te

[Mesa-dev] [PATCH] radeonsi/nir: move si_lower_nir() call into compiler thread

2019-02-26 Thread Timothy Arceri
This helps improve compile times. For example the shader-db dolphin shader shaders/dolphin/ubershaders/120.shader_test goes from ~1.69 -> ~1.57 seconds on my machine with this change. --- src/gallium/drivers/radeonsi/si_state_shaders.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) di

Re: [Mesa-dev] [PATCH 5/6] radeonsi: compile clear and copy buffer compute shaders on demand

2019-02-26 Thread Timothy Arceri
Hi Guys, Can we get this one into the next 18.3 release. It fixes a hang with Counter Strike on start-up. I'm a little concerned this just works around the problem but the patch seems safe for stable. Thanks, Tim On 12/1/19 10:53 am, Marek Olšák wrote: From: Marek Olšák same as all other

[Mesa-dev] [PATCH v2] radeonsi: fix query buffer allocation

2019-02-24 Thread Timothy Arceri
Fix the logic for buffer full check on alloc. This patch just takes the fix Nicolai attached to the bug report and updates it to work on master. Fixes: e0f0d3675d4 ("radeonsi: factor si_query_buffer logic out of si_query_hw") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109561 --- src/

Re: [Mesa-dev] [PATCH] nir/algebraic: Replace a-fract(a) with floor(a)

2019-02-23 Thread Timothy Arceri
On 23/2/19 4:09 pm, Ian Romanick wrote: From: Ian Romanick I noticed this while looking at a shader that was affected by Tim's "more loop unrolling" series. All Gen6+ platforms had similar results. (Skylake shown) total instructions in shared programs: 15437001 -> 15435259 (-0.01%) instructi

Re: [Mesa-dev] [PATCH] radeonsi: fix query buffer allocation

2019-02-22 Thread Timothy Arceri
On 23/2/19 11:31 am, Marek Olšák wrote: Nicolai also has a change in si_query_buffer_reset. Is there a reason the change is not here? duh ... no reason other than I forgot that bit. Thanks, Marek On Thu, Feb 21, 2019 at 10:09 PM Timothy Arceri <mailto:tarc...@itsqueeze.com>&

[Mesa-dev] [PATCH v3] nir: allow nir_lower_phis_to_scalar() on more src types

2019-02-22 Thread Timothy Arceri
Rather than only lowering if all srcs are scalarizable we instead check that at least one src is scalarizable. We remove undef type from the is_phi_src_scalarizable() as using this as a check just cause regressions when it is the only scalarizable src. total instructions in shared programs: 13219

Re: [Mesa-dev] [PATCH] nir: add nir_instr_type_tex support to nir_lower_phis_to_scalar()

2019-02-22 Thread Timothy Arceri
On 23/2/19 8:54 am, Jason Ekstrand wrote: On Fri, Feb 22, 2019 at 2:47 PM Timothy Arceri <mailto:tarc...@itsqueeze.com>> wrote: On 23/2/19 6:31 am, Rob Clark wrote: > On Fri, Feb 22, 2019 at 12:39 PM Jason Ekstrand mailto:ja...@jlekstrand.net>> wrote:

[Mesa-dev] [PATCH v2] nir: add nir_instr_type_tex support to nir_lower_phis_to_scalar()

2019-02-22 Thread Timothy Arceri
total instructions in shared programs: 13219105 -> 13024613 (-1.47%) instructions in affected programs: 1155045 -> 960553 (-16.84%) helped: 581 HURT: 100 total cycles in shared programs: 333968972 -> 324813762 (-2.74%) cycles in affected programs: 129831032 -> 120675822 (-7.05%) helped: 571 HURT:

Re: [Mesa-dev] [PATCH] nir: add nir_instr_type_tex support to nir_lower_phis_to_scalar()

2019-02-22 Thread Timothy Arceri
On 23/2/19 6:31 am, Rob Clark wrote: On Fri, Feb 22, 2019 at 12:39 PM Jason Ekstrand wrote: On Fri, Feb 22, 2019 at 9:51 AM Eric Anholt wrote: Timothy Arceri writes: shader-db results i965 (SKL): total instructions in shared programs: 13219105 -> 13024761 (-1.47%) instructions

[Mesa-dev] [PATCH] nir: add nir_instr_type_tex support to nir_lower_phis_to_scalar()

2019-02-22 Thread Timothy Arceri
shader-db results i965 (SKL): total instructions in shared programs: 13219105 -> 13024761 (-1.47%) instructions in affected programs: 1169457 -> 975113 (-16.62%) helped: 599 HURT: 154 total cycles in shared programs: 333968972 -> 324822073 (-2.74%) cycles in affected programs: 130032440 -> 120885

[Mesa-dev] [PATCH] radeonsi: fix query buffer allocation

2019-02-21 Thread Timothy Arceri
Fix the logic for buffer full check on alloc. This patch just takes the fix Nicolai attached to the bug report and updates it to work on master. Fixes: e0f0d3675d4 ("radeonsi: factor si_query_buffer logic out of si_query_hw") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109561 --- src/

Re: [Mesa-dev] A few NIR compile time optimisations

2019-02-20 Thread Timothy Arceri
On 21/2/19 2:32 am, Marek Olšák wrote: On Wed, Feb 20, 2019 at 2:31 AM Connor Abbott > wrote: On Wed, Feb 20, 2019 at 4:29 AM Marek Olšák mailto:mar...@gmail.com>> wrote: On Tue, Feb 19, 2019 at 7:57 PM Rob Clark mailto:robdcl...@gmail.com>> wrote:

[Mesa-dev] [PATCH] nir: remove non-ssa support from nir_copy_prop()

2019-02-19 Thread Timothy Arceri
Even in a very basic shader this reduces the time spent in nir_copy_prop() by ~17%. No shader-db changes for radeonsi NIR or i965. --- src/compiler/nir/nir_opt_copy_propagate.c | 41 +++ 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/src/compiler/nir/nir_opt_co

[Mesa-dev] [PATCH] nir: clone instruction set rather than removing individual entries

2019-02-19 Thread Timothy Arceri
This reduces the time spent in nir_opt_cse() by almost a half. --- src/compiler/nir/nir_opt_cse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/nir/nir_opt_cse.c b/src/compiler/nir/nir_opt_cse.c index bf42a6a33dc..3c3617d852a 100644 --- a/src/compiler/nir/n

Re: [Mesa-dev] A few NIR compile time optimisations

2019-02-19 Thread Timothy Arceri
On 20/2/19 10:59 am, Timothy Arceri wrote: On 20/2/19 10:49 am, Marek Olšák wrote: st_link_shader takes 55% of CPU time with NIR, and 9% with TGSI. nir_validate_shader 49% nir_validate_shader is overused. It doesn't make sense even in debug builds. It's used to validate the

Re: [Mesa-dev] A few NIR compile time optimisations

2019-02-19 Thread Timothy Arceri
o see where most of the time is spent. On Wed, Feb 13, 2019 at 9:00 AM Timothy Arceri mailto:tarc...@itsqueeze.com>> wrote: Currently the radeonsi NIR backend takes around twice the time of the tgsi backend to compile shader-db. These are some first ste

Re: [Mesa-dev] [PATCH 3/3] driconf: add Civ6Sub executable for Civilization 6

2019-02-19 Thread Timothy Arceri
Series: Reviewed-by: Timothy Arceri We might want to tag this for stable too? NIR should work fine with this game with the current stable releases. On 20/2/19 9:31 am, Marek Olšák wrote: From: Marek Olšák I'm getting Civ6Sub instead of Civ6. --- src/util/00-mesa-defaults.con

Re: [Mesa-dev] radeonsi: NIR - Polaris triangle sprinkling running UH SOLVED - finally

2019-02-15 Thread Timothy Arceri
stride without corruption, so I'm increasing the vertex stride. and now finally SOLVED with commit 26aa460940f6222565ad5eb40a21c2377c59c3a6 Author: Timothy Arceri Date:   Mon Dec 10 10:23:51 2018 +1100     nir: rewrite varying component packing     There are a number of reasons for

Re: [Mesa-dev] [PATCH] Revert "glsl: relax input->output validation for SSO programs"

2019-02-15 Thread Timothy Arceri
Reviewed-by: Timothy Arceri But I think you should add something like the following to the commit message: "This was fixed properly by commit ..." Once you push "glsl/linker: don't fail non static used inputs without matching outputs" On 9/2/19 4:06 am, Andres G

Re: [Mesa-dev] [PATCH v2 4/6] glsl/linker: don't fail non static used inputs without matching outputs

2019-02-15 Thread Timothy Arceri
re of the cases in which the input variable didn't have an explicit location. v2: do the location based interface matching check regardless on whehter it is a separable program or not (Ilia). Cc: Timothy Arceri Cc: Iago Toral Quiroga Cc: Samuel Iglesias Gonsálvez Cc: Tapani Pälli

Re: [Mesa-dev] [PATCH v2 4/6] glsl/linker: don't fail non static used inputs without matching outputs

2019-02-15 Thread Timothy Arceri
If the updated piglit tests pass on the Nvidia blob as per my reply to those patches and this patch passes on the new and old piglit tests. Then this patch is: Reviewed-by: Timothy Arceri Thanks for fixing this! On 7/2/19 2:58 am, Andres Gomez wrote: If there is no Static Use of an input

Re: [Mesa-dev] [PATCH v3 2/3] nir: add nir_opt_vectorize_io()

2019-02-15 Thread Timothy Arceri
On 15/2/19 1:43 pm, Jason Ekstrand wrote: On Thu, Feb 14, 2019 at 7:25 PM Timothy Arceri <mailto:tarc...@itsqueeze.com>> wrote: On 15/2/19 7:51 am, Jason Ekstrand wrote: > ping? You seem to be asking me to rewrite the entire meat of the pass without any suggesti

Re: [Mesa-dev] [PATCH v3 2/3] nir: add nir_opt_vectorize_io()

2019-02-15 Thread Timothy Arceri
On 15/2/19 1:43 pm, Jason Ekstrand wrote: On Thu, Feb 14, 2019 at 7:25 PM Timothy Arceri <mailto:tarc...@itsqueeze.com>> wrote: On 15/2/19 7:51 am, Jason Ekstrand wrote: > ping? You seem to be asking me to rewrite the entire meat of the pass without any suggesti

Re: [Mesa-dev] [PATCH] nir: remove simple dead if detection from nir_opt_dead_cf()

2019-02-15 Thread Timothy Arceri
ant to depend on peephole we can add a simple check in nir_opt_if to look for empty branches. That would be much cheaper. Reviewed-by: Jason Ekstrand <mailto:ja...@jlekstrand.net>> On Wed, Feb 13, 2019 at 7:38 PM Timothy Arceri <mailto:tarc...@itsqueeze.com>> wrote:

Re: [Mesa-dev] [PATCH v3 2/3] nir: add nir_opt_vectorize_io()

2019-02-15 Thread Timothy Arceri
ons[1]. Since we need to do stores this way we just do loads properly while we are at it. [1] https://gitlab.freedesktop.org/mesa/mesa/merge_requests/94/commits On Mon, Feb 4, 2019 at 3:37 PM Jason Ekstrand <mailto:ja...@jlekstrand.net>> wrote: On Mon, Nov 5, 2018 at 8:58 PM

[Mesa-dev] [PATCH] nir: remove simple dead if detection from nir_opt_dead_cf()

2019-02-13 Thread Timothy Arceri
This was probably useful when it was first written, however it looks to be no longer necessary. As far as I can tell these days dce is smart enough to remove useless instructions from if branches. Once this is done nir_opt_peephole_select() will end up removing the empty if. Removing this support

Re: [Mesa-dev] [PATCH 4/4] nir: reorder some code

2019-02-13 Thread Timothy Arceri
change but it was very small. I'm not fussed about this one so will drop it since you don't like it. On February 13, 2019 02:00:49 Timothy Arceri wrote: The compile shoud do this for us so this is more for neatness rather than speed. --- src/compiler/nir/nir_search.c | 3 +

Re: [Mesa-dev] A few NIR compile time optimisations

2019-02-13 Thread Timothy Arceri
On 13/2/19 8:47 pm, Timothy Arceri wrote: On 13/2/19 8:38 pm, Timothy Arceri wrote: On 13/2/19 8:26 pm, Connor Abbott wrote: Reviewed-by: Connor Abbott <mailto:cwabbo...@gmail.com>> I'm a bit surprised it's that slow... do you have any idea what's going on? I've

Re: [Mesa-dev] A few NIR compile time optimisations

2019-02-13 Thread Timothy Arceri
On 13/2/19 10:01 pm, Michel Dänzer wrote: On 2019-02-13 10:38 a.m., Timothy Arceri wrote: On 13/2/19 8:26 pm, Connor Abbott wrote: Reviewed-by: Connor Abbott mailto:cwabbo...@gmail.com>> I'm a bit surprised it's that slow... do you have any idea what's going on? I'

Re: [Mesa-dev] A few NIR compile time optimisations

2019-02-13 Thread Timothy Arceri
On 13/2/19 8:38 pm, Timothy Arceri wrote: On 13/2/19 8:26 pm, Connor Abbott wrote: Reviewed-by: Connor Abbott <mailto:cwabbo...@gmail.com>> I'm a bit surprised it's that slow... do you have any idea what's going on? I've made flamegraphs in the past on i965 to s

Re: [Mesa-dev] A few NIR compile time optimisations

2019-02-13 Thread Timothy Arceri
f operations converting vales to different type etc. On Wed, Feb 13, 2019 at 9:00 AM Timothy Arceri <mailto:tarc...@itsqueeze.com>> wrote: Currently the radeonsi NIR backend takes around twice the time of the tgsi backend to compile shader-db. These are some first

Re: [Mesa-dev] [PATCH 2/4] nir: turn ssa check into an assert

2019-02-13 Thread Timothy Arceri
On 13/2/19 7:00 pm, Timothy Arceri wrote: Everthing should be in ssa form when this is called. Checking for it here is expensive so turn this into an assert instead. Do the cheap thing first and check if we can even progress with this instruction type. Sorry this second line was meant to be

[Mesa-dev] [PATCH 2/4] nir: turn ssa check into an assert

2019-02-13 Thread Timothy Arceri
Everthing should be in ssa form when this is called. Checking for it here is expensive so turn this into an assert instead. Do the cheap thing first and check if we can even progress with this instruction type. --- src/compiler/nir/nir_instr_set.c | 14 +++--- 1 file changed, 11 insertion

[Mesa-dev] [PATCH 1/4] nir: prehash instruction in nir_instr_set_add_or_rewrite()

2019-02-13 Thread Timothy Arceri
There is no need to hash the instruction twice, especially as we end up adding it in the majority of cases. --- src/compiler/nir/nir_instr_set.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compiler/nir/nir_instr_set.c b/src/compiler/nir/nir_instr_set.c index 06

[Mesa-dev] [PATCH 3/4] nir: turn an ssa check in nir_search into an assert

2019-02-13 Thread Timothy Arceri
Everything should be in ssa form when we call this. This is a hotpath so replace the check with an assert. --- src/compiler/nir/nir_search.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c index 8578ca53c87..d257b6

[Mesa-dev] [PATCH 4/4] nir: reorder some code

2019-02-13 Thread Timothy Arceri
The compile shoud do this for us so this is more for neatness rather than speed. --- src/compiler/nir/nir_search.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c index d257b639189..f0a79a54301 100644 --- a/src/com

[Mesa-dev] A few NIR compile time optimisations

2019-02-13 Thread Timothy Arceri
Currently the radeonsi NIR backend takes around twice the time of the tgsi backend to compile shader-db. These are some first steps at reducing the overhead of NIR. This series reduces the compile time of a Deus Ex program I was profiling by around 5%. ___

[Mesa-dev] [PATCH] radeonsi/nir: set shader_buffers_declared properly

2019-02-11 Thread Timothy Arceri
--- src/gallium/drivers/radeonsi/si_shader_nir.c | 32 ++-- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 55a950a675c..c547f5f1c30 100644 --- a/src/gallium/drivers/r

Re: [Mesa-dev] [PATCH v2 1/2] radeonsi/nir: set input_usage_mask properly

2019-02-11 Thread Timothy Arceri
On 12/2/19 11:15 am, Timothy Arceri wrote: shader-db results for VEGA64: Totals from affected shaders: SGPRS: 791528 -> 792616 (0.14 %) VGPRS: 421624 -> 410784 (-2.57 %) Spilled SGPRs: 1639 -> 1674 (2.14 %) Spilled VGPRs: 0 -> 0 (0.00 %) Private memory VGPRs: 0 -> 0 (0.00 %)

[Mesa-dev] [PATCH v2 1/2] radeonsi/nir: set input_usage_mask properly

2019-02-11 Thread Timothy Arceri
shader-db results for VEGA64: Totals from affected shaders: SGPRS: 791528 -> 792616 (0.14 %) VGPRS: 421624 -> 410784 (-2.57 %) Spilled SGPRs: 1639 -> 1674 (2.14 %) Spilled VGPRs: 0 -> 0 (0.00 %) Private memory VGPRs: 0 -> 0 (0.00 %) Scratch size: 0 -> 0 (0.00 %) dwords per thread Code Size: 161035

[Mesa-dev] [PATCH v2 2/2] radeonsi/nir: set colors_read properly

2019-02-11 Thread Timothy Arceri
shader-db results for VEGA64: Totals from affected shaders: SGPRS: 1976 -> 1976 (0.00 %) VGPRS: 1240 -> 1144 (-7.74 %) Spilled SGPRs: 145 -> 145 (0.00 %) Spilled VGPRs: 0 -> 0 (0.00 %) Private memory VGPRs: 0 -> 0 (0.00 %) Scratch size: 0 -> 0 (0.00 %) dwords per thread Code Size: 34632 -> 34604 (

Re: [Mesa-dev] [PATCH 1/4] radeonsi/nir: add get_component_usagemask() helper

2019-02-10 Thread Timothy Arceri
Please ingnore this series for now. I'm working on a series that does this better. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH 3/4] radeonsi/nir: set input_usage_mask properly

2019-02-10 Thread Timothy Arceri
--- src/gallium/drivers/radeonsi/si_shader_nir.c | 28 +++- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 04e9e217306..ba7c0b31bd2 100644 --- a/src/gallium/drivers/ra

[Mesa-dev] [PATCH 2/4] radeonsi/nir: add get_num_of_component_info() helper

2019-02-10 Thread Timothy Arceri
This will be reused in the following patch. --- src/gallium/drivers/radeonsi/si_shader_nir.c | 38 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 5abda445e09..04

[Mesa-dev] [PATCH 4/4] radeonsi/nir: set colors_read properly

2019-02-10 Thread Timothy Arceri
--- src/gallium/drivers/radeonsi/si_shader_nir.c | 21 +++- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index ba7c0b31bd2..d5a5464e235 100644 --- a/src/gallium/drivers/ra

[Mesa-dev] [PATCH 1/4] radeonsi/nir: add get_component_usagemask() helper

2019-02-10 Thread Timothy Arceri
This will be reused in a following patch. --- src/gallium/drivers/radeonsi/si_shader_nir.c | 46 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 7554f5b9f8b..5abd

Re: [Mesa-dev] [PATCH v2 4/6] glsl/linker: don't fail non static used inputs without matching outputs

2019-02-06 Thread Timothy Arceri
"glsl: fail when a shader's input var has not an equivalent out var in previous") took care of the cases in which the input variable didn't have an explicit location. v2: do the location based interface matching check regardless on whehter it is a separable program or not (I

Re: [Mesa-dev] [PATCH 23/25] radeonsi: factor si_query_buffer logic out of si_query_hw

2019-02-05 Thread Timothy Arceri
On 4/2/19 11:26 pm, Nicolai Hähnle wrote: On 01.02.19 05:25, Timothy Arceri wrote: On 26/1/19 11:56 am, Marek Olšák wrote: Timothy, can you please test the attached fix? I'm having trouble compiling 32bit mesa on my machine at the moment so haven't been able to test Batman. But t

Re: [Mesa-dev] [PATCH 4/6] glsl/linker: don't fail non static used inputs without matching outputs

2019-02-05 Thread Timothy Arceri
glsl: relax input->output validation for SSO programs"), avoid failing also for programs that utilize GL_ARB_separate_shader_objects. Cc: Timothy Arceri Cc: Iago Toral Quiroga Cc: Samuel Iglesias Gonsálvez Cc: Tapani Pälli Cc: Ian Romanick Signed-off-by: Andres Gomez --- src/compiler/

Re: [Mesa-dev] [PATCH 5/6] glsl/linker: simplify xfb_offset vs xfb_stride overflow check

2019-02-02 Thread Timothy Arceri
On 3/2/19 7:21 am, Andres Gomez wrote: On Sat, 2019-02-02 at 10:10 +1100, Timothy Arceri wrote: On 2/2/19 5:05 am, Andres Gomez wrote: Current implementation uses a complicated calculation which relies in an implicit conversion to check the integral part of 2 division results. However, the

Re: [Mesa-dev] [PATCH 23/25] radeonsi: factor si_query_buffer logic out of si_query_hw

2019-02-01 Thread Timothy Arceri
On 2/2/19 2:56 pm, Marek Olšák wrote: Feel free to revert the commit if it's not difficult. Unfortunately it no longer seems to be a simple revert. Marek On Thu, Jan 31, 2019, 11:25 PM Timothy Arceri <mailto:tarc...@itsqueeze.com> wrote: On 26/1/19 11:56 am, Marek

Re: [Mesa-dev] [PATCH 4/6] glsl/linker: don't fail non static used inputs without matching outputs

2019-02-01 Thread Timothy Arceri
On 2/2/19 10:28 am, Timothy Arceri wrote: On 2/2/19 5:05 am, Andres Gomez wrote: If there is no Static Use of an input variable, the linker shouldn't fail whenever there is no defined matching output variable in the previous stage.  From page 47 (page 51 of the PDF) of the GLSL 4.60 v.5

Re: [Mesa-dev] [PATCH 2/6] glsl: correctly validate component layout qualifier for dvec{3, 4}

2019-02-01 Thread Timothy Arceri
piling error. Fixes: 94438578d21 ("glsl: validate and store component layout qualifier in GLSL IR") Cc: Timothy Arceri Cc: Kenneth Graunke Signed-off-by: Andres Gomez --- src/compiler/glsl/ast_to_hir.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/glsl/ast_

Re: [Mesa-dev] [PATCH 3/6] glsl/linker: always validate explicit location among inputs

2019-02-01 Thread Timothy Arceri
Nice catch! Reviewed-by: Timothy Arceri On 2/2/19 5:05 am, Andres Gomez wrote: Outputs are always validated when having explicit locations and we were trusting its outcome to catch similar problems with the inputs since, in case of having undefined outputs for existing inputs, we would be

Re: [Mesa-dev] [PATCH 4/6] glsl/linker: don't fail non static used inputs without matching outputs

2019-02-01 Thread Timothy Arceri
it's always a bit unsettling to see this type of thing. However its better that what we do now and is consistent with 18004c338f6 so this patch is: Reviewed-by: Timothy Arceri + linker_error(prog, + "%s shader input `%s'

Re: [Mesa-dev] [PATCH 5/6] glsl/linker: simplify xfb_offset vs xfb_stride overflow check

2019-02-01 Thread Timothy Arceri
uses bytes 0-11. So there is no issue with vec3 d having an offset of 12. Its been a long time since I worked on this but I think this change is wrong. I see no reason this should fail compilation. }; ... " Fixes: 2fab85aaea5 ("glsl: add xfb_stride link time validatio

Re: [Mesa-dev] [ANNOUNCE] mesa 19.0.0-rc1

2019-02-01 Thread Timothy Arceri
On 1/2/19 8:34 pm, Eero Tamminen wrote: Hi, On 31.1.2019 1.37, Dylan Baker wrote: This email announces the mesa 19.0 release candidate 1. I'll keep this email fairly brief since I'm already running a little late on getting this done :) I've just had to resolve quite a few autotools issues to

[Mesa-dev] [PATCH] radv: take LDS into account for compute shader occupancy stats

2019-02-01 Thread Timothy Arceri
Ported from d205faeb6c96. --- src/amd/vulkan/radv_nir_to_llvm.c | 6 +++--- src/amd/vulkan/radv_private.h | 3 +++ src/amd/vulkan/radv_shader.c | 10 -- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/amd/vulkan/radv_nir_to_llvm.c b/src/amd/vulkan/radv_nir_t

[Mesa-dev] [PATCH] ac/radv/radeonsi: add ac_get_num_physical_sgprs() helper

2019-02-01 Thread Timothy Arceri
--- src/amd/common/ac_gpu_info.h | 6 ++ src/amd/vulkan/radv_device.c | 2 +- src/amd/vulkan/radv_shader.c | 4 ++-- src/amd/vulkan/radv_shader.h | 6 -- src/gallium/drivers/radeonsi/si_shader.c | 7 +++ 5 files changed, 12 insertions(+),

Re: [Mesa-dev] [PATCH 23/25] radeonsi: factor si_query_buffer logic out of si_query_hw

2019-01-31 Thread Timothy Arceri
not fix it. Thanks, Marek On Wed, Jan 2, 2019 at 10:58 PM Timothy Arceri <mailto:tarc...@itsqueeze.com>> wrote: This commit seems to cause bad stuttering in the Batman Arkham City benchmark. On 7/12/18 1:00 am, Nicolai Hähnle wrote: > From: Nicolai Hähn

Re: [Mesa-dev] [PATCH] radeonsi/nir: remove dead local variables

2019-01-31 Thread Timothy Arceri
On 1/2/19 5:04 am, Emil Velikov wrote: On Thu, 31 Jan 2019 at 01:01, Timothy Arceri wrote: Without this we do not end up with a deterministic NIR. NIR must be deterministic here because we use it to produce a sha for the radeonsi backends disk cache. This fixes the shader cache for a bunch

[Mesa-dev] [PATCH v2] st/glsl_to_nir: remove dead local variables

2019-01-30 Thread Timothy Arceri
Without this we do not end up with a deterministic NIR because temporary register variables are added in random order. NIR must be deterministic because we use it to produce a sha for the radeonsi backends disk cache. This fixes the shader cache for a bunch of shaders. Another positive is that th

[Mesa-dev] [PATCH] nir: move nir_block_cf_tree_{next, prev}() NULL checking to caller

2019-01-30 Thread Timothy Arceri
Rather than doing a NULL check on every block that is passed in just do it for nir_foreach_block_{reverse}_safe() where the potential problem is. This is a micro optimisation after seeing nir_block_cf_tree_next() when profiling shader compile-times. --- src/compiler/nir/nir.c | 13 -

[Mesa-dev] [PATCH] radeonsi/nir: remove dead local variables

2019-01-30 Thread Timothy Arceri
Without this we do not end up with a deterministic NIR. NIR must be deterministic here because we use it to produce a sha for the radeonsi backends disk cache. This fixes the shader cache for a bunch of shaders. --- src/gallium/drivers/radeonsi/si_shader_nir.c | 3 +++ 1 file changed, 3 insertion

[Mesa-dev] [PATCH] glsl: use remap location when serialising uniform program resource data

2019-01-27 Thread Timothy Arceri
This allows us to avoid expensive string compares since we already have a map to the pointers. These compares were taking ~30 seconds for a single shader compile in Godot due to it using 64,000+ uniforms. Fixes: c4cff5f40254 ("glsl: add basic support for resource list to shader cache") Bugzilla

[Mesa-dev] [PATCH] radv/ac: fix some fp16 handling

2019-01-23 Thread Timothy Arceri
Fixes: b722b29f10d4 ("radv: add support for 16bit input/output") --- Compile tested only. Noticed when passing by. src/amd/common/ac_nir_to_llvm.c | 2 +- src/amd/vulkan/radv_nir_to_llvm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/common/ac_nir_to_llvm.c b

[Mesa-dev] [PATCH] tgsi: remove culldist semantic from docs

2019-01-23 Thread Timothy Arceri
The semantic was removed in e6d93893662d. --- src/gallium/docs/source/tgsi.rst | 18 -- 1 file changed, 18 deletions(-) diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 277f25ca41b..59410cfd663 100644 --- a/src/gallium/docs/source/tgsi.rst +++

Re: [Mesa-dev] [PATCH] nir: propagate known constant values into the if-then branch

2019-01-22 Thread Timothy Arceri
On 23/1/19 3:27 pm, Caio Marcelo de Oliveira Filho wrote: Hi, The different problem I've found was that uses in the phi instruction after the then/else blocks was being replaced, causing churn in the optimizations further on. As a hack, I've ignored phi instructions in the use loop above. HUR

[Mesa-dev] [PATCH] ac/nir_to_llvm: fix clamp shadow reference for more hardware

2019-01-22 Thread Timothy Arceri
Fixes the following piglit test on my VEGA and matches the behaviour in the tgsi backend. tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow2D-clamp-z.shader_test Fixes: 625dcbbc4566 ("amd/common: pass address components individually to ac_build_image_intrinsic") --- src/amd/common/ac_nir_t

Re: [Mesa-dev] [PATCH] nir: propagate known constant values into the if-then branch

2019-01-22 Thread Timothy Arceri
On 23/1/19 11:27 am, Caio Marcelo de Oliveira Filho wrote: Hi, Did you look at any of the HURT? The problem I was seeing was this could end up stopping copy propagation from working on some UBOs etc. They were not UBO cases like yours, but looking at them I've found a different problem. Ho

Re: [Mesa-dev] [PATCH] st/mesa: purge framebuffers when unbinding a context

2019-01-22 Thread Timothy Arceri
Acked-by: Timothy Arceri On 23/1/19 3:16 am, Marek Olšák wrote: From: Marek Olšák This fixes pipe_surface "leaks". Cc: 18.3 --- src/mesa/state_tracker/st_manager.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/sta

Re: [Mesa-dev] [PATCH] nir: propagate known constant values into the if-then branch

2019-01-22 Thread Timothy Arceri
On 23/1/19 7:17 am, Caio Marcelo de Oliveira Filho wrote: Hi, I like this patch, did it get dropped for a specific reason or just forgotten? Did you look at any of the HURT? The problem I was seeing was this could end up stopping copy propagation from working on some UBOs etc. For example i

[Mesa-dev] [PATCH] ac/nir_to_llvm: fix interpolateAt* for structs

2019-01-21 Thread Timothy Arceri
This fixes the arb_gpu_shader5 interpolateAt* tests that contain structs. --- Extra piglit tests for structs: https://patchwork.freedesktop.org/patch/279466/ src/amd/common/ac_nir_to_llvm.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/amd

[Mesa-dev] [PATCH 1/2] radeonsi/nir: add missing piece for bindless image support

2019-01-21 Thread Timothy Arceri
This fixes some piglit tests and is was TGSI does. --- src/gallium/drivers/radeonsi/si_shader_nir.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 65da6384c7..0ac737a062 100644 --- a/src/g

[Mesa-dev] [PATCH 2/2] ac/nir_to_llvm: add bindless support for uniform handles

2019-01-21 Thread Timothy Arceri
--- src/amd/common/ac_nir_to_llvm.c | 28 1 file changed, 28 insertions(+) diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index c558873bbe..161a8b2c34 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@

Re: [Mesa-dev] [PATCH] mesa: add EXT_debug_label support

2019-01-18 Thread Timothy Arceri
On 19/1/19 12:02 pm, Eric Anholt wrote: Timothy Arceri writes: On 11/12/18 5:11 pm, Ian Romanick wrote: On 12/10/18 5:52 PM, Timothy Arceri wrote: On 11/12/18 11:35 am, Ian Romanick wrote: It seems like someone already sent out patches to implement this, and we decided to not take it for

Re: [Mesa-dev] [PATCH] mesa: add EXT_debug_label support

2019-01-18 Thread Timothy Arceri
On 11/12/18 5:11 pm, Ian Romanick wrote: On 12/10/18 5:52 PM, Timothy Arceri wrote: On 11/12/18 11:35 am, Ian Romanick wrote: It seems like someone already sent out patches to implement this, and we decided to not take it for some reason.  Maybe it was Rob? I discovered a thread from the

<    1   2   3   4   5   6   7   8   9   10   >