From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 97305] Wrong values returned by GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT & GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT randomly breaks stuff Date: Thu, 11 Aug 2016 19:53:09 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0349651562==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D8CC6E08B for ; Thu, 11 Aug 2016 19:53:09 +0000 (UTC) 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 --===============0349651562== Content-Type: multipart/alternative; boundary="14709451890.cd5fdc.18682"; charset="UTF-8" --14709451890.cd5fdc.18682 Date: Thu, 11 Aug 2016 19:53:09 +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=3D97305 Bug ID: 97305 Summary: Wrong values returned by GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT & GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT randomly breaks stuff Product: Mesa Version: git Hardware: All OS: All Status: NEW Severity: critical Priority: medium Component: Drivers/Gallium/radeonsi Assignee: dri-devel@lists.freedesktop.org Reporter: dark_sylinc@yahoo.com.ar QA Contact: dri-devel@lists.freedesktop.org I'm the main developer of Ogre 2.1 We're trying our demos in latest Mesa: I've built Mesa from scratch. Tried commits git-edfc17a (current head of br= anch 12.0) and commit 17f1c49b9ad05af4f6482f6fa950e5dcc1a779d1 (current head of master branch) Almost all of them work except for the compute shader based ones (Googling around it appears for Southern Island radeon it could be buggy so it was tu= rned off. Not 100% sure but I think that's what's happening). Anyway, not a big deal on that. I understand the Mesa team considers that W= IP. Move on. However our Forward3D demo was glitching and I didn't know why. I've investigated the problem and located it: * glGetIntegerv w/ GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT is returning 4, should return 256 for my HW (GCN 1.0 AMD Radeon HD 7770 Southern Islands). * glGetIntegerv w/ GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT is returning 4, should return 256 for my HW. In both cases "256" is what Windows drivers return btw, including fglrx on Linux. When aligned to 4 bytes; the following worked correctly: glTexBufferRange( GL_TEXTURE_BUFFER, GL_R32UI, boName, offsetAlignedTo4ButNotTo256, sizeBytes ); uniform usamplerBuffer f3dGrid; uint numLightsInGrid =3D texelFetch( f3dGrid, int(sampleOffset) ).x; But the following did not: glTexBufferRange( GL_TEXTURE_BUFFER, GL_RGBA32F, boName, offsetAlignedTo4ButNotTo256, sizeBytes ); uniform samplerBuffer f3dLightList; vec4 values =3D texelFetch( f3dLightList, int(sampleOffset) ).x; The output of the latter was flickering garbage. When I forced 256 byte alignment, it worked as expected. I consider this a critical issue because I suspect it's causing subtle prob= lems with a lot of titles whose buffer offsets don't start at 0. I believe NVIDIA GPUs also require buffer offsets of 256. I don't know about Intel cards. --=20 You are receiving this mail because: You are the assignee for the bug.= --14709451890.cd5fdc.18682 Date: Thu, 11 Aug 2016 19:53:09 +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
Bug ID 97305
Summary Wrong values returned by GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT &= amp; GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT randomly breaks stuff
Product Mesa
Version git
Hardware All
OS All
Status NEW
Severity critical
Priority medium
Component Drivers/Gallium/radeonsi
Assignee dri-devel@lists.freedesktop.org
Reporter dark_sylinc@yahoo.com.ar
QA Contact dri-devel@lists.freedesktop.org

I'm the main developer of Ogre 2.1

We're trying our demos in latest Mesa:
I've built Mesa from scratch. Tried commits git-edfc17a (current head of br=
anch
12.0) and commit 17f1c49b9ad05af4f6482f6fa950e5dcc1a779d1 (current head of
master branch)

Almost all of them work except for the compute shader based ones (Googling
around it appears for Southern Island radeon it could be buggy so it was tu=
rned
off. Not 100% sure but I think that's what's happening).
Anyway, not a big deal on that. I understand the Mesa team considers that W=
IP.
Move on.

However our Forward3D demo was glitching and I didn't know why. I've
investigated the problem and located it:
* glGetIntegerv w/ GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT is returning 4, should
return 256 for my HW (GCN 1.0 AMD Radeon HD 7770 Southern Islands).
* glGetIntegerv w/ GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT is returning 4, should
return 256 for my HW.

In both cases "256" is what Windows drivers return btw, including=
 fglrx on
Linux.

When aligned to 4 bytes; the following worked correctly:
glTexBufferRange( GL_TEXTURE_BUFFER, GL_R32UI, boName,
offsetAlignedTo4ButNotTo256, sizeBytes );
uniform usamplerBuffer f3dGrid;
uint numLightsInGrid =3D texelFetch( f3dGrid, int(sampleOffset) ).x;

But the following did not:
glTexBufferRange( GL_TEXTURE_BUFFER, GL_RGBA32F, boName,
offsetAlignedTo4ButNotTo256, sizeBytes );
uniform samplerBuffer f3dLightList;
vec4 values =3D texelFetch( f3dLightList, int(sampleOffset) ).x;

The output of the latter was flickering garbage. When I forced 256 byte
alignment, it worked as expected.

I consider this a critical issue because I suspect it's causing subtle prob=
lems
with a lot of titles whose buffer offsets don't start at 0.

I believe NVIDIA GPUs also require buffer offsets of 256. I don't know about
Intel cards.


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