gallium/radeon: change some driver query types to Hz
[mesa.git] / src / gallium / drivers / ilo / ilo_shader.h
index 6a2b8a397b39679eb1fdcf6a59a2b8beebb9674e..d9f02a4746a7bbc9774973a11bc5b0d36126d69c 100644 (file)
 #ifndef ILO_SHADER_H
 #define ILO_SHADER_H
 
+#include "core/ilo_state_shader.h"
+
 #include "ilo_common.h"
 
 enum ilo_kernel_param {
    ILO_KERNEL_INPUT_COUNT,
    ILO_KERNEL_OUTPUT_COUNT,
+   ILO_KERNEL_SAMPLER_COUNT,
    ILO_KERNEL_URB_DATA_START_REG,
+   ILO_KERNEL_SKIP_CBUF0_UPLOAD,
+   ILO_KERNEL_PCB_CBUF0_SIZE,
+
+   ILO_KERNEL_SURFACE_TOTAL_COUNT,
+   ILO_KERNEL_SURFACE_TEX_BASE,
+   ILO_KERNEL_SURFACE_TEX_COUNT,
+   ILO_KERNEL_SURFACE_CONST_BASE,
+   ILO_KERNEL_SURFACE_CONST_COUNT,
+   ILO_KERNEL_SURFACE_RES_BASE,
+   ILO_KERNEL_SURFACE_RES_COUNT,
 
    ILO_KERNEL_VS_INPUT_INSTANCEID,
    ILO_KERNEL_VS_INPUT_VERTEXID,
@@ -44,9 +57,12 @@ enum ilo_kernel_param {
    ILO_KERNEL_VS_GEN6_SO_POINT_OFFSET,
    ILO_KERNEL_VS_GEN6_SO_LINE_OFFSET,
    ILO_KERNEL_VS_GEN6_SO_TRI_OFFSET,
+   ILO_KERNEL_VS_GEN6_SO_SURFACE_COUNT,
 
    ILO_KERNEL_GS_DISCARD_ADJACENCY,
    ILO_KERNEL_GS_GEN6_SVBI_POST_INC,
+   ILO_KERNEL_GS_GEN6_SURFACE_SO_BASE,
+   ILO_KERNEL_GS_GEN6_SURFACE_SO_COUNT,
 
    ILO_KERNEL_FS_INPUT_Z,
    ILO_KERNEL_FS_INPUT_W,
@@ -54,25 +70,40 @@ enum ilo_kernel_param {
    ILO_KERNEL_FS_USE_KILL,
    ILO_KERNEL_FS_BARYCENTRIC_INTERPOLATIONS,
    ILO_KERNEL_FS_DISPATCH_16_OFFSET,
+   ILO_KERNEL_FS_SURFACE_RT_BASE,
+   ILO_KERNEL_FS_SURFACE_RT_COUNT,
 
-   ILO_KERNEL_PARAM_COUNT,
-};
-
-struct ilo_kernel_routing {
-   uint32_t const_interp_enable;
-   uint32_t point_sprite_enable;
-   unsigned source_skip, source_len;
+   ILO_KERNEL_CS_LOCAL_SIZE,
+   ILO_KERNEL_CS_PRIVATE_SIZE,
+   ILO_KERNEL_CS_INPUT_SIZE,
+   ILO_KERNEL_CS_SIMD_SIZE,
+   ILO_KERNEL_CS_SURFACE_GLOBAL_BASE,
+   ILO_KERNEL_CS_SURFACE_GLOBAL_COUNT,
 
-   bool swizzle_enable;
-   uint16_t swizzles[16];
+   ILO_KERNEL_PARAM_COUNT,
 };
 
 struct intel_bo;
-struct ilo_context;
+struct ilo_builder;
 struct ilo_rasterizer_state;
 struct ilo_shader_cache;
 struct ilo_shader_state;
-struct ilo_shader_cso;
+struct ilo_state_sbe;
+struct ilo_state_sol;
+struct ilo_state_vector;
+
+union ilo_shader_cso {
+   struct ilo_state_vs vs;
+   struct ilo_state_hs hs;
+   struct ilo_state_ds ds;
+   struct ilo_state_gs gs;
+   struct ilo_state_ps ps;
+
+   struct {
+      struct ilo_state_vs vs;
+      struct ilo_state_gs sol;
+   } vs_sol;
+};
 
 struct ilo_shader_cache *
 ilo_shader_cache_create(void);
@@ -88,30 +119,32 @@ void
 ilo_shader_cache_remove(struct ilo_shader_cache *shc,
                         struct ilo_shader_state *shader);
 
-int
+void
 ilo_shader_cache_upload(struct ilo_shader_cache *shc,
-                        struct intel_bo *bo, unsigned offset,
-                        bool incremental);
+                        struct ilo_builder *builder);
+
+void
+ilo_shader_cache_invalidate(struct ilo_shader_cache *shc);
 
 struct ilo_shader_state *
-ilo_shader_create_vs(const struct ilo_dev_info *dev,
+ilo_shader_create_vs(const struct ilo_dev *dev,
                      const struct pipe_shader_state *state,
-                     const struct ilo_context *precompile);
+                     const struct ilo_state_vector *precompile);
 
 struct ilo_shader_state *
-ilo_shader_create_gs(const struct ilo_dev_info *dev,
+ilo_shader_create_gs(const struct ilo_dev *dev,
                      const struct pipe_shader_state *state,
-                     const struct ilo_context *precompile);
+                     const struct ilo_state_vector *precompile);
 
 struct ilo_shader_state *
-ilo_shader_create_fs(const struct ilo_dev_info *dev,
+ilo_shader_create_fs(const struct ilo_dev *dev,
                      const struct pipe_shader_state *state,
-                     const struct ilo_context *precompile);
+                     const struct ilo_state_vector *precompile);
 
 struct ilo_shader_state *
-ilo_shader_create_cs(const struct ilo_dev_info *dev,
+ilo_shader_create_cs(const struct ilo_dev *dev,
                      const struct pipe_compute_state *state,
-                     const struct ilo_context *precompile);
+                     const struct ilo_state_vector *precompile);
 
 void
 ilo_shader_destroy(struct ilo_shader_state *shader);
@@ -121,13 +154,13 @@ ilo_shader_get_type(const struct ilo_shader_state *shader);
 
 bool
 ilo_shader_select_kernel(struct ilo_shader_state *shader,
-                         const struct ilo_context *ilo,
+                         const struct ilo_state_vector *vec,
                          uint32_t dirty);
 
 bool
-ilo_shader_select_kernel_routing(struct ilo_shader_state *shader,
-                                 const struct ilo_shader_state *source,
-                                 const struct ilo_rasterizer_state *rasterizer);
+ilo_shader_select_kernel_sbe(struct ilo_shader_state *shader,
+                             const struct ilo_shader_state *source,
+                             const struct ilo_rasterizer_state *rasterizer);
 
 uint32_t
 ilo_shader_get_kernel_offset(const struct ilo_shader_state *shader);
@@ -136,13 +169,16 @@ int
 ilo_shader_get_kernel_param(const struct ilo_shader_state *shader,
                             enum ilo_kernel_param param);
 
-const struct ilo_shader_cso *
+const union ilo_shader_cso *
 ilo_shader_get_kernel_cso(const struct ilo_shader_state *shader);
 
 const struct pipe_stream_output_info *
 ilo_shader_get_kernel_so_info(const struct ilo_shader_state *shader);
 
-const struct ilo_kernel_routing *
-ilo_shader_get_kernel_routing(const struct ilo_shader_state *shader);
+const struct ilo_state_sol *
+ilo_shader_get_kernel_sol(const struct ilo_shader_state *shader);
+
+const struct ilo_state_sbe *
+ilo_shader_get_kernel_sbe(const struct ilo_shader_state *shader);
 
 #endif /* ILO_SHADER_H */