All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 42435] New: Suspected loss of varyings between shaders
@ 2011-10-31 14:40 bugzilla-daemon
  2011-10-31 14:43 ` [Bug 42435] " bugzilla-daemon
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-10-31 14:40 UTC (permalink / raw)
  To: dri-devel

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

             Bug #: 42435
           Summary: Suspected loss of varyings between shaders
    Classification: Unclassified
           Product: Mesa
           Version: git
          Platform: x86-64 (AMD64)
        OS/Version: Linux (All)
            Status: NEW
          Severity: major
          Priority: medium
         Component: Drivers/Gallium/r600
        AssignedTo: dri-devel@lists.freedesktop.org
        ReportedBy: screwdriver@lxnt.info


Longer description, the test case, screenshots, and core from i965 crash  are
in attached archive.

In short:

I try to draw a 2D screenful of point sprites, emulating an ansi-colored
terminal. Fragment shader receives texture coordinates for the character, its
color and size of graphic in the texture via varyings.

R600g draws a black screen, while llvmpipe and fglrx draw what is supposed to
be drawn. i965 crashes. non-llvm swrast fails to set gl_PointSize. R600c also
draws a black screen.

Drawing varying values themselves I get bogus values for some of them.

Mesa version: 7.12.0~git20111027.0fbc8d30-0ubuntu0sarvatt~natty

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
@ 2011-10-31 14:43 ` bugzilla-daemon
  2011-10-31 14:50 ` bugzilla-daemon
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-10-31 14:43 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #1 from Alexander Sabourenkov <screwdriver@lxnt.info> 2011-10-31 07:43:44 PDT ---
Created attachment 52954
  --> https://bugs.freedesktop.org/attachment.cgi?id=52954
Test case and stuff

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
  2011-10-31 14:43 ` [Bug 42435] " bugzilla-daemon
@ 2011-10-31 14:50 ` bugzilla-daemon
  2011-11-01  9:42 ` bugzilla-daemon
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-10-31 14:50 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #2 from Alexander Sabourenkov <screwdriver@lxnt.info> 2011-10-31 07:50:58 PDT ---
core did not fit: >3000K size

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
  2011-10-31 14:43 ` [Bug 42435] " bugzilla-daemon
  2011-10-31 14:50 ` bugzilla-daemon
@ 2011-11-01  9:42 ` bugzilla-daemon
  2011-11-01 22:27 ` bugzilla-daemon
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-11-01  9:42 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #3 from Alexander Sabourenkov <screwdriver@lxnt.info> 2011-11-01 02:42:01 PDT ---
Worked around the issue by moving all texture sampling to fragment shader.
(even works on 965)

Also, just moving sampling outside conditional blocks did not change anything.

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
                   ` (2 preceding siblings ...)
  2011-11-01  9:42 ` bugzilla-daemon
@ 2011-11-01 22:27 ` bugzilla-daemon
  2011-11-01 22:28 ` bugzilla-daemon
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-11-01 22:27 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #4 from Alexander Sabourenkov <screwdriver@lxnt.info> 2011-11-01 15:27:29 PDT ---
The workaround did not help r600g. Same black screen. In addition, the non-llvm
swrast draws point sprites 60 pixels in size instead of requested 16 (my
original shaders get texture sub-image size via varyings too), plus it draws
solid-black-textured point sprites as single pixels. r600c (as of Oct 27 git,
just before being axed) works though.

Not knowing whether any given black screen is a bug, or legitimate undefined
behaviour that just happens to work on some other renderer is driving me mad.

I managed to cut down the test case to bare minimum.

Usage:

./testbed <shaderset> <mesadriver>

shaderset is either "working" or "failing" - loads similarly named shaders.

"working" shader set does texture sampling in fragment shader
"failing" shader set does texture sampling in vertex shader and passes
the color as a varying vec4.

mesadriver is:
hw - default, LIBGL_ALWAYS_SOFTWARE and LIBGL_DRIVERS_PATH unset.
hw-alt - use .so from dri-alternates (x64-86 hardcoded, sorry).
sw - LIBGL_ALWAYS_SOFTWARE=y
sw-alt - as above, but use .so from dri-alternates.

For the Oct 27 git these map to r600g, r600c, swrast, llvmpipe on my box.

Of those:

"failing" llvmpipe - works as intended, vertical colored bars (composed of
16x16 point sprites), one sprite is dark green - left unpainted intentionally.
"working" llvmpipe - same (ok)
"failing" DRI - ok
"working" DRI - ok
"failing" r600g - all sprites black 
"working" r600g - all sprites black 
"failing" old-swrast  - single pixels instead of 16x16, but looks like color is
right
"working" old-swrast  - same as "failing"

