<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Implement SSBOs in GLSL front-end and i965"
href="https://bugs.freedesktop.org/show_bug.cgi?id=89597#c30">Comment # 30</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Implement SSBOs in GLSL front-end and i965"
href="https://bugs.freedesktop.org/show_bug.cgi?id=89597">bug 89597</a>
from <span class="vcard"><a class="email" href="mailto:siglesias@igalia.com" title="Samuel Iglesias <siglesias@igalia.com>"> <span class="fn">Samuel Iglesias</span></a>
</span></b>
<pre>I have been working on the .length() calculation of unsized arrays in SSBOs. As
it was said in <a href="show_bug.cgi?id=89597#c2">comment 2</a>, the size of the allocated buffer by the GPU can be
queried by resinfo message. I have that code working fine with that approach
but recently I discovered an inconsistency:
Intel driver is allocating internally buffers of multiples of 4k (see buffer
object returned by intel_bufferobj_buffer() in brw_upload_ubo_surfaces()), so
if the user wants a buffer of size 32 bytes, it would allocate a buffer of 4096
bytes. Then, the emitted resinfo message returns 4096.
However if the application executes glGetBufferParameteriv(GL_BUFFER_SIZE) it
will return 32 bytes and I suppose this is the buffer size value that should be
used for unsized array's length calculations.
How can I fix this inconsistency?
Should I modify intel_bufferobj_buffer() to return a buffer object of the same
size it was asked for and not round it up to multiples of 4k? Is there a good
reason for that behavior?
What do you think?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>