[Mesa-dev] [PATCH v3] glsl: add packed varyings to program resource list

Ilia Mirkin imirkin at alum.mit.edu
Thu Sep 24 22:45:05 PDT 2015


On Fri, Sep 11, 2015 at 3:19 AM, Tapani Pälli <tapani.palli at intel.com> wrote:
> This makes sure that user is still able to query properties about
> variables that have gotten packed by lower_packed_varyings pass.
>
> Fixes following OpenGL ES 3.1 test:
>    ES31-CTS.program_interface_query.separate-programs-vertex
>
> v2: fix 'name included in packed list' check (Ilia Mirkin)
> v3: iterate over instances of name using strtok_r (Ilia Mirkin)
>
> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
> ---
>  src/glsl/linker.cpp | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 76 insertions(+), 4 deletions(-)
>
> diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
> index 94f847e..de499e2 100644
> --- a/src/glsl/linker.cpp
> +++ b/src/glsl/linker.cpp
> @@ -3211,6 +3251,33 @@ add_interface_variables(struct gl_shader_program *shProg,
>     return true;
>  }
>
> +static bool
> +add_packed_varyings(struct gl_shader_program *shProg, int stage)
> +{
> +   struct gl_shader *sh = shProg->_LinkedShaders[stage];
> +   GLenum iface;
> +
> +   if (!sh || !sh->packed_varyings)
> +      return true;
> +
> +   foreach_in_list(ir_instruction, node, sh->packed_varyings) {
> +      ir_variable *var = node->as_variable();
> +      if (var) {
> +         switch (var->data.mode) {
> +         case ir_var_shader_in:
> +            iface = GL_PROGRAM_INPUT;
> +         case ir_var_shader_out:
> +            iface = GL_PROGRAM_OUTPUT;

I happened to notice this when looking over pushed commits. The issue
above should be obvious... should probably fix that, and ideally add a
piglit test that would catch it?

  -ilia


More information about the mesa-dev mailing list