OSDN Git Service

spirv: Add support for the HelperInvocation builtin
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 22 Aug 2017 05:11:49 +0000 (22:11 -0700)
committerAndres Gomez <agomez@igalia.com>
Wed, 6 Sep 2017 15:05:10 +0000 (18:05 +0300)
I have no idea how this got missed but it's been missing since forever.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit e439908af9665b50443f1196cb55388c69d0c7d7)
[Andres Gomez: resolve trivial conflicts]
Signed-off-by: Andres Gomez <agomez@igalia.com>
Conflicts:
src/compiler/spirv/vtn_variables.c

src/compiler/spirv/vtn_variables.c

index 1968b37..79830dc 100644 (file)
@@ -1004,6 +1004,10 @@ vtn_get_builtin_location(struct vtn_builder *b,
       *location = FRAG_RESULT_DEPTH;
       assert(*mode == nir_var_shader_out);
       break;
+   case SpvBuiltInHelperInvocation:
+      *location = SYSTEM_VALUE_HELPER_INVOCATION;
+      set_mode_system_value(mode);
+      break;
    case SpvBuiltInNumWorkgroups:
       *location = SYSTEM_VALUE_NUM_WORK_GROUPS;
       set_mode_system_value(mode);
@@ -1040,7 +1044,6 @@ vtn_get_builtin_location(struct vtn_builder *b,
       *location = SYSTEM_VALUE_DRAW_ID;
       set_mode_system_value(mode);
       break;
-   case SpvBuiltInHelperInvocation:
    default:
       unreachable("unsupported builtin");
    }