[Mesa-dev] shader subroutine per-context uniform support

Dave Airlie airlied at gmail.com
Tue Jun 7 05:25:54 UTC 2016


So when I implemented shader subroutines, I ignored part of the
spec, because nobody really cares or uses this extension.

But since CTS has a test for this feature I thought I'd implement it
a bit better now (still not perfect).

So the spec says that the values in the subroutine uniforms are
stored per context not per program.

The first patch is enough to pass the CTS test which doesn't do
any rendering checks, it just writes values from multiple contexts
and reads them back.

The second 4 tests, push the updating of the subroutines into
the constant upload paths of the drivers, so it calls the API
to update the subroutine constants just before it writes the
constants to the hw. This might not be perfect in some threaded
cases, but it's a lot better than nothing, and I don't think
this API will see much use going forward.

With these and the previous one liner, there is only one
failing test in CTS for subroutines and it is due to program binary
API.

Dave.



More information about the mesa-dev mailing list