[Mesa-dev] [PATCH 0/7] RadeonSI: Unbind shaders properly
maraeo at gmail.com
Fri Oct 23 03:45:41 PDT 2015
On Fri, Oct 23, 2015 at 5:08 AM, Michel Dänzer <michel at daenzer.net> wrote:
> On 23.10.2015 08:12, Marek Olšák wrote:
>> This series unbinds shaders properly in bind_(vs/fs/etc.)_state, because any context can release them now, therefore we can't rely on unbinding in delete_shader. This is basically a fix for sharable shader.
>> It also gets rid of the dummy pixel shader. Instead, the driver just skips draw calls that have rasterizer_discard==0 and ps==NULL set at the same time. rasterizer_discard==1 and ps==NULL works as expected.
>> Please review.
> Patches 1-5 are
> Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
> Patches 6 & 7:
> Shouldn't we leave sctx->emitted.named.* intact in si_bind_*_shader and
> only clear those from si_delete_shader_selector/si_shader_destroy?
> Otherwise we might keep re-emitting the same shader PM4 state if the app
> / state tracker keeps unbinding and re-binding the same shader.
The thing is any context can release a shader and that shader can
still be bound in a different context than the one that's releasing it
and that can crash later. Or a user can release a shader and allocate
a new one and the pointer might be the same, causing the driver to
think the shader hasn't been changed.
I guess the real issue is that state trackers don't unbind shaders in
other contexts either, so the 2 patches don't help at all, they just
move the problem to a different place and add inefficiency. This needs
more thought, so let's drop them for now.
More information about the mesa-dev