From: bugzilla-daemon@freedesktop.org Subject: [Bug 104492] Compute Shader: Wrong alignment when assigning struct value to structured SSBO Date: Thu, 04 Jan 2018 21:44:24 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1153509358==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 667EE6E226 for ; Thu, 4 Jan 2018 21:44:24 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1153509358== Content-Type: multipart/alternative; boundary="15151022640.1Ff3e4cDb.21483"; charset="UTF-8" --15151022640.1Ff3e4cDb.21483 Date: Thu, 4 Jan 2018 21:44:24 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D104492 --- Comment #4 from florian.will@googlemail.com --- Maybe the bug is in compiler/glsl/lower_buffer_access.cpp? https://cgit.freedesktop.org/mesa/mesa/tree/src/compiler/glsl/lower_buffer_= access.cpp?id=3D396c006d907b023f9b187db618ee2a6e4e1b8a85#n51 I'm not sure about the control flow for radeonsi, but if that pass is used = in my setup, and this emit_access() code is used to break down struct derefs i= nto multiple scalar/array/vec derefs, then it seems like the check for packing = =3D=3D GLSL_INTERFACE_STD430 is missing in lines 77/78 and 85, and the std140 layo= ut is assumed instead. I think that might explain the observed incorrect behaviour. In that same file, the check for std430 was added in a few places, like in = line 338. I'd love to give this a try and add checks to use std430_base_alignment() a= nd std430_size() if appropriate, but I'm not really prepared to compile Mesa myself right now. So, if someone who knows this code feels like my suggested change is correct and required, I'd be more than happy if they could take care of this. Other= wise I might give it a try myself in some time. --=20 You are receiving this mail because: You are the assignee for the bug.= --15151022640.1Ff3e4cDb.21483 Date: Thu, 4 Jan 2018 21:44:24 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 4 on bug 10449= 2 from = florian.will@googlemail.com
Maybe the bug is in compiler/glsl/lower_buffer_access.cpp?
ht=
tps://cgit.freedesktop.org/mesa/mesa/tree/src/compiler/glsl/lower_buffer_ac=
cess.cpp?id=3D396c006d907b023f9b187db618ee2a6e4e1b8a85#n51

I'm not sure about the control flow for radeonsi, but if that pass is used =
in
my setup, and this emit_access() code is used to break down struct derefs i=
nto
multiple scalar/array/vec derefs, then it seems like the check for packing =
=3D=3D
GLSL_INTERFACE_STD430 is missing in lines 77/78 and 85, and the std140 layo=
ut
is assumed instead. I think that might explain the observed incorrect
behaviour.

In that same file, the check for std430 was added in a few places, like in =
line
338.

I'd love to give this a try and add checks to use std430_base_alignment() a=
nd
std430_size() if appropriate, but I'm not really prepared to compile Mesa
myself right now.

So, if someone who knows this code feels like my suggested change is correct
and required, I'd be more than happy if they could take care of this. Other=
wise
I might give it a try myself in some time.


You are receiving this mail because:
  • You are the assignee for the bug.
= --15151022640.1Ff3e4cDb.21483-- --===============1153509358== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1153509358==--