nir: Add support for gl_HelperInvocation system value.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
This commit is contained in:
@@ -1577,6 +1577,8 @@ nir_intrinsic_from_system_value(gl_system_value val)
|
|||||||
return nir_intrinsic_load_tess_level_inner;
|
return nir_intrinsic_load_tess_level_inner;
|
||||||
case SYSTEM_VALUE_VERTICES_IN:
|
case SYSTEM_VALUE_VERTICES_IN:
|
||||||
return nir_intrinsic_load_patch_vertices_in;
|
return nir_intrinsic_load_patch_vertices_in;
|
||||||
|
case SYSTEM_VALUE_HELPER_INVOCATION:
|
||||||
|
return nir_intrinsic_load_helper_invocation;
|
||||||
default:
|
default:
|
||||||
unreachable("system value does not directly correspond to intrinsic");
|
unreachable("system value does not directly correspond to intrinsic");
|
||||||
}
|
}
|
||||||
@@ -1620,6 +1622,8 @@ nir_system_value_from_intrinsic(nir_intrinsic_op intrin)
|
|||||||
return SYSTEM_VALUE_TESS_LEVEL_INNER;
|
return SYSTEM_VALUE_TESS_LEVEL_INNER;
|
||||||
case nir_intrinsic_load_patch_vertices_in:
|
case nir_intrinsic_load_patch_vertices_in:
|
||||||
return SYSTEM_VALUE_VERTICES_IN;
|
return SYSTEM_VALUE_VERTICES_IN;
|
||||||
|
case nir_intrinsic_load_helper_invocation:
|
||||||
|
return SYSTEM_VALUE_HELPER_INVOCATION;
|
||||||
default:
|
default:
|
||||||
unreachable("intrinsic doesn't produce a system value");
|
unreachable("intrinsic doesn't produce a system value");
|
||||||
}
|
}
|
||||||
|
@@ -225,6 +225,7 @@ SYSTEM_VALUE(local_invocation_id, 3, 0)
|
|||||||
SYSTEM_VALUE(work_group_id, 3, 0)
|
SYSTEM_VALUE(work_group_id, 3, 0)
|
||||||
SYSTEM_VALUE(user_clip_plane, 4, 1) /* const_index[0] is user_clip_plane[idx] */
|
SYSTEM_VALUE(user_clip_plane, 4, 1) /* const_index[0] is user_clip_plane[idx] */
|
||||||
SYSTEM_VALUE(num_work_groups, 3, 0)
|
SYSTEM_VALUE(num_work_groups, 3, 0)
|
||||||
|
SYSTEM_VALUE(helper_invocation, 1, 0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The format of the indices depends on the type of the load. For uniforms,
|
* The format of the indices depends on the type of the load. For uniforms,
|
||||||
|
Reference in New Issue
Block a user