vk: Support SpvBuiltInViewportIndex
authorKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Mon, 11 Jan 2016 20:29:42 +0000 (12:29 -0800)
committerKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Tue, 12 Jan 2016 18:53:59 +0000 (10:53 -0800)
src/glsl/nir/spirv/spirv_to_nir.c

index 71e589d88b7f56f54cabee00a88f566cf2b7bdb7..d5b9afefa7c76f9ca4abd3e35b02c81b8337c244 100644 (file)
@@ -924,6 +924,15 @@ vtn_get_builtin_location(struct vtn_builder *b,
       *location = VARYING_SLOT_LAYER;
       *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)
+         *mode = nir_var_shader_in;
+      else
+         unreachable("invalid stage for SpvBuiltInViewportIndex");
+      break;
    case SpvBuiltInTessLevelOuter:
    case SpvBuiltInTessLevelInner:
    case SpvBuiltInTessCoord: