NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
/*
- * Vulkan descriptor set intrinsic
+ * Vulkan descriptor set intrinsics
*
* The Vulkan API uses a different binding model from GL. In the Vulkan
* API, all external resources are represented by a tuple:
*
* The intended usage is that the shader will call vulkan_surface_index to
* get an index and then pass that as the buffer index ubo/ssbo calls.
+ *
+ * The vulkan_resource_reindex intrinsic takes a resource index in src0
+ * (the result of a vulkan_resource_index or vulkan_resource_reindex) which
+ * corresponds to the tuple (set, binding, index) and computes an index
+ * corresponding to tuple (set, binding, idx + src1).
*/
INTRINSIC(vulkan_resource_index, 1, ARR(1), true, 1, 0, 2,
DESC_SET, BINDING, xx,
NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
+INTRINSIC(vulkan_resource_reindex, 2, ARR(1, 1), true, 1, 0, 0, xx, xx, xx,
+ NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
/*
* variable atomic intrinsics