The hardware is rv770 9440.

I'd say there's a problem with r600g and a different one with old swrast.

There's also intermittent display corruption mainly on areas in xterm redrawn
(but not those that get scrolled up) immediately after launching the testcase.

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
                   ` (3 preceding siblings ...)
  2011-11-01 22:27 ` bugzilla-daemon
@ 2011-11-01 22:28 ` bugzilla-daemon
  2011-11-02  0:31 ` bugzilla-daemon
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-11-01 22:28 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #5 from Alexander Sabourenkov <screwdriver@lxnt.info> 2011-11-01 15:28:43 PDT ---
Created attachment 53025
  --> https://bugs.freedesktop.org/attachment.cgi?id=53025
minimized test case

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
                   ` (4 preceding siblings ...)
  2011-11-01 22:28 ` bugzilla-daemon
@ 2011-11-02  0:31 ` bugzilla-daemon
  2011-11-02  0:53 ` bugzilla-daemon
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-11-02  0:31 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #6 from Alexander Sabourenkov <screwdriver@lxnt.info> 2011-11-01 17:31:52 PDT ---
Created attachment 53028
  --> https://bugs.freedesktop.org/attachment.cgi?id=53028
xterm corruption screenshot

xterm corruption screenshot, got it right after I first run those shaders:

#version 120
#line 2 0

uniform float posz;
uniform float width;
attribute vec2 posn;

varying float idx;

void main() { 
    vec2 posn2 = posz*posn;
    idx = posn2.x/width;
    gl_Position = gl_ModelViewProjectionMatrix*vec4(posn2.x, posn2.y, 0.0,
1.0);
    gl_PointSize = posz;
}
#version 120
#line 2 0
uniform sampler2D ansi;

varying float idx;

void main() {
    vec2 pc = gl_PointCoord;
    gl_FragColor = texture2D(ansi, vec2(0.5, 0));
}

 - got grey screen as expected, and then reset fragment shader back to 

#version 120
#line 2 0
uniform sampler2D ansi;

varying float idx;

void main() {
    vec2 pc = gl_PointCoord;
    gl_FragColor = texture2D(ansi, vec2(idx, 0));
}

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
                   ` (5 preceding siblings ...)
  2011-11-02  0:31 ` bugzilla-daemon
@ 2011-11-02  0:53 ` bugzilla-daemon
  2011-11-02  0:54 ` bugzilla-daemon
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-11-02  0:53 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #7 from Alexander Sabourenkov <screwdriver@lxnt.info> 2011-11-01 17:53:45 PDT ---
Further reducing shaders I got to this point:

#version 120
#line 2 0

varying float idx;

void main() { 
    vec2 posn2 = posz*posn;
    idx = 0.625;
    gl_Position = gl_ModelViewProjectionMatrix*vec4(128, 128, 0.0, 1.0);
    gl_PointSize = 128;
}

#version 120
#line 2 0
varying float idx;

void main() {
    gl_FragColor = vec4(idx, 0, 0, 1);
}

This is in fact very close to glsl-novertexdata from the piglit.

Which still does not work on r600g and swrast while working ok on r600c and
llvmpipe.

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
                   ` (6 preceding siblings ...)
  2011-11-02  0:53 ` bugzilla-daemon
@ 2011-11-02  0:54 ` bugzilla-daemon
  2011-11-02  1:03 ` bugzilla-daemon
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-11-02  0:54 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #8 from Alexander Sabourenkov <screwdriver@lxnt.info> 2011-11-01 17:54:54 PDT ---
Created attachment 53029
  --> https://bugs.freedesktop.org/attachment.cgi?id=53029
piglit test case for the problem

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
                   ` (7 preceding siblings ...)
  2011-11-02  0:54 ` bugzilla-daemon
@ 2011-11-02  1:03 ` bugzilla-daemon
  2011-11-02  1:40 ` bugzilla-daemon
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-11-02  1:03 UTC (permalink / raw)
  To: dri-devel

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

Alexander Sabourenkov <screwdriver@lxnt.info> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #53029|0                           |1
        is obsolete|                            |

--- Comment #9 from Alexander Sabourenkov <screwdriver@lxnt.info> 2011-11-01 18:03:56 PDT ---
Created attachment 53030
  --> https://bugs.freedesktop.org/attachment.cgi?id=53030
piglit test case for the problem as a patch

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
                   ` (8 preceding siblings ...)
  2011-11-02  1:03 ` bugzilla-daemon
@ 2011-11-02  1:40 ` bugzilla-daemon
  2011-11-02  1:41 ` bugzilla-daemon
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-11-02  1:40 UTC (permalink / raw)
  To: dri-devel

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

Alexander Sabourenkov <screwdriver@lxnt.info> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #53030|0                           |1
        is obsolete|                            |

--- Comment #10 from Alexander Sabourenkov <screwdriver@lxnt.info> 2011-11-01 18:40:05 PDT ---
Created attachment 53031
  --> https://bugs.freedesktop.org/attachment.cgi?id=53031
piglit test case for the problem as a patch

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
                   ` (9 preceding siblings ...)
  2011-11-02  1:40 ` bugzilla-daemon
@ 2011-11-02  1:41 ` bugzilla-daemon
  2011-11-02  4:56 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-11-02  1:41 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #11 from Alexander Sabourenkov <screwdriver@lxnt.info> 2011-11-01 18:41:06 PDT ---
Problem manifests itself only when gl_PointSize is set in the shader. Corrected
patch attached.

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
                   ` (10 preceding siblings ...)
  2011-11-02  1:41 ` bugzilla-daemon
@ 2011-11-02  4:56 ` bugzilla-daemon
  2011-11-02  7:41 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-11-02  4:56 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #12 from Vadim <ptpzz@yandex.ru> 2011-11-01 21:56:03 PDT ---
Created attachment 53033
  --> https://bugs.freedesktop.org/attachment.cgi?id=53033
[PATCH] r600g: take into account PSIZE output for spi mapping

Does this patch help?

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
                   ` (11 preceding siblings ...)
  2011-11-02  4:56 ` bugzilla-daemon
@ 2011-11-02  7:41 ` bugzilla-daemon
  2012-02-25 22:26 ` bugzilla-daemon
  2012-02-26 15:29 ` bugzilla-daemon
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2011-11-02  7:41 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #13 from Alexander Sabourenkov <screwdriver@lxnt.info> 2011-11-02 00:41:39 PDT ---
Yes, thank you.

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
                   ` (12 preceding siblings ...)
  2011-11-02  7:41 ` bugzilla-daemon
@ 2012-02-25 22:26 ` bugzilla-daemon
  2012-02-26 15:29 ` bugzilla-daemon
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2012-02-25 22:26 UTC (permalink / raw)
  To: dri-devel

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

--- Comment #14 from Claudio Freire <klaussfreire@gmail.com> 2012-02-25 14:26:24 PST ---
I experience a similar situation with Ironlake and Mesa 8.0.1, only with far
more complex shaders.

Apparently, in these shaders, all varyings get bogus data on the fragment
shader.

The only workaround I can find is passing that data through the built-in
varying in gl_TexCoord, although that's quite suboptimal for other drivers so I
would prefer not to.

-- 
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] 16+ messages in thread

* [Bug 42435] Suspected loss of varyings between shaders
  2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
                   ` (13 preceding siblings ...)
  2012-02-25 22:26 ` bugzilla-daemon
@ 2012-02-26 15:29 ` bugzilla-daemon
  14 siblings, 0 replies; 16+ messages in thread
From: bugzilla-daemon @ 2012-02-26 15:29 UTC (permalink / raw)
  To: dri-devel

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

Alex Deucher <agd5f@yahoo.com> changed:

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

--- Comment #15 from Alex Deucher <agd5f@yahoo.com> 2012-02-26 07:29:38 PST ---
r600g fixed in:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=16c0a3a9720c03c3d5cbfd66e2db63014dfc4f19

-- 
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] 16+ messages in thread

end of thread, other threads:[~2012-02-26 15:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-31 14:40 [Bug 42435] New: Suspected loss of varyings between shaders bugzilla-daemon
2011-10-31 14:43 ` [Bug 42435] " bugzilla-daemon
2011-10-31 14:50 ` bugzilla-daemon
2011-11-01  9:42 ` bugzilla-daemon
2011-11-01 22:27 ` bugzilla-daemon
2011-11-01 22:28 ` bugzilla-daemon
2011-11-02  0:31 ` bugzilla-daemon
2011-11-02  0:53 ` bugzilla-daemon
2011-11-02  0:54 ` bugzilla-daemon
2011-11-02  1:03 ` bugzilla-daemon
2011-11-02  1:40 ` bugzilla-daemon
2011-11-02  1:41 ` bugzilla-daemon
2011-11-02  4:56 ` bugzilla-daemon
2011-11-02  7:41 ` bugzilla-daemon
2012-02-25 22:26 ` bugzilla-daemon
2012-02-26 15:29 ` 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.