diff options
author | Dave Airlie <[email protected]> | 2016-06-07 15:25:56 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-08-23 11:03:45 +1000 |
commit | ea783667e4fff16fde9dfb76eefcd6aa484077d4 (patch) | |
tree | 8b1d3d1143cb7e773bb142f64cd8c34b64b8318f /src/mesa/main/shaderapi.c | |
parent | 4566aaaa5b169724174e04dc0a99a37ae0abcd2a (diff) |
mesa: add api to write subroutine indicies to the program storage.
This writes the subroutine indicies to the program storage for
a stage. This API is intended to be used by drivers to update
the uniform storage before uploading to the hw.
This isn't the most thread safe effort, but it will be significantly
more multi-context safe.
Signed-off-by: Dave Airlie <[email protected]>
Reviewed-by: Andres Gomez <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r-- | src/mesa/main/shaderapi.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 6631f1ea479..733fee6b9aa 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -2838,6 +2838,16 @@ _mesa_shader_write_subroutine_index(struct gl_context *ctx, } while(i < sh->NumSubroutineUniformRemapTable); } +void +_mesa_shader_write_subroutine_indices(struct gl_context *ctx, + gl_shader_stage stage) +{ + if (ctx->_Shader->CurrentProgram[stage] && + ctx->_Shader->CurrentProgram[stage]->_LinkedShaders[stage]) + _mesa_shader_write_subroutine_index(ctx, + ctx->_Shader->CurrentProgram[stage]->_LinkedShaders[stage]); +} + static void _mesa_shader_init_subroutine_defaults(struct gl_context *ctx, struct gl_linked_shader *sh) |