amd/common: scan if gl_InvocationID is used
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 20 Dec 2017 19:56:55 +0000 (20:56 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 4 Jan 2018 17:43:07 +0000 (18:43 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/common/ac_shader_info.c
src/amd/common/ac_shader_info.h

index ab5388fb53f588f7eed591ac858dae2c00bfc7a2..5dac1131bd0783b6de86595374c8f083be746b34 100644 (file)
@@ -70,6 +70,9 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, struct ac_shader_info *info)
        case nir_intrinsic_load_view_index:
                info->needs_multiview_view_index = true;
                break;
+       case nir_intrinsic_load_invocation_id:
+               info->uses_invocation_id = true;
+               break;
        case nir_intrinsic_vulkan_resource_index:
                info->desc_set_used_mask |= (1 << nir_intrinsic_desc_set(instr));
                break;
index 79e5615254b8188cf584eb4d9658b4c611e2d624..7c79d1a728e9cbbe8088c06dcb90099fb7de57c7 100644 (file)
@@ -31,6 +31,7 @@ struct ac_shader_info {
        bool needs_push_constants;
        uint32_t desc_set_used_mask;
        bool needs_multiview_view_index;
+       bool uses_invocation_id;
        struct {
                bool has_vertex_buffers; /* needs vertex buffers and base/start */
                bool needs_draw_id;