[Mesa-dev] [PATCH] glsl: add varyings to resource list only with SSO
Kenneth Graunke
kenneth at whitecape.org
Wed Oct 7 10:26:06 PDT 2015
On Wednesday, October 07, 2015 10:04:06 AM Tapani Pälli wrote:
> Varyings can be considered inputs or outputs of a program only when
> SSO is in use. With multi-stage programs, inputs contain only inputs
> for first stage and outputs contains outputs of the final shader stage.
>
> I've tested that fix works for Assault Android Cactus (demo version)
> and does not cause Piglit or CTS regressions in glGetProgramiv tests.
>
> Following ES 3.1 CTS separate shader tests that do query properties
> of varyings in SSO shader programs pass:
>
> ES31-CTS.program_interface_query.separate-programs-vertex
> ES31-CTS.program_interface_query.separate-programs-fragment
>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92122
> ---
> src/glsl/linker.cpp | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index 6df8d61..a97b4ef 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -3421,10 +3421,13 @@ build_program_resource_list(struct gl_shader_program *shProg)
> if (input_stage == MESA_SHADER_STAGES && output_stage == 0)
> return;
>
> - if (!add_packed_varyings(shProg, input_stage))
> - return;
> - if (!add_packed_varyings(shProg, output_stage))
> - return;
> + /* Program interface needs to expose varyings in case of SSO. */
> + if (shProg->SeparateShader) {
> + if (!add_packed_varyings(shProg, input_stage))
> + return;
> + if (!add_packed_varyings(shProg, output_stage))
> + return;
> + }
>
> /* Add inputs and outputs to the resource list. */
> if (!add_interface_variables(shProg, shProg->_LinkedShaders[input_stage]->ir,
>
Looks good to me, thanks Tapani!
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20151007/3c7bb059/attachment-0001.sig>
More information about the mesa-dev
mailing list