[Mesa-dev] [PATCH] mesa/shaderapi: Do a dry run of linking an in-use program

Emil Velikov emil.l.velikov at gmail.com
Tue Nov 7 13:32:35 UTC 2017


Hi Neil,

On 2 November 2017 at 18:35, Neil Roberts <nroberts at igalia.com> wrote:
> If an in-use program is unsuccessfully linked, the GL spec requires
> that the executable and the uniform state of the program should remain
> until a new program is bound. Previously this sort of worked in Mesa
> except that it would free the uniform state before attempting to link.
> At least on i965 this would usually continue to work because it
> accesses the uniform values via a dangling pointer. However it was
> causing sporadic failures in one of the CTS tests.
>
> To fix it, when an in-use program is about to be linked, it will now
> make a copy of the program and first try to link that instead. If it
> works it will let the link continue, otherwise it will copy the status
> to the new program and abandon the link. That way the link status and
> info log is preserved without freeing the uniform state.
>
> This isn’t very efficient but it would probably quite a big overhaul
> to fix it properly and it doesn’t seem worth it because I can’t
> imagine that any performance-sensitive application would be hitting
> this very strange corner case of the API.
>
> Fixes: KHR-GL46.sepshaderobjs.StateInteraction
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102177

Did follow the discussion if this is the best approach, a humble request though:
Please tag the stable tag before pushing the respective patch.

Thanks
Emil


More information about the mesa-dev mailing list