spirv: Use the system value version of gl_FrontFace
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 21 Jun 2016 06:41:11 +0000 (23:41 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 21 Jun 2016 23:45:25 +0000 (16:45 -0700)
SPIR-V treats it as an input but NIR wants the system value.  This
shouldn't have been too much of a surprise given that we have to do the
same conversion in the GLSL IR to NIR pass.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/compiler/spirv/vtn_variables.c

index 61fc184a692586924bce8a96aa28309a29a20c3f..fe2494ba3b381dc5e7124b9c65051efa8f9fedd0 100644 (file)
@@ -839,8 +839,8 @@ vtn_get_builtin_location(struct vtn_builder *b,
       assert(*mode == nir_var_shader_in);
       break;
    case SpvBuiltInFrontFacing:
-      *location = VARYING_SLOT_FACE;
-      assert(*mode == nir_var_shader_in);
+      *location = SYSTEM_VALUE_FRONT_FACE;
+      set_mode_system_value(mode);
       break;
    case SpvBuiltInSampleId:
       *location = SYSTEM_VALUE_SAMPLE_ID;