[Bug 104143] r600/sb: clobbers gl_Position -> gl_FragCoord

2017-12-29 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104143

Gert Wollny  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #11 from Gert Wollny  ---
Fixed with commit 6c268ea79af80a65a89a23854bdbe8bc1e99ab23

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104143] r600/sb: clobbers gl_Position -> gl_FragCoord

2017-12-22 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104143

--- Comment #10 from Emil Velikov  ---
Gert, should we close this considering the patch (fix?) has landed?

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104143] r600/sb: clobbers gl_Position -> gl_FragCoord

2017-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104143

--- Comment #9 from Gert Wollny  ---
Patch: https://patchwork.freedesktop.org/patch/192036/

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104143] r600/sb: clobbers gl_Position -> gl_FragCoord

2017-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104143

--- Comment #8 from Gert Wollny  ---
I found the problem: 

if KC0[0].x == index (=0):  

1  x: ADD_INTT0.x,  KC0[0].x, [0xfffe -nan].x
2  x: MOVA_INT   __.x,  T0.x

Address register is now -2 and hence,  in the next step R1 is unconditionally
written, and this is actually the gl_Vertex value ...

3  z: MOVR[3+AR].z,  0
   w: MOVR[3+AR].w,  [0x3dcd 0.1].x

that is here used to evaluate the gl_Posuition. 

5  x: MUL_IEEE   T0.x,  KC0[1].w, R1.x
   y: MUL_IEEE   T0.y,  KC0[1].z, R1.x
6  t: MULADD_IEEET0.y,  KC0[2].z, R1.y, T0.y   SCL_212
...

In the un-optimized shader R[3+AR].w is only written to if (KC0[0].x >= 2), and
hence AR >= 0;

I.e. the sb optimizer is to aggressive in optimizing away the conditional
blocks.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104143] r600/sb: clobbers gl_Position -> gl_FragCoord

2017-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104143

--- Comment #7 from Gert Wollny  ---
Created attachment 136005
  --> https://bugs.freedesktop.org/attachment.cgi?id=136005=edit
Shader dump with pos test

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104143] r600/sb: clobbers gl_Position -> gl_FragCoord

2017-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104143

--- Comment #4 from Gert Wollny  ---
Created attachment 136002
  --> https://bugs.freedesktop.org/attachment.cgi?id=136002=edit
Version of the piglit that passes copy of gl_Position and tests it

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104143] r600/sb: clobbers gl_Position -> gl_FragCoord

2017-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104143

--- Comment #5 from Gert Wollny  ---
Created attachment 136003
  --> https://bugs.freedesktop.org/attachment.cgi?id=136003=edit
Piglit screen output with R600_DEBUG=nosb of shaders with extra pos parameter

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104143] r600/sb: clobbers gl_Position -> gl_FragCoord

2017-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104143

--- Comment #6 from Gert Wollny  ---
Created attachment 136004
  --> https://bugs.freedesktop.org/attachment.cgi?id=136004=edit
Piglit output with extra pos parameter and sb enabled

In this image on can see that the (corrected) position passed as extra
parameter differs from the gl_Position for index=0 (colour coded difference),
but only for index 0.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104143] r600/sb: clobbers gl_Position -> gl_FragCoord

2017-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104143

--- Comment #3 from Gert Wollny  ---
Created attachment 136001
  --> https://bugs.freedesktop.org/attachment.cgi?id=136001=edit
Version of the piglit that uses interleaved array and fails with sb

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104143] r600/sb: clobbers gl_Position -> gl_FragCoord

2017-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104143

--- Comment #2 from Gert Wollny  ---
Created attachment 136000
  --> https://bugs.freedesktop.org/attachment.cgi?id=136000=edit
piglit screen output of simplified piglit

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104143] r600/sb: clobbers gl_Position -> gl_FragCoord

2017-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104143

--- Comment #1 from Gert Wollny  ---
Created attachment 135999
  --> https://bugs.freedesktop.org/attachment.cgi?id=135999=edit
Version of the original piglit that passes

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[Bug 104143] r600/sb: clobbers gl_Position -> gl_FragCoord

2017-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=104143

Bug ID: 104143
   Summary: r600/sb: clobbers gl_Position -> gl_FragCoord
   Product: Mesa
   Version: git
  Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
  Severity: normal
  Priority: medium
 Component: Drivers/Gallium/r600
  Assignee: dri-devel@lists.freedesktop.org
  Reporter: gw.foss...@gmail.com
QA Contact: dri-devel@lists.freedesktop.org

Created attachment 135998
  --> https://bugs.freedesktop.org/attachment.cgi?id=135998=edit
piglit drawing output with sb enabled

With a variation of the piglit 

spec/glsl-1.10/execution/variable-indexing/vs-output-array-vec2-index-wr

r600/sb clobbers the gl_Position/gl_FragCoord.

The variation consists in replacing two arrays of vec2 by one array of vec4 and
swizzling the elements to achieve the same result (by effectively interleaving
the two arrays). 

A few observations: 

* As can be seen from the colour coding screen shots, the array content is  
correctly passed from the vertex shader to the fragment shader. 

* The error only occurs for the uniform index value 0. 

* When passing an additional parameter that contains a copy of gl_Position,
then   this parameter seems to have the correct value (i.e. the vertex shader
correctly evaluates gl_Position).

* The byte code doesn't doesn't give any obvious indication why things go wrong
with the optimized shader. 

My mesa is at fa8c1b92b7. 

best, 
Gert

-- 
You are receiving this mail because:
You are the assignee for the bug.___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel