radv/gfx10: add an option to switch from legacy to NGG streamout
[mesa.git] / src / amd / vulkan / radv_private.h
index 7d7704f69aabbd38948d6e5df2de9db642f7aee2..8b612155621ea8b50cc8128c928f8e6d9ffee201 100644 (file)
@@ -280,27 +280,16 @@ struct radv_physical_device {
        int master_fd;
        struct wsi_device                       wsi_device;
 
-       bool has_rbplus; /* if RB+ register exist */
-       bool rbplus_allowed; /* if RB+ is allowed */
-       bool has_clear_state;
-       bool cpdma_prefetch_writes_memory;
-       bool has_scissor_bug;
-       bool has_tc_compat_zrange_bug;
-
-       bool has_out_of_order_rast;
        bool out_of_order_rast_allowed;
 
        /* Whether DCC should be enabled for MSAA textures. */
        bool dcc_msaa_allowed;
 
-       /* Whether LOAD_CONTEXT_REG packets are supported. */
-       bool has_load_ctx_reg_pkt;
-
        /* Whether to enable the AMD_shader_ballot extension */
        bool use_shader_ballot;
 
-       /* Whether DISABLE_CONSTANT_ENCODE_REG is supported. */
-       bool has_dcc_constant_encode;
+       /* Whether to enable NGG streamout. */
+       bool use_ngg_streamout;
 
        /* Number of threads per wave. */
        uint8_t ps_wave_size;
@@ -329,6 +318,9 @@ struct radv_instance {
        int                                         physicalDeviceCount;
        struct radv_physical_device                 physicalDevices[RADV_MAX_DRM_DEVICES];
 
+       char *                                      engineName;
+       uint32_t                                    engineVersion;
+
        uint64_t debug_flags;
        uint64_t perftest_flags;
 
@@ -705,7 +697,6 @@ struct radv_device {
        struct radeon_cmdbuf *empty_cs[RADV_MAX_QUEUE_FAMILIES];
 
        bool always_use_syncobj;
-       bool has_distributed_tess;
        bool pbb_allowed;
        bool dfsm_allowed;
        uint32_t tess_offchip_block_dw_size;
@@ -1331,7 +1322,7 @@ unsigned radv_get_default_max_sample_dist(int log_samples);
 void radv_device_init_msaa(struct radv_device *device);
 
 void radv_update_ds_clear_metadata(struct radv_cmd_buffer *cmd_buffer,
-                                  struct radv_image *image,
+                                  const struct radv_image_view *iview,
                                   VkClearDepthStencilValue ds_clear_value,
                                   VkImageAspectFlags aspects);
 
@@ -1805,6 +1796,24 @@ radv_image_get_dcc_pred_va(const struct radv_image *image,
        return va;
 }
 
+static inline uint64_t
+radv_get_tc_compat_zrange_va(const struct radv_image *image,
+                            uint32_t base_level)
+{
+       uint64_t va = radv_buffer_get_va(image->bo);
+       va += image->offset + image->tc_compat_zrange_offset + base_level * 4;
+       return va;
+}
+
+static inline uint64_t
+radv_get_ds_clear_value_va(const struct radv_image *image,
+                          uint32_t base_level)
+{
+       uint64_t va = radv_buffer_get_va(image->bo);
+       va += image->offset + image->clear_value_offset + base_level * 8;
+       return va;
+}
+
 unsigned radv_image_queue_family_mask(const struct radv_image *image, uint32_t family, uint32_t queue_family);
 
 static inline uint32_t
@@ -2104,18 +2113,18 @@ struct radv_fence {
 };
 
 /* radv_nir_to_llvm.c */
-struct radv_shader_variant_info;
+struct radv_shader_info;
 struct radv_nir_compiler_options;
 
 void radv_compile_gs_copy_shader(struct ac_llvm_compiler *ac_llvm,
                                 struct nir_shader *geom_shader,
                                 struct radv_shader_binary **rbinary,
-                                struct radv_shader_variant_info *shader_info,
+                                struct radv_shader_info *info,
                                 const struct radv_nir_compiler_options *option);
 
 void radv_compile_nir_shader(struct ac_llvm_compiler *ac_llvm,
                             struct radv_shader_binary **rbinary,
-                            struct radv_shader_variant_info *shader_info,
+                            struct radv_shader_info *info,
                             struct nir_shader *const *nir,
                             int nir_count,
                             const struct radv_nir_compiler_options *options);
@@ -2126,9 +2135,11 @@ unsigned radv_nir_get_max_workgroup_size(enum chip_class chip_class,
 
 /* radv_shader_info.h */
 struct radv_shader_info;
+struct radv_shader_variant_key;
 
 void radv_nir_shader_info_pass(const struct nir_shader *nir,
-                              const struct radv_nir_compiler_options *options,
+                              const struct radv_pipeline_layout *layout,
+                              const struct radv_shader_variant_key *key,
                               struct radv_shader_info *info);
 
 void radv_nir_shader_info_init(struct radv_shader_info *info);