Re: [Mesa-dev] [PATCH v7 0/6] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-07-31 Thread Gert Wollny
Hi, the patch no longer applies to mesa master. I've pushed the rebased patch set to my github mirror (see below), but should I also send the corrected patches here? Best, Gert Am Montag, den 17.07.2017, 17:47 +0200 schrieb Gert Wollny: > Hello Nicolai, > > many thanks for t

Re: [Mesa-dev] [PATCH] Revert "st_glsl_to_tgsi: rewrite rename registers to use array fully."

2017-08-01 Thread Gert Wollny
> The original code has a loop over num_renames, so if two renames > were in the list in order like > > 8 renames to 4 and 4 renames to 2, then 8 would rename to 2. > however if 4 renamed to 2 then 8 renamed to 4 (not sure if this could > happen), it was different. > > My initial patch fails

Re: [Mesa-dev] [PATCH v6 2/6] mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker

2017-07-17 Thread Gert Wollny
Just a few comments while updating the patch: > One more comment about the debug_log: as written, it will getenv  > every time. It would be better to use the approach taken by e.g.  > should_clone_nir() in compiler/nir/nir.h. There's no reason to have  > a whole class for this. Actually, 

[Mesa-dev] [PATCH v7 1/6] mesa/st: glsl_to_tgsi move some helper classes to extra files

2017-07-17 Thread Gert Wollny
ction *op) -{ - return op->info->is_tex || is_resource_instruction(op->op) ? - op->info->num_src - 1 : op->info->num_src; -} glsl_to_tgsi_instruction * glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, unsigned op, diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_private.cp

[Mesa-dev] [PATCH v7 6/6] mesa/st: glsl_to_tgsi: tie in new temporary register merge approach

2017-07-17 Thread Gert Wollny
This patch replaces the old register lifetime estiamtion and rename mapping evaluation with the new one. Performance to compare between the current and the new implementation were measured by running the shader-db in one thread. ---

[Mesa-dev] [PATCH v7 4/6] mesa/st: glsl_to_tgsi: add register rename mapping evaluator

2017-07-17 Thread Gert Wollny
The remapping evaluator first sorts the temporary registers ascending based on their first life time instruction, and then uses a binary search to find merge canidates. For the initial sorting it uses std::sort because qsort is quite slow in comparison. By removing the define USE_STL_SORT in

[Mesa-dev] [PATCH v7 2/6] mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker

2017-07-17 Thread Gert Wollny
/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp new file mode 100644 index 00..46a707ec74 --- /dev/null +++ b/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp @@ -0,0 +1,881 @@ +/* + * Copyright © 2017 Gert Wollny + * + * Permission is hereby granted, free of charge, to any person

[Mesa-dev] [PATCH v7 0/6] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-07-17 Thread Gert Wollny
for the evaluation. Best, Gert Gert Wollny (6): mesa/st: glsl_to_tgsi move some helper classes to extra files mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker mesa/st: glsl_to_tgsi: add tests for the new temporary lifetime tracker mesa/st: glsl_to_tgsi: add

[Mesa-dev] [PATCH v7 5/6] mesa/st: glsl_to_tgsi: Add test set for evaluation of rename mapping

2017-07-17 Thread Gert Wollny
The patch adds tests for the register rename mapping evaluation and combined life time estimation and renaming. --- .../tests/test_glsl_to_tgsi_lifetime.cpp | 192 + 1 file changed, 192 insertions(+) diff --git

[Mesa-dev] [PATCH v7 3/6] mesa/st: glsl_to_tgsi: add tests for the new temporary lifetime tracker

2017-07-17 Thread Gert Wollny
/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp b/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp new file mode 100644 index 00..b9dadcc03d --- /dev/null +++ b/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp @@ -0,0 +1,1405 @@ +/* + * Copyright © 2017 Gert Wollny

Re: [Mesa-dev] [PATCH v6 0/6] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-07-11 Thread Gert Wollny
Gert Wollny: > Dear Nicolai,  > > this new version of the patch set that should address all the > comments you gave  > for v5. > > Changes are:  > > - the components are now tracked individually and the life time of a > temporary  >   is evaluated by merging t

Re: [Mesa-dev] [PATCH 05/24] st/mesa: unify update_gp/tcp/tep code

2017-07-01 Thread Gert Wollny
Hello Marek, this patch makes most of the tesselation shaders in piglit crash because now you are passing MESA_SHADER_TESS_* to st_get_basic_variant, but this function tests for PIPE_SHADER_TESS_* when allocating new variants. Hence, the function doesn't fulfill the assert in debug mode, or it

[Mesa-dev] [PATCH v6 6/6] mesa/st: glsl_to_tgsi: tie in new temporary register merge approach

2017-07-04 Thread Gert Wollny
This patch replaces the old register lifetime estiamtion and rename mapping evaluation with the new one. Performance to compare between the current and the new implementation were measured by running the shader-db in one thread. ---

[Mesa-dev] [PATCH v6 2/6] mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker

2017-07-04 Thread Gert Wollny
b/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp new file mode 100644 index 00..f85a6fa7c9 --- /dev/null +++ b/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp @@ -0,0 +1,949 @@ +/* + * Copyright © 2017 Gert Wollny + * + * Permission is hereby granted, free of charge, to any

[Mesa-dev] [PATCH v6 4/6] mesa/st: glsl_to_tgsi: add register rename mapping evaluator

2017-07-04 Thread Gert Wollny
The remapping evaluator first sorts the temporary registers ascending based on their first life time instruction, and then uses a binary search to find merge canidates. For the initial sorting it uses std::sort because qsort is quite slow in comparison. By removing the define USE_STL_SORT in

[Mesa-dev] [PATCH v6 3/6] mesa/st: glsl_to_tgsi: add tests for the new temporary lifetime tracker

2017-07-04 Thread Gert Wollny
/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp b/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp new file mode 100644 index 00..d99176e86c --- /dev/null +++ b/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp @@ -0,0 +1,1364 @@ +/* + * Copyright © 2017 Gert Wollny

[Mesa-dev] [PATCH v6 5/6] mesa/st: glsl_to_tgsi: Add test set for evaluation of rename mapping

2017-07-04 Thread Gert Wollny
The patch adds tests for the register rename mapping evaluation and combined life time estimation and renaming. --- .../tests/test_glsl_to_tgsi_lifetime.cpp | 192 + 1 file changed, 192 insertions(+) diff --git

[Mesa-dev] [PATCH v6 1/6] mesa/st: glsl_to_tgsi move some helper classes to extra files

2017-07-04 Thread Gert Wollny
ction *op) -{ - return op->info->is_tex || is_resource_instruction(op->op) ? - op->info->num_src - 1 : op->info->num_src; -} glsl_to_tgsi_instruction * glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, unsigned op, diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_private.cp

[Mesa-dev] [PATCH v6 0/6] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-07-04 Thread Gert Wollny
writing a shader that really needs it and I think I will submit this to piglit. best regards, Gert Gert Wollny (6): mesa/st: glsl_to_tgsi move some helper classes to extra files mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker mesa/st: glsl_to_tgsi: add tests

Re: [Mesa-dev] [PATCH v5 2/6] mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker

2017-06-28 Thread Gert Wollny
+0200 schrieb Nicolai Hähnle: > On 27.06.2017 11:32, Gert Wollny wrote: > > Yes, I also mean below. Okay, done. > > > [snip] > > > +  case TGSI_OPCODE_CONT: { > > > > + cur_scope->set_continue_line(line); > > > > > > I

Re: [Mesa-dev] [PATCH] Revert "st_glsl_to_tgsi: rewrite rename registers to use array fully."

2017-07-31 Thread Gert Wollny
Am Dienstag, den 01.08.2017, 09:32 +1000 schrieb Dave Airlie: > From: Dave Airlie > > This reverts commit 3008161d28e38336ba39aba4769a2deaf9732f55, > which caused a regression for VMWare. > > The initial code had some recursion in it, that I removed by accident > trying to

[Mesa-dev] [PATCH v8 3/7] mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker

2017-08-07 Thread Gert Wollny
/st_glsl_to_tgsi_temprename.cpp new file mode 100644 index 00..46a707ec74 --- /dev/null +++ b/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp @@ -0,0 +1,881 @@ +/* + * Copyright © 2017 Gert Wollny + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software

[Mesa-dev] [PATCH v8 5/7] mesa/st: glsl_to_tgsi: add register rename mapping evaluator

2017-08-07 Thread Gert Wollny
The remapping evaluator first sorts the temporary registers ascending based on their first life time instruction, and then uses a binary search to find merge canidates. For the initial sorting it uses std::sort because qsort is quite slow in comparison. By removing the define USE_STL_SORT in

[Mesa-dev] [PATCH v8 6/7] mesa/st: glsl_to_tgsi: Add test set for evaluation of rename mapping

2017-08-07 Thread Gert Wollny
The patch adds tests for the register rename mapping evaluation and combined life time estimation and renaming. --- .../tests/test_glsl_to_tgsi_lifetime.cpp | 192 + 1 file changed, 192 insertions(+) diff --git

[Mesa-dev] [PATCH v8 1/7] st_glsl_to_tgsi: rewrite rename registers to use array fully.

2017-08-07 Thread Gert Wollny
From: Dave Airlie Instead of having to search the whole array, just use the whole thing and store a valid bit in there with the rename. Removes this from the profile on some of the fp64 tests Reviewed-by: Timothy Arceri Signed-off-by: Dave Airlie

[Mesa-dev] [PATCH v8 2/7] mesa/st: glsl_to_tgsi move some helper classes to extra files

2017-08-07 Thread Gert Wollny
instruction *op) -{ - return op->info->is_tex || is_resource_instruction(op->op) ? - op->info->num_src - 1 : op->info->num_src; -} glsl_to_tgsi_instruction * glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, unsigned op, diff --git a/src/mesa/state_tracker/st_gl

[Mesa-dev] [PATCH v8 4/7] mesa/st: glsl_to_tgsi: add tests for the new temporary lifetime tracker

2017-08-07 Thread Gert Wollny
© 2017 Gert Wollny + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction,including without limitation + * the rights to use, copy, mod

[Mesa-dev] [PATCH v8 0/7] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-08-07 Thread Gert Wollny
ert Dave Airlie (1): st_glsl_to_tgsi: rewrite rename registers to use array fully. Gert Wollny (6): mesa/st: glsl_to_tgsi move some helper classes to extra files mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker mesa/st: glsl_to_tgsi: add tests for the new tempor

[Mesa-dev] [PATCH v8 7/7] mesa/st: glsl_to_tgsi: tie in new temporary register merge approach

2017-08-07 Thread Gert Wollny
This patch replaces the old register lifetime estiamtion and rename mapping evaluation with the new one. Performance to compare between the current and the new implementation were measured by running the shader-db in one thread. ---

Re: [Mesa-dev] [PATCH 00/18] Gallium blitter optimizations

2017-08-19 Thread Gert Wollny
Am Freitag, den 18.08.2017, 18:25 +0200 schrieb Marek Olšák: > > Sure. The changes are here: > https://cgit.freedesktop.org/~mareko/mesa/log/?h=blitter-optz > > If somebody wants to test it on r600g, that would be appreciated too. > > I did this and unfortunately it crashes with 744c3e2254

Re: [Mesa-dev] [PATCH] glsl: set old ldexp operand to NULL when lowering

2017-08-17 Thread Gert Wollny
Am Freitag, den 18.08.2017, 09:43 +1000 schrieb Timothy Arceri: > This fixes an assert during IR validation in LLVMpipe. > > Fixes: e2e2c5abd279 (glsl: calculate number of operands in an > expression once) > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102274 > Cc: Brian Paul

Re: [Mesa-dev] [PATCH 00/18] Gallium blitter optimizations

2017-08-19 Thread Gert Wollny
Am Samstag, den 19.08.2017, 12:13 +0200 schrieb Gert Wollny: > > I did this and unfortunately it crashes with 744c3e2254 applied. > Specifically, in   > >    src/gallium/drivers/r600/evergreen_state.c2302:  >    evergreen_emit_vertex_fetch_shader  > > de-referenc

[Mesa-dev] regarding mesa/state_tracker/glsl_to_tgsi register renaming

2017-06-08 Thread Gert Wollny
Dear all, (and specifically to Dave Arlie), when looking at the TGSI code of shaders that fail on r600g because of too many temporaries used, I notes that often their lifetime is very short, like just assigned in one line and read the only time in the next line. Looking on the

Re: [Mesa-dev] [PATCH 0/3] [RFC] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-12 Thread Gert Wollny
Hello Nicolai, Am Montag, den 12.06.2017, 12:17 +0200 schrieb Nicolai Hähnle: > > spec/arb_shader_bit_encoding/execution/and-clamp: fail fail pass > > fail > > > > > > > It's disconcerting that you have tests here whose pass status is  > unstable. Those tests really should be deterministic.

Re: [Mesa-dev] [PATCH 0/3] [RFC] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-12 Thread Gert Wollny
Am Montag, den 12.06.2017, 12:28 +0200 schrieb Nicolai Hähnle: > On 10.06.2017 01:15, Gert Wollny wrote: > > > Plenty of style issues aside, can you explain where and why you get  > tighter lifetimes? In the original code if a temporary is used within a loop it gets the

[Mesa-dev] [PATCH 3/3] mesa/st: glsl_to_tgsi: tie in the new register renaming approach

2017-06-09 Thread Gert Wollny
This patch replaces the old register livetime estimation with the new approach. --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp

[Mesa-dev] [PATCH 2/3] mesa/st: glsl_to_tgsi Implement a new lifetime tracker for temporaries

2017-06-09 Thread Gert Wollny
/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp new file mode 100644 index 00..389a4b6b5f --- /dev/null +++ b/src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp @@ -0,0 +1,551 @@ +/* + * Copyright © 2017 Gert Wollny + * + * Permission is hereby granted, free of charge, to any person

[Mesa-dev] [PATCH 1/3] mesa/st: glsl_to_tgsi move some helper classes to extra files

2017-06-09 Thread Gert Wollny
->op) ? - op->info->num_src - 1 : op->info->num_src; -} glsl_to_tgsi_instruction * glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, unsigned op, diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi_private.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi_private.cpp new file mode

[Mesa-dev] [PATCH 0/3] [RFC] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-09 Thread Gert Wollny
no commit rights. many thanks, Gert [1] http://www.geeks3d.com/gputest/ Gert Wollny (3): mesa/st: glsl_to_tgsi move some helper classes to extra files mesa/st: glsl_to_tgsi Implement a new lifetime tracker for temporaries mesa/st: glsl_to_tgsi: tie in the new register renaming approach co

[Mesa-dev] [PATCH v4 2/6] mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker

2017-06-21 Thread Gert Wollny
@@ +/* + * Copyright © 2017 Gert Wollny + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, co

[Mesa-dev] [PATCH v4 1/6] mesa/st: glsl_to_tgsi move some helper classes to extra files

2017-06-21 Thread Gert Wollny
glsl_to_tgsi_instruction *op) -{ - return op->info->is_tex || is_resource_instruction(op->op) ? - op->info->num_src - 1 : op->info->num_src; -} glsl_to_tgsi_instruction * glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, unsigned op, diff --git a/src/mesa/state

[Mesa-dev] [PATCH v4 6/6] mesa/st: glsl_to_tgsi: tie in new temporary register merge approach

2017-06-21 Thread Gert Wollny
This patch ties in the new temporary register lifetime estiamtion and rename mapping evaluation. In order to enable it, the evironment variable MESA_GLSL_TO_TGSI_NEW_MERGE must be set. Performance to compare between the current and the new implementation were measured by running the shader-db in

[Mesa-dev] [PATCH v4 4/6] mesa/st: glsl_to_tgsi: add register renamame mapping evaluator

2017-06-21 Thread Gert Wollny
The remapping evaluator first sorts the temporary registers ascending based on their first life time instruction, and then uses a binary search to find merge canidates. For the initial sorting it uses std::sort because qsort is quite slow in comparison. By removing the define USE_STL_SORT in

[Mesa-dev] [PATCH v4 3/6] mesa/st: glsl_to_tgsi: add tests for the new temporary lifetime tracker

2017-06-21 Thread Gert Wollny
/test_glsl_to_tgsi_lifetime.cpp new file mode 100644 index 00..5f3378637a --- /dev/null +++ b/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp @@ -0,0 +1,976 @@ +/* + * Copyright © 2017 Gert Wollny + * + * Permission is hereby granted, free of charge, to any person obtaining

[Mesa-dev] [PATCH v4 0/6] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-21 Thread Gert Wollny
ndications that registers would be megrged wrongly. Many thanks for any commenst, Gert ** BLURB HERE *** Gert Wollny (6): mesa/st: glsl_to_tgsi move some helper classes to extra files mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker mesa/st: glsl_to_tgsi:

[Mesa-dev] [PATCH v4 5/6] mesa/st: glsl_to_tgsi: Add test set for evaluation of rename mapping

2017-06-21 Thread Gert Wollny
The patch adds tests for the register rename mapping evaluation. --- .../tests/test_glsl_to_tgsi_lifetime.cpp | 94 ++ 1 file changed, 94 insertions(+) diff --git a/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp

Re: [Mesa-dev] [PATCH v4 2/6] mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker

2017-06-22 Thread Gert Wollny
Thanks for the comments, I've fixed these little issues locally, but I think in order to not to spam the list, I'll send the changes later. I kind of suspect that Nicolai might have one or the other additional comment :) best, Gert ___ mesa-dev

[Mesa-dev] [PATCH v5 5/6] mesa/st: glsl_to_tgsi: Add test set for evaluation of rename mapping

2017-06-25 Thread Gert Wollny
The patch adds tests for the register rename mapping evaluation. --- .../tests/test_glsl_to_tgsi_lifetime.cpp | 94 ++ 1 file changed, 94 insertions(+) diff --git a/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp

[Mesa-dev] [PATCH v5 3/6] mesa/st: glsl_to_tgsi: add tests for the new temporary lifetime tracker

2017-06-25 Thread Gert Wollny
/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp b/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp new file mode 100644 index 00..5f3378637a --- /dev/null +++ b/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp @@ -0,0 +1,976 @@ +/* + * Copyright © 2017 Gert Wollny

[Mesa-dev] [PATCH v5 4/6] mesa/st: glsl_to_tgsi: add register renamame mapping evaluator

2017-06-25 Thread Gert Wollny
The remapping evaluator first sorts the temporary registers ascending based on their first life time instruction, and then uses a binary search to find merge canidates. For the initial sorting it uses std::sort because qsort is quite slow in comparison. By removing the define USE_STL_SORT in

[Mesa-dev] [PATCH v5 1/6] mesa/st: glsl_to_tgsi move some helper classes to extra files

2017-06-25 Thread Gert Wollny
glsl_to_tgsi_instruction *op) -{ - return op->info->is_tex || is_resource_instruction(op->op) ? - op->info->num_src - 1 : op->info->num_src; -} glsl_to_tgsi_instruction * glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, unsigned op, diff --git a/src/mesa/state

[Mesa-dev] [PATCH v5 6/6] mesa/st: glsl_to_tgsi: tie in new temporary register merge approach

2017-06-25 Thread Gert Wollny
This patch ties in the new temporary register lifetime estiamtion and rename mapping evaluation. In order to enable it, the evironment variable MESA_GLSL_TO_TGSI_NEW_MERGE must be set. Performance to compare between the current and the new implementation were measured by running the shader-db in

[Mesa-dev] [PATCH v5 2/6] mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker

2017-06-25 Thread Gert Wollny
@@ +/* + * Copyright © 2017 Gert Wollny + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, co

[Mesa-dev] [PATCH v5 0/6] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-25 Thread Gert Wollny
without noting any regressions. As noted before, I don't have write access to mesa-git, so I'll need someone who sponsors this patch. Many thanks for any additional comments, Gert Gert Wollny (6): mesa/st: glsl_to_tgsi move some helper classes to extra files mesa/st: glsl_to_tgsi

Re: [Mesa-dev] [PATCH v5 2/6] mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker

2017-06-27 Thread Gert Wollny
Thanks for your comments Am Montag, den 26.06.2017, 14:52 +0200 schrieb Nicolai Hähnle: > Thanks for the update. First off, you're still not tracking > individual  > components, but that's absolute necessary. Think: > > BGNLOOP >    MOV TEMP[1].x, ... > >    UIF ... >  MOV TEMP[1].y, ...

[Mesa-dev] r600: Regarding "Failed to build shader (translation from TGSI) #99349

2017-05-29 Thread Gert Wollny
Hello all,  Hardware; Radeon 6850HD,  Mesa: mesa 17.0.1 and git (sha 531887),  llvm: 4.0.0 Playing a bit around with the Unreal Editor I was confronted with the same error message reported in #99349, i.e. "Failed to build shader (translation from TGSI).  After some digging though the code I

[Mesa-dev] [PATCH 0/1] r600g: work around shaders allocating too many superflous temporaries

2017-05-30 Thread Gert Wollny
mments, Gert Wollny (1): r600g: work around shaders allocating too many superflous temporaries src/gallium/drivers/r600/r600_shader.c | 52 +++--- 1 file changed, 42 insertions(+), 10 deletions(-) -- 2.13.0 ___ mesa-dev m

[Mesa-dev] [PATCH 1/1] r600g: work around shaders allocating too many superflous temporaries

2017-05-30 Thread Gert Wollny
Related bugs: https://bugs.freedesktop.org/show_bug.cgi?id=99349 https://bugs.freedesktop.org/show_bug.cgi?id=50338 1. Allocate ctx.temp_reg and a limited number of registers (R600_TEMP_REG_RESERVED=10) that are given out via r600_get_temp() before the temporaries of the TGSI are allocated. That

Re: [Mesa-dev] [PATCH 0/1] r600g: work around shaders allocating too many superflous temporaries

2017-06-01 Thread Gert Wollny
Hello, I should probably add that I don't have write access to the mesa-git. Best,  Gert Am Dienstag, den 30.05.2017, 14:14 +0200 schrieb Gert Wollny: > Dear all, > > like I pointed out yesterday I've got a workaround for shaders that > allocate > too many temporaries afte

Re: [Mesa-dev] [PATCH 0/3] [RFC] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-13 Thread Gert Wollny
Am Montag, den 12.06.2017, 21:00 +0200 schrieb Nicolai Hähnle: Thanks for you comments, although I do not agree with most of them. > > > Okay. I think you should seriously re-think your algorithm in a way > > that  makes it a more natural evolution from the algorithm that's > > already there.

Re: [Mesa-dev] [PATCH 0/3] [RFC] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-11 Thread Gert Wollny
into this. Best, Gert > > > > Marek > > > > On Sat, Jun 10, 2017 at 1:15 AM, Gert Wollny <gw.foss...@gmail.com> > > wrote: > > > Dear all, > > > > > > as I wrote before, I was looking into the temporary register > > > ren

Re: [Mesa-dev] [PATCH 0/3] [RFC] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-12 Thread Gert Wollny
Am Sonntag, den 11.06.2017, 19:21 +0200 schrieb Gert Wollny: > > > > > > > Have you measured the CPU overhead of the new code? > > So far no, I guess one would do that with the shader-db to get > reasonable complex shaders, but I only have a r600 based card so I'

Re: [Mesa-dev] [PATCH 0/3] [RFC] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-12 Thread Gert Wollny
Am Montag, den 12.06.2017, 15:44 +0900 schrieb Michel Dänzer: > On 10/06/17 08:15 AM, Gert Wollny wrote: > > > > Piglit shows 7 fixes and 6 regressions compared to git 8fac894f, > > but they don't > > seem to be related to shaders. > > Which tests regressed (m

Re: [Mesa-dev] [PATCH 0/3] [RFC] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-14 Thread Gert Wollny
Am Dienstag, den 13.06.2017, 11:07 +0200 schrieb Nicolai Hähnle: > > > I'm curious what you'd suggest for getting rid of allocations anyway. As the refactoring goes I think I will end up with a hybrid approach: In the temporaries I will not keep the full time line, but the important read/write

[Mesa-dev] [PATCH v2 2/3] mesa/st: glsl_to_tgsi Implement a new lifetime tracker for temporaries

2017-06-16 Thread Gert Wollny
@@ -0,0 +1,202 @@ +/* + * Copyright © 2010 Intel Corporation + * Copyright © 2011 Bryan Cain + * Copyright © 2017 Gert Wollny + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), +

[Mesa-dev] [PATCH v2 3/3] mesa/st: glsl_to_tgsi: tie in the new register renaming approach

2017-06-16 Thread Gert Wollny
This patch replaces the old register livetime estimation with the new approach. --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp

[Mesa-dev] [PATCH v2 1/3] mesa/st: glsl_to_tgsi move some helper classes to extra files

2017-06-16 Thread Gert Wollny
To prepare the implementation of a temp register lifetime tracker some of the classes and functions are moved into seperate header/ implementation files to make them accessible from other files. Specifically these are: class st_src_reg; class st_dst_reg; class glsl_to_tgsi_instruction;

[Mesa-dev] [PATCH v2 0/3][RFC]mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-16 Thread Gert Wollny
any thanks for any comments, Gert Gert Wollny (3): mesa/st: glsl_to_tgsi move some helper classes to extra files mesa/st: glsl_to_tgsi Implement a new lifetime tracker for temporaries mesa/st: glsl_to_tgsi: tie in the new register renaming approach co

Re: [Mesa-dev] [PATCH v2 0/3][RFC]mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-16 Thread Gert Wollny
Hello Emil, Am Freitag, den 16.06.2017, 15:21 +0100 schrieb Emil Velikov: > > Please don't use STL within core mesa code. May I ask why? I always try to not re-implement already available functionality and since mesa already uses C++ it seems kind of natural to use the STL because it provides

Re: [Mesa-dev] [PATCH v3 0/7] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-18 Thread Gert Wollny
+0200 schrieb Gert Wollny: > Dear all, > > following the comments of Emil and Nicolai I've updated the patch > set.  > > Changes with respect to the old version are:  > > - split the changes into more patches  > - correct formatting errors > - remove the use of the

[Mesa-dev] [PATCH v3 4/7] mesa/st: glsl_to_tgsi: add tests for the new temporary lifetime tracker

2017-06-18 Thread Gert Wollny
/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp new file mode 100644 index 00..7e07f8868f --- /dev/null +++ b/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp @@ -0,0 +1,969 @@ +/* + * Copyright © 2017 Gert Wollny + * + * Permission is hereby granted, free of charge

[Mesa-dev] [PATCH v3 1/7] mesa/st: glsl_to_tgsi move some helper classes to extra files

2017-06-18 Thread Gert Wollny
glsl_to_tgsi_instruction *op) -{ - return op->info->is_tex || is_resource_instruction(op->op) ? - op->info->num_src - 1 : op->info->num_src; -} glsl_to_tgsi_instruction * glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, unsigned op, diff --git a/src/mesa/state

[Mesa-dev] [PATCH v3 6/7] mesa/st: glsl_to_tgsi: Add test set for evaluation of rename mapping

2017-06-18 Thread Gert Wollny
The patch adds tests for the register rename mapping evaluation. --- .../tests/test_glsl_to_tgsi_lifetime.cpp | 71 -- 1 file changed, 66 insertions(+), 5 deletions(-) diff --git a/src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp

[Mesa-dev] [PATCH v3 3/7] mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker

2017-06-18 Thread Gert Wollny
@@ +/* + * Copyright © 2017 Gert Wollny + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, co

[Mesa-dev] [PATCH v3 5/7] mesa/st: glsl_to_tgsi: add register renamame mapping evaluator

2017-06-18 Thread Gert Wollny
The remapping evaluator first sorts the temporary registers ascending based on their first life time instruction, and then uses a binary search to find merge canidates. For the initial sorting it uses std::sort because qsort is quite slow in comparison. By removing the define USE_STL_SORT in

[Mesa-dev] [PATCH v3 2/7] mesa: Propagate c++11 CXXFLAGS from LLVM_CXXFLAGS to mesa/

2017-06-18 Thread Gert Wollny
For the new register renaming approach C++11 is wanted. --- src/mesa/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am index 53f311d2a9..3339926d93 100644 --- a/src/mesa/Makefile.am +++ b/src/mesa/Makefile.am @@ -101,7

[Mesa-dev] [PATCH v3 7/7] mesa/st: glsl_to_tgsi: tie in new temporary register merge approach

2017-06-18 Thread Gert Wollny
This patch ties in the new temporary register lifetime estiamtion and rename mapping evaluation. In order to enable it, the evironment variable MESA_GLSL_TO_TGSI_NEW_MERGE must be set. Performance to compare between the current and the new implementation were measured by running the shader-db in

Re: [Mesa-dev] [PATCH v2 2/3] mesa/st: glsl_to_tgsi Implement a new lifetime tracker for temporaries

2017-06-18 Thread Gert Wollny
Hello Dieter, > W'll start with your attachment > https://bugs.freedesktop.org/attachment.cgi?id=131683 This one is a dirty hack that works around the use of too many registers mostly by allowing to allocate more than the allowed limit and let the bytecode optimizer sort it out (there is also

[Mesa-dev] [PATCH v3 0/7] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-18 Thread Gert Wollny
r register-renaming. The performance numbers estimated by running the shader-db are given in the commit message of the last patch, the trend is the same like reported before. Many thanks for any commenst, Gert Gert Wollny (7): mesa/st: glsl_to_tgsi move some helper classes to extra files mesa:

Re: [Mesa-dev] [PATCH v2 2/3] mesa/st: glsl_to_tgsi Implement a new lifetime tracker for temporaries

2017-06-19 Thread Gert Wollny
Hi, > > >+typedef int scope_idx; > > > > > > Please remove this, it's an unnecessary and distracting > > > abstraction that  doesn't gain you anything. > > > > Actually, with the refactoring it did the last two days it helped a > > lot. > > How? Perhaps your variable names stand to be

Re: [Mesa-dev] [PATCH v2 2/3] mesa/st: glsl_to_tgsi Implement a new lifetime tracker for temporaries

2017-06-18 Thread Gert Wollny
Hello Nicolai, Am Sonntag, den 18.06.2017, 12:05 +0200 schrieb Nicolai Hähnle: >    > >   if HAVE_XLIB_GLX > >   SUBDIRS += drivers/x11 > > @@ -101,7 +101,7 @@ AM_CFLAGS = \ > >    $(VISIBILITY_CFLAGS) \ > >    $(MSVC2013_COMPAT_CFLAGS) > >   AM_CXXFLAGS = \ > > - $(LLVM_CFLAGS) \ > > + 

Re: [Mesa-dev] [PATCH v5 3/6] mesa/st: glsl_to_tgsi: add tests for the new temporary lifetime tracker

2017-06-27 Thread Gert Wollny
> > +TEST_F(LifetimeEvaluatorExactTest, SimpleMoveAddMoveTexoffset) > > +{ > > +   const vector code = { > > +  { TGSI_OPCODE_MOV, {1}, {in0}, {}}, > > +  { TGSI_OPCODE_MOV, {2}, {in1}, {}}, > > +  { TGSI_OPCODE_UADD, {out0}, {},  {1,2}}, > > UADD doesn't have texoffsets. The test

Re: [Mesa-dev] [PATCH v5 0/6] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

2017-06-27 Thread Gert Wollny
Am Montag, den 26.06.2017, 15:13 +0200 schrieb Nicolai Hähnle: > Thanks for the update. Do you have the series on an accessible git  > repository somewhere? E.g. on GitHub or Gitlab or wherever? That > would be helpful. I've put the code on https://github.com/gerddie/mesa and I am already

Re: [Mesa-dev] [PATCH] st/glsl_to_tgsi: fix theoretical memory leak

2017-09-14 Thread Gert Wollny
Sorry for the lapse and thanks for fixing it. Reviewed-By: Gert Wollny <gw.foss...@gmail.com> Am Mittwoch, den 13.09.2017, 19:05 +0200 schrieb Nicolai Hähnle: > From: Nicolai Hähnle <nicolai.haeh...@amd.com> > > It can't *really* happen since we don't use subrout

[Mesa-dev] [PATCH v2 2/2] .travis.yml: Add libunwind-dev to gallium/make builds

2017-09-14 Thread Gert Wollny
libunwind is a optional dependency used by the gallium aux module (libgallium) and consequently the final binaries must be linked against it. To test whether the library is properly specified in the link pass add it to the travis-ci build environment and force its use. --- .travis.yml | 11

[Mesa-dev] [PATCH v2 1/2] .travis.yml: force llvm-3.3 for "make Gallium ST Other"

2017-09-14 Thread Gert Wollny
In Ubuntu Trusty the default version of llvm is 3.4 and the build was actually randomly picking 3.5 or 3.9. Adding libunwind would then result is build success or failure depending of what version was picked. Install the llvm-3.3-dev package and force its use: On one hand it is the minimum

[Mesa-dev] [PATCH v2 0/2] Add libunwind to travis gallium build and fix it

2017-09-14 Thread Gert Wollny
The second version of the two patches now forces llvm-3.3 for "make Gallium ST Other" and no longer requires changing any Makefile.am. In addition, like suggested by Emil, --enable/disable-libunwind is set appropriately. Best, Gert Gert Wollny (2): .travis.yml: force llvm-3.3

Re: [Mesa-dev] [PATCH v2 0/2] Add libunwind to travis gallium build and fix it

2017-09-15 Thread Gert Wollny
Am Freitag, den 15.09.2017, 13:07 +0100 schrieb Emil Velikov: > On 14 September 2017 at 11:27, Gert Wollny <gw.foss...@gmail.com> > wrote: > > The second version of the two patches now forces llvm-3.3 for > > "make Gallium ST Other" and no longer req

[Mesa-dev] [PATCH v2] r600g/sb: Don't require array declarations for TGSI_FILE_SYSTEM_VALUE

2017-09-14 Thread Gert Wollny
Although gl_SampleMaskIn is declared as an array in GLSL, it is effectively a 32 bit mask on all hardware supported by mesa, so the array indexing is ignored (Thanks Glenn Kennard for the explanation). Add a comment that the assert is not made superfluos by the else branch. Corrects: piglit

[Mesa-dev] [PATCH] gbm: Add gbm_device_get_format_modifier_plane_count to test

2017-09-16 Thread Gert Wollny
Adding gbm_device_get_format_modifier_plane_count made the test gbm-symbols-check fail, this patch adds the according function name to the test. Fixes: 8824141b8d48d9120ddbf542d6fb661046c41c62 (gbm: Add a gbm_device_get_format_modifier_plane_count function) Signed-off-by: Gert Wollny <gw.f

[Mesa-dev] Breaks building with llvm-3.6, was: [PATCH 1/1] clover: Fix build after LLVM r313390

2017-09-16 Thread Gert Wollny
Am Freitag, den 15.09.2017, 21:41 -0400 schrieb Jan Vesely: [...] > > > > > a/src/gallium/state_trackers/clover/llvm/compat.hpp > > > > > b/src/gallium/state_trackers/clover/llvm/compat.hpp > > > > > index b22ecfa6b2..9bca6d82e8 100644 > > > > > ---

[Mesa-dev] [PATCH] configure+mesa/st/tests: avoid building with pre c++11 compilers

2017-09-16 Thread Gert Wollny
The tests in mesa/st/tests require C++11. Check whether the compiler supports the -std=c++11 flag and if so, enable the tests. Otherwise skip compiling and running the tests altogether. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102665 --- - Submitter has no write access to mesa-git.

Re: [Mesa-dev] [PATCH 1/7] clover: add missing include to compat.h

2017-09-17 Thread Gert Wollny
Compiles fine with this patch, Tested-by: Gert Wollny <gw.foss...@gmail.com> Am Samstag, den 16.09.2017, 22:05 -0400 schrieb Jan Vesely: > Fixes build issues with llvm-3.6 > Fixes: 3115687f9b9830417c408228db2bc679e346bba6 (clover: Fix build > after > LLVM r313390) > > S

[Mesa-dev] [PATCH v2] configure+mesa/st: check -std=c++11 support and enable tests accordingly

2017-09-17 Thread Gert Wollny
The tests in mesa/st/tests require C++11. Check whether the compiler supports the -std=c++11 flag and if so, enable the tests. Otherwise skip compiling and running the tests altogether. Fixes: 7be6d8fe12 ("mesa/st: glsl_to_tgsi: add tests for the new temporary lifetime tracker") Bugzilla:

Re: [Mesa-dev] [PATCH v2] configure+mesa/st: check -std=c++11 support and enable tests accordingly

2017-09-18 Thread Gert Wollny
Am Montag, den 18.09.2017, 16:07 +0100 schrieb Emil Velikov: > Hi Gert, > > On 17 September 2017 at 08:32, Gert Wollny <gw.foss...@gmail.com> > wrote: > > The tests in mesa/st/tests require C++11. Check whether the > > compiler > > supports the -std=c+

[Mesa-dev] [PATCH v3 1/2] configure+mesa/st: unify check for -std=c++11 support and enable accordingly

2017-09-19 Thread Gert Wollny
oy Stogner <royst...@ices.utexas.edu> +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <soko...@google.com> +# Copyright (c) 2015 Paul Norman <penor...@mac.com> +# Copyright (c) 2015 Moritz Klammler <mor...@klammler.eu> +# Copyright (c) 2016 Krzesimir

[Mesa-dev] [PATCH v3 0/2] build system: Unify c++11 detection and used [was: configure+mesa/st:check -std=c++11 support and enable tests accordingly]

2017-09-19 Thread Gert Wollny
then adds a test to see whether the mesa/st tests are not build with a compilet that doesn't offer -std=c++11 support. Best, Gert -- - Submitter has no mesa-git write access Gert Wollny (2): configure+mesa/st: unify check for -std=c++11 support and enable accordingly travis: Add test

[Mesa-dev] [PATCH v3 2/2] travis: Add test for gcc-4.4 compiler tool chain

2017-09-19 Thread Gert Wollny
Add a build check for g++-4.4 which is the oldest gcc based compiler directly supported in ubuntu/trusty, and one of the compilers that don't have full c++11 support, i.e. it doesn't understand -std=c++11. Since llvm >= 3.9 propagates -std=c++11 in the LLVM_CXXFLAGS, an older llvm version is

Re: [Mesa-dev] [PATCH 2/2] radeonsi: remove useless check in si_blit_decompress_color()

2017-09-22 Thread Gert Wollny
Am Freitag, den 22.09.2017, 09:22 +0200 schrieb Samuel Pitoiset: > That's unnecessary to double-check that dcc_offset is not 0 > because all callers already check that. In that case I would suggest to add an assert(rtex->dcc_offset) to ensure this. Best, Gert > > Signed-off-by: Samuel

Re: [Mesa-dev] [PATCH 0/6] glsl_to_tgsi: Further improvement of lifetime tracking for register merge

2017-10-05 Thread Gert Wollny
04.10.2017, 11:45 +0200 schrieb Gert Wollny: > Dear all, > > this set of patches fixes some memory leak in mesa/st/tests, enhances > the debugging output used in the temporary register lifetime > estimation, and further improves the lifetime tracking by handling > if-else pat

  1   2   3   4   5   6   7   8   9   >