[Mesa-dev] [PATCH v2 2/5] spirv: Support exporting viewport & layer from VS and TES.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Tue Aug 15 00:49:30 UTC 2017


Reviewed-by: Dave Airlie <airlied at redhat.com>
---
 src/compiler/spirv/vtn_variables.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 4432e72e54a..599b9b11a59 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1061,19 +1061,15 @@ vtn_get_builtin_location(struct vtn_builder *b,
       *location = VARYING_SLOT_LAYER;
       if (b->shader->stage == MESA_SHADER_FRAGMENT)
          *mode = nir_var_shader_in;
-      else if (b->shader->stage == MESA_SHADER_GEOMETRY)
-         *mode = nir_var_shader_out;
       else
-         unreachable("invalid stage for SpvBuiltInLayer");
+         *mode = nir_var_shader_out;
       break;
    case SpvBuiltInViewportIndex:
       *location = VARYING_SLOT_VIEWPORT;
-      if (b->shader->stage == MESA_SHADER_GEOMETRY)
-         *mode = nir_var_shader_out;
-      else if (b->shader->stage == MESA_SHADER_FRAGMENT)
+      if (b->shader->stage == MESA_SHADER_FRAGMENT)
          *mode = nir_var_shader_in;
       else
-         unreachable("invalid stage for SpvBuiltInViewportIndex");
+         *mode = nir_var_shader_out;
       break;
    case SpvBuiltInTessLevelOuter:
       *location = VARYING_SLOT_TESS_LEVEL_OUTER;
-- 
2.14.1



More information about the mesa-dev mailing list