[Mesa-dev] Mesa (master): st/mesa: use buffer usage history to set dirty flags for revalidation

Ilia Mirkin imirkin at alum.mit.edu
Fri Jun 10 01:11:03 UTC 2016


On Thu, Jun 9, 2016 at 9:07 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> On Wed, Jun 8, 2016 at 5:48 PM, Fredrik Höglund <fredrik at kde.org> wrote:
>> On Wednesday 08 June 2016, Ilia Mirkin wrote:
>>> Glancing at the code (I don't even have a piglit checkout here):
>>>
>>> static void
>>> set_ubo_binding(struct gl_context *ctx, ...)
>>> ...
>>>    /* If this is a real buffer object, mark it has having been used
>>>     * at some point as a UBO.
>>>     */
>>>    if (size >= 0)
>>>       bufObj->UsageHistory |= USAGE_UNIFORM_BUFFER;
>>>
>>> That seems bogus - what if the current size is 0 (unallocated), the
>>> buffer object gets bound to a UBO endpoint, and then someone goes in
>>> and does glBufferData()? Same for set_ssbo_binding.
>>>
>>>   -ilia
>>
>> The test is greater than or equal to zero, so the UsageHistory should
>> be set even when the buffer is unallocated.
>
> Right, duh.
>
>>
>> But the piglit test doesn't bind the buffer as a uniform buffer before
>> it allocates it.  It allocates the buffer first with glNamedBufferData(),
>> and then binds it.  The UsageHistory is still set to the default value in
>> the glNamedBufferData() call, since the buffer has never been bound
>> at that point.  But the uniform buffer state should still be marked as
>> dirty in the glBindBufferRange() call.  I think this failure suggests
>> that that doesn't happen for some reason.
>
> I haven't looked in GREAT detail, but the test does pass on nv50,
> nvc0, and softpipe. It only fails on llvmpipe.
>
> Brian, this might be out of my comfort area to figure out... Given
> that it's working on the other drivers, that seems more likely to be a
> failing of llvmpipe somehow.

Another observation is that the square sizes/shapes are all correct.
However the colors are all of the first square (red). So it seems like
some issue is happening for the fragment shader, but not vertex.

  -ilia


More information about the mesa-dev mailing list