On 09/25/2015 08:45 AM, Ilia Mirkin wrote:
On Fri, Sep 11, 2015 at 3:19 AM, Tapani Pälli <tapani.pa...@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.pa...@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?

Oh dear, yep I'll fix it soon and also add a default case (which should not be hit).

// Tapani
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to