All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 30416] New: r300compiler: build_loop_info: expected conditional
@ 2010-09-28  9:42 bugzilla-daemon
  2010-09-28 15:37 ` [Bug 30416] " bugzilla-daemon
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bugzilla-daemon @ 2010-09-28  9:42 UTC (permalink / raw)
  To: dri-devel

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

           Summary: r300compiler: build_loop_info: expected conditional
           Product: Mesa
           Version: git
          Platform: x86-64 (AMD64)
        OS/Version: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Drivers/Gallium/r300
        AssignedTo: dri-devel@lists.freedesktop.org
        ReportedBy: wixorpeek@gmail.com
                CC: maraeo@gmail.com


Compilation of the following fragment shader fails:

uniform vec4 vecX, vecY;
uniform int iter;

void main() {
    for(;;) {
        bool b = (dot(gl_TexCoord[0], gl_TexCoord[0]) < 4.0);
        gl_FragColor.z = iter == 0 ? vecX.z - vecY.z : 15.0;
        if(b)
            break;
        gl_FragColor.x = 1.0;
    }
}

r300: Initial fragment program
FRAG
DCL IN[0], GENERIC[0], PERSPECTIVE
DCL OUT[0], COLOR
DCL CONST[0..2]
DCL TEMP[0..2]
IMM FLT32 {    4.0000,     0.0000,    15.0000,     1.0000}
  0: BGNLOOP :16
  1:   DP4 TEMP[0].x, IN[0], IN[0]
  2:   SLT TEMP[1].x, TEMP[0].xxxx, IMM[0].xxxx
  3:   MOV TEMP[0].x, TEMP[1].xxxx
  4:   SEQ TEMP[1].x, CONST[0].xxxx, IMM[0].yyyy
  5:   IF TEMP[1].xxxx :8
  6:     ADD TEMP[1].x, CONST[2].zzzz, -CONST[1].zzzz
  7:     MOV TEMP[2].x, TEMP[1].xxxx
  8:   ELSE :10
  9:     MOV TEMP[2].x, IMM[0].zzzz
 10:   ENDIF
 11:   MOV OUT[0].z, TEMP[2].xxxx
 12:   IF TEMP[0].xxxx :14
 13:     BRK
 14:   ENDIF
 15:   MOV OUT[0].x, IMM[0].wwww
 16: ENDLOOP :0
 17: END

Another example that fails is (maybe more common):

uniform vec4 vecX, vecY;
uniform int iter;

void main() {
    for(;;) {
        gl_FragColor.z = vecX.z - vecY.z;
        if(dot(gl_TexCoord[0], gl_TexCoord[0]) < 4.0 && iter > 15)
            break;
        gl_FragColor.x = 1.0;
    }
}

r300: Initial fragment program
FRAG
DCL IN[0], GENERIC[0], PERSPECTIVE
DCL OUT[0], COLOR
DCL CONST[0..2]
DCL TEMP[0..1]
IMM FLT32 {    4.0000,    15.0000,     0.0000,     1.0000}
  0: BGNLOOP :15
  1:   ADD TEMP[0].x, CONST[2].zzzz, -CONST[1].zzzz
  2:   MOV OUT[0].z, TEMP[0].xxxx

  3:   DP4 TEMP[0].x, IN[0], IN[0]
  4:   SLT TEMP[1].x, TEMP[0].xxxx, IMM[0].xxxx
  5:   IF TEMP[1].xxxx :8
  6:     SGT TEMP[0].x, CONST[0].xxxx, IMM[0].yyyy
  7:     MOV TEMP[1].x, TEMP[0].xxxx
  8:   ELSE :10
  9:     MOV TEMP[1].x, IMM[0].zzzz
 10:   ENDIF

 11:   IF TEMP[1].xxxx :13
 12:     BRK
 13:   ENDIF
 14:   MOV OUT[0].x, IMM[0].wwww
 15: ENDLOOP :0
 16: END

The driver could cope with that by inserting something like
     CMP x, -x, 1, 0
before the IF.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 30416] r300compiler: build_loop_info: expected conditional
  2010-09-28  9:42 [Bug 30416] New: r300compiler: build_loop_info: expected conditional bugzilla-daemon
@ 2010-09-28 15:37 ` bugzilla-daemon
  2010-09-28 16:57 ` bugzilla-daemon
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2010-09-28 15:37 UTC (permalink / raw)
  To: dri-devel

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

Marek Olšák <maraeo@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #1 from Marek Olšák <maraeo@gmail.com> 2010-09-28 08:37:43 PDT ---
Both shaders *should* fail to compile because you cannot say at compile time
whether they will terminate or not. If a GPU gets stuck in an infinite loop,
it's basically a hard lockup, and your monitor becomes unusable until you reset
the machine. We can't allow that.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 30416] r300compiler: build_loop_info: expected conditional
  2010-09-28  9:42 [Bug 30416] New: r300compiler: build_loop_info: expected conditional bugzilla-daemon
  2010-09-28 15:37 ` [Bug 30416] " bugzilla-daemon
@ 2010-09-28 16:57 ` bugzilla-daemon
  2010-09-28 17:11 ` bugzilla-daemon
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2010-09-28 16:57 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #2 from Tom Stellard <tstellar@gmail.com> 2010-09-28 09:57:49 PDT ---
Created an attachment (id=39022)
 View: https://bugs.freedesktop.org/attachment.cgi?id=39022
 Review: https://bugs.freedesktop.org/review?bug=30416&attachment=39022

Fix the compiler error

This patch should fix the compiler error, but I'm seeing this shader render
incorrectly, so this is still a bug.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 30416] r300compiler: build_loop_info: expected conditional
  2010-09-28  9:42 [Bug 30416] New: r300compiler: build_loop_info: expected conditional bugzilla-daemon
  2010-09-28 15:37 ` [Bug 30416] " bugzilla-daemon
  2010-09-28 16:57 ` bugzilla-daemon
@ 2010-09-28 17:11 ` bugzilla-daemon
  2010-09-28 17:18 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2010-09-28 17:11 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #3 from Tom Stellard <tstellar@gmail.com> 2010-09-28 10:11:13 PDT ---
(In reply to comment #1)
> Both shaders *should* fail to compile because you cannot say at compile time
> whether they will terminate or not. If a GPU gets stuck in an infinite loop,
> it's basically a hard lockup, and your monitor becomes unusable until you reset
> the machine. We can't allow that.

It's not possible to have infinite loops, because the number of iterations is
capped at 256.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 30416] r300compiler: build_loop_info: expected conditional
  2010-09-28  9:42 [Bug 30416] New: r300compiler: build_loop_info: expected conditional bugzilla-daemon
                   ` (2 preceding siblings ...)
  2010-09-28 17:11 ` bugzilla-daemon
@ 2010-09-28 17:18 ` bugzilla-daemon
  2010-09-28 17:23 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2010-09-28 17:18 UTC (permalink / raw)
  To: dri-devel

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

Marek Olšák <maraeo@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|maraeo@gmail.com            |

--- Comment #4 from Marek Olšák <maraeo@gmail.com> 2010-09-28 10:18:18 PDT ---
(In reply to comment #3)
> It's not possible to have infinite loops, because the number of iterations is
> capped at 256.

And what about jumps?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 30416] r300compiler: build_loop_info: expected conditional
  2010-09-28  9:42 [Bug 30416] New: r300compiler: build_loop_info: expected conditional bugzilla-daemon
                   ` (3 preceding siblings ...)
  2010-09-28 17:18 ` bugzilla-daemon
@ 2010-09-28 17:23 ` bugzilla-daemon
  2010-09-29  5:05 ` bugzilla-daemon
  2010-09-29  5:10 ` bugzilla-daemon
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2010-09-28 17:23 UTC (permalink / raw)
  To: dri-devel

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

Tom Stellard <tstellar@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |

--- Comment #5 from Tom Stellard <tstellar@gmail.com> 2010-09-28 10:23:34 PDT ---
This shader uncovers a bug in the deadcode pass, so I'm reopening it.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 30416] r300compiler: build_loop_info: expected conditional
  2010-09-28  9:42 [Bug 30416] New: r300compiler: build_loop_info: expected conditional bugzilla-daemon
                   ` (4 preceding siblings ...)
  2010-09-28 17:23 ` bugzilla-daemon
@ 2010-09-29  5:05 ` bugzilla-daemon
  2010-09-29  5:10 ` bugzilla-daemon
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2010-09-29  5:05 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #6 from Tom Stellard <tstellar@gmail.com> 2010-09-28 22:05:16 PDT ---
(In reply to comment #4)
> (In reply to comment #3)
> > It's not possible to have infinite loops, because the number of iterations is
> > capped at 256.
> 
> And what about jumps?

Jump instructions can be executed an infinite number of times, but the r300
compiler doesn't use them.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 30416] r300compiler: build_loop_info: expected conditional
  2010-09-28  9:42 [Bug 30416] New: r300compiler: build_loop_info: expected conditional bugzilla-daemon
                   ` (5 preceding siblings ...)
  2010-09-29  5:05 ` bugzilla-daemon
@ 2010-09-29  5:10 ` bugzilla-daemon
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla-daemon @ 2010-09-29  5:10 UTC (permalink / raw)
  To: dri-devel

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

Tom Stellard <tstellar@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #7 from Tom Stellard <tstellar@gmail.com> 2010-09-28 22:10:47 PDT ---
(In reply to comment #5)
> This shader uncovers a bug in the deadcode pass, so I'm reopening it.

It was actually a slight variation of this shader that was uncovering the bug
in the deadcode pass.  With the compiler error fixed this shader exhibits the
same behavior as bug 30415.

*** This bug has been marked as a duplicate of bug 30415 ***

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-09-29  5:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-28  9:42 [Bug 30416] New: r300compiler: build_loop_info: expected conditional bugzilla-daemon
2010-09-28 15:37 ` [Bug 30416] " bugzilla-daemon
2010-09-28 16:57 ` bugzilla-daemon
2010-09-28 17:11 ` bugzilla-daemon
2010-09-28 17:18 ` bugzilla-daemon
2010-09-28 17:23 ` bugzilla-daemon
2010-09-29  5:05 ` bugzilla-daemon
2010-09-29  5:10 ` bugzilla-daemon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.