dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: bugzilla-daemon@freedesktop.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 99349] Failed to build shader (translation from TGSI)
Date: Fri, 26 May 2017 09:01:01 +0000	[thread overview]
Message-ID: <bug-99349-502-ppoydIcM8s@http.bugs.freedesktop.org/> (raw)
In-Reply-To: <bug-99349-502@http.bugs.freedesktop.org/>


[-- Attachment #1.1: Type: text/plain, Size: 3920 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=99349

--- Comment #7 from Gert Wollny <gw.fossdev@gmail.com> ---
Now, just  multiplying two constants/uniforms not necessarily trigger the bug.
With a simple shader program like 

uniform vec4 base_color;
uniform vec4 test;
uniform vec4 test2;
uniform vec4 test3;

void main()
{
 vec4 h1 = base_color * test;
 vec4 h2 = test2 * test3;
 gl_FragColor = h1 * h2;
}

for both const-const multiplications one constant is always addressed via a
GPR, i.e. I get 

  1: MUL TEMP[0], CONST[0], CONST[1]
r600_shader.c:3986 tgsi_op2_s - About to multiply two constants
r600_shader.c:4000 tgsi_op2_s -  ctx->src[0]: 
                  sel:7   // this is a GPR address 
              swizzle:0 1 2 3
                  neg:0
                  abs:0
                  rel:0
              kc_bank:0
               kc_rel:0
                value:0 0 0 0

r600_shader.c:4000 tgsi_op2_s -  ctx->src[1]: 
                  sel:513  // this is a cfile address 
              swizzle:0 1 2 3
                  neg:0
                  abs:0
                  rel:0
              kc_bank:0
               kc_rel:0
                value:0 0 0 0

and then check_vector/reserve_cfile can successfully assign the read ports via
cfile because only 4 values need to be read. 


However, for a more complicated shader I get the following:  

250: MUL TEMP[11], CONST[26], CONST[23]
r600_shader.c:3986 tgsi_op2_s - About to multiply two constants
r600_shader.c:4000 tgsi_op2_s -  ctx->src[0]: 
                  sel:160  // cfile kcache after  translation 
              swizzle:0 1 2 3
                  neg:0
                  abs:0
                  rel:0
              kc_bank:0
               kc_rel:0
                value:0 0 0 0

r600_shader.c:4000 tgsi_op2_s -  ctx->src[1]: 
                  sel:535 // cfile kcache before  translation 
              swizzle:0 1 2 3
                  neg:0
                  abs:0
                  rel:0
              kc_bank:0
               kc_rel:0
                value:0 0 0 0

r600_asm.c:472 check_vector -  bs->hw_cfile_addr:[-1 -1]  bs->hw_cfile_elem:
[-1 -1] bank_swizzle:0  num_src:2
r600_asm.c:494 check_vector -  src 0: sel:160 elem:0
r600_asm.c:423 reserve_cfile -   res=0: bs->hw_cfile_addr:-1
bs->hw_cfile_elem:-1 sel:160 chan:0
r600_asm.c:494 check_vector -  src 1: sel:535 elem:0
r600_asm.c:423 reserve_cfile -   res=0: bs->hw_cfile_addr:160
bs->hw_cfile_elem:0 sel:535 chan:0
r600_asm.c:423 reserve_cfile -   res=1: bs->hw_cfile_addr:-1
bs->hw_cfile_elem:-1 sel:535 chan:0
r600_asm.c:472 check_vector -  bs->hw_cfile_addr:[160 535]  bs->hw_cfile_elem:
[0 0] bank_swizzle:0  num_src:2
r600_asm.c:494 check_vector -  src 0: sel:160 elem:1
r600_asm.c:423 reserve_cfile -   res=0: bs->hw_cfile_addr:160
bs->hw_cfile_elem:0 sel:160 chan:0
r600_asm.c:494 check_vector -  src 1: sel:535 elem:1
r600_asm.c:423 reserve_cfile -   res=0: bs->hw_cfile_addr:160
bs->hw_cfile_elem:0 sel:535 chan:0
r600_asm.c:423 reserve_cfile -   res=1: bs->hw_cfile_addr:535
bs->hw_cfile_elem:0 sel:535 chan:0
r600_asm.c:472 check_vector -  bs->hw_cfile_addr:[160 535]  bs->hw_cfile_elem:
[0 0] bank_swizzle:0  num_src:2
r600_asm.c:494 check_vector -  src 0: sel:160 elem:2
r600_asm.c:423 reserve_cfile -   res=0: bs->hw_cfile_addr:160
bs->hw_cfile_elem:0 sel:160 chan:1
r600_asm.c:423 reserve_cfile -   res=1: bs->hw_cfile_addr:535
bs->hw_cfile_elem:0 sel:160 chan:1
r600_asm.c:436 reserve_cfile - All cfile read ports are used, cannot reference
vector element.

In summary allocating a read port for elem >= 2 fails, because it would mean
reading more than four values in one instruction group, and this is ot possible
according to the AMD Evergreen-Family instruction set manual 4.7.5.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 4776 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-05-26  9:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10 17:24 [Bug 99349] Failed to build shader (translation from TGSI) bugzilla-daemon
2017-01-10 17:44 ` bugzilla-daemon
2017-05-17  6:45 ` bugzilla-daemon
2017-05-24 13:10 ` bugzilla-daemon
2017-05-24 14:56 ` bugzilla-daemon
2017-05-25  8:10 ` bugzilla-daemon
2017-05-25  9:32 ` bugzilla-daemon
2017-05-26  9:01 ` bugzilla-daemon [this message]
2017-05-26  9:03 ` bugzilla-daemon
2017-05-26 13:31 ` bugzilla-daemon
2017-05-26 20:24 ` bugzilla-daemon
2017-05-29 13:28 ` bugzilla-daemon
2017-06-02 17:55 ` bugzilla-daemon
2017-06-25 22:29 ` bugzilla-daemon
2017-06-26  6:03 ` bugzilla-daemon
2017-06-26 13:41 ` bugzilla-daemon
2017-07-11 23:07 ` bugzilla-daemon
2017-07-16 21:17 ` bugzilla-daemon
2017-09-08  5:56 ` bugzilla-daemon
2017-09-08 11:05 ` bugzilla-daemon
2018-03-26 13:13 ` bugzilla-daemon
2018-03-26 18:26 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-99349-502-ppoydIcM8s@http.bugs.freedesktop.org/ \
    --to=bugzilla-daemon@freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).