<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Aug 24, 2017 1:21 PM, "Nicolai Hähnle" <<a href="mailto:nhaehnle@gmail.com">nhaehnle@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On <a href="tel:24.08.2017%2012" value="+12408201712" target="_blank">24.08.2017 12</a>:34, Marek Olšák wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">
<br>
<br>
On Aug 24, 2017 10:17 AM, "Nicolai Hähnle" <<a href="mailto:nhaehnle@gmail.com" target="_blank">nhaehnle@gmail.com</a> <mailto:<a href="mailto:nhaehnle@gmail.com" target="_blank">nhaehnle@gmail.com</a>>> wrote:<br>
<br>
On 23.08.2017 22:44, Marek Olšák wrote:<br>
<br></div>
From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a> <mailto:<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>>><div class="elided-text"><br>
<br>
---<br>
src/gallium/drivers/radeonsi/<wbr>si_shader.c | 17 ++++++++++++++++-<br>
1 file changed, 16 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/gallium/drivers/radeonsi<wbr>/si_shader.c<br>
b/src/gallium/drivers/radeonsi<wbr>/si_shader.c<br>
index f02fc9e..186a3dd 100644<br>
--- a/src/gallium/drivers/radeonsi<wbr>/si_shader.c<br>
+++ b/src/gallium/drivers/radeonsi<wbr>/si_shader.c<br>
@@ -5029,21 +5029,36 @@ static void si_shader_dump_stats(struct<br>
si_screen *sscreen,<br>
struct pipe_debug_callback *debug,<br>
unsigned processor,<br>
FILE *file,<br>
bool check_debug_option)<br>
{<br>
const struct si_shader_config *conf = &shader->config;<br>
unsigned num_inputs = shader->selector ?<br>
shader->selector->info.num_inp<wbr>uts : 0;<br>
unsigned code_size = si_get_shader_binary_size(shad<wbr>er);<br>
unsigned lds_increment = sscreen->b.chip_class >= CIK ?<br>
512 : 256;<br>
unsigned lds_per_wave = 0;<br>
- unsigned max_simd_waves = 10;<br>
+ unsigned max_simd_waves;<br>
+<br>
+ switch (sscreen->b.family) {<br>
+ /* SGPR initialization bug workaround on Tonga and<br>
Iceland reduces<br>
+ * the wave count to 8. */<br>
+ case CHIP_TONGA:<br>
+ case CHIP_ICELAND:<br>
+ /* These always have 8 waves: */<br>
+ case CHIP_POLARIS10:<br>
+ case CHIP_POLARIS11:<br>
+ case CHIP_POLARIS12:<br>
+ max_simd_waves = 8;<br>
<br>
<br>
This should be implied by the num_sgprs set by LLVM, though.<br>
<br>
<br>
I have no idea what you mean or why it's relevant.<br>
</div></blockquote>
<br>
There's this code later in the function:<br>
<br>
if (conf->num_sgprs) {<br>
if (sscreen->b.chip_class >= VI)<br>
max_simd_waves = MIN2(max_simd_waves, 800 / conf->num_sgprs);<br>
else<br>
max_simd_waves = MIN2(max_simd_waves, 512 / conf->num_sgprs);<br>
}<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Yes, but that's alright. Why is it important? num_sgprs is always nonzero.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br>
Also, what do you mean by Polaris always having 8 waves?<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">The closed Vulkan driver source code says that.</div><div dir="auto"><br></div><div dir="auto">Marek</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
Nicolai<div class="elided-text"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Marek<br>
<br>
<br>
Cheers,<br>
Nicolai<br>
<br>
<br>
<br>
+ break;<br>
+ default:<br>
+ max_simd_waves = 10;<br>
+ }<br>
/* Compute LDS usage for PS. */<br>
switch (processor) {<br>
case PIPE_SHADER_FRAGMENT:<br>
/* The minimum usage per wave is (num_inputs *<br>
48). The maximum<br>
* usage is (num_inputs * 48 * 16).<br>
* We can get anything in between and it varies<br>
between waves.<br>
*<br>
* The 48 bytes per input for a single<br>
primitive is equal to<br>
* 4 bytes/component * 4 components/input * 3<br>
points.<br>
<br>
<br>
<br>
-- Lerne, wie die Welt wirklich ist,<br>
Aber vergiss niemals, wie sie sein sollte.<br>
<br>
<br>
</blockquote>
<br>
<br>
-- <br>
Lerne, wie die Welt wirklich ist,<br>
Aber vergiss niemals, wie sie sein sollte.<br>
</div></blockquote></div><br></div></div></div>