* IN THE SOFTWARE.
*/
-#pragma once
+#ifndef ANV_NIR_H
+#define ANV_NIR_H
#include "nir/nir.h"
#include "anv_private.h"
extern "C" {
#endif
-void anv_nir_lower_push_constants(nir_shader *shader, bool is_scalar);
+bool anv_nir_lower_multiview(nir_shader *shader, uint32_t view_mask);
-void anv_nir_apply_dynamic_offsets(struct anv_pipeline *pipeline,
- nir_shader *shader,
- struct brw_stage_prog_data *prog_data);
-void anv_nir_apply_pipeline_layout(struct anv_pipeline *pipeline,
+bool anv_nir_lower_ycbcr_textures(nir_shader *shader,
+ struct anv_pipeline_layout *layout);
+
+static inline nir_address_format
+anv_nir_ssbo_addr_format(const struct anv_physical_device *pdevice,
+ bool robust_buffer_access)
+{
+ if (pdevice->has_a64_buffer_access) {
+ if (robust_buffer_access)
+ return nir_address_format_64bit_bounded_global;
+ else
+ return nir_address_format_64bit_global;
+ } else {
+ return nir_address_format_32bit_index_offset;
+ }
+}
+
+void anv_nir_apply_pipeline_layout(const struct anv_physical_device *pdevice,
+ bool robust_buffer_access,
+ struct anv_pipeline_layout *layout,
nir_shader *shader,
struct brw_stage_prog_data *prog_data,
struct anv_pipeline_bind_map *map);
+void anv_nir_compute_push_layout(const struct anv_physical_device *pdevice,
+ nir_shader *nir,
+ struct brw_stage_prog_data *prog_data,
+ struct anv_pipeline_bind_map *map,
+ void *mem_ctx);
+
+void anv_nir_validate_push_layout(struct brw_stage_prog_data *prog_data,
+ struct anv_pipeline_bind_map *map);
+
+bool anv_nir_add_base_work_group_id(nir_shader *shader);
+
#ifdef __cplusplus
}
#endif
+
+#endif /* ANV_NIR_H */