mesa/subroutines: start adding per-context subroutine index support (v1.1)
authorDave Airlie <airlied@redhat.com>
Tue, 7 Jun 2016 05:25:55 +0000 (15:25 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 23 Aug 2016 01:03:45 +0000 (11:03 +1000)
commit4566aaaa5b169724174e04dc0a99a37ae0abcd2a
tree7a868b06b480e0469b9fd19b1d78f3515d6f6942
parent27d20ee264429ecf43968fa1a746ff428262cfb9
mesa/subroutines: start adding per-context subroutine index support (v1.1)

One piece of ARB_shader_subroutine I ignored was the fact that it
needs to store the subroutine index data per context and not per
shader program.

There is one CTS test that tests this:
GL45-CTS.shader_subroutine.multiple_contexts

However the test only does a write to context and readback,
it never renders using the values, so this is enough to fix the
test however not enough to do what the spec says.

So with this patch the info is now stored per context, but
it gets updated into the program at UseProgram and when the
values are inserted into the context, which won't help if
multiple contexts are in use in multiple threads.

v1.1: cleanups and nit-picks (Andres)

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
src/mesa/main/mtypes.h
src/mesa/main/pipelineobj.c
src/mesa/main/shaderapi.c
src/mesa/main/shaderapi.h