radeonsi: kill point size VS output if it's not used by the rasterizer
[mesa.git] / src / gallium / drivers / radeonsi / si_shader.h
index 8694bc58ab71469aecf4980ca196de9412c5684d..d26f36a43880e57667df03a0fdc194b18b679f84 100644 (file)
@@ -267,9 +267,6 @@ enum
 
 enum
 {
-   /* Use a property enum that CS wouldn't use. */
-   TGSI_PROPERTY_CS_LOCAL_SIZE = TGSI_PROPERTY_FS_COORD_ORIGIN,
-
    /* These represent the number of SGPRs the shader uses. */
    SI_VS_BLIT_SGPRS_POS = 3,
    SI_VS_BLIT_SGPRS_POS_COLOR = 7,
@@ -319,6 +316,8 @@ struct si_compiler_ctx_state {
 };
 
 struct si_shader_info {
+   shader_info base;
+
    gl_shader_stage stage;
 
    ubyte num_inputs;
@@ -336,40 +335,34 @@ struct si_shader_info {
    ubyte color_interpolate_loc[2];
 
    int constbuf0_num_slots;
-   unsigned const_buffers_declared; /**< bitmask of declared const buffers */
-   unsigned samplers_declared;      /**< bitmask of declared samplers */
    ubyte num_stream_output_components[4];
 
-   uint num_memory_instructions; /**< sampler, buffer, and image instructions */
+   uint num_memory_stores;
 
    ubyte colors_read; /**< which color components are read by the FS */
    ubyte colors_written;
+   bool color0_writes_all_cbufs; /**< gl_FragColor */
    bool reads_samplemask;   /**< does fragment shader read sample mask? */
    bool reads_tess_factors; /**< If TES reads TESSINNER or TESSOUTER */
    bool writes_z;           /**< does fragment shader write Z value? */
    bool writes_stencil;     /**< does fragment shader write stencil value? */
    bool writes_samplemask;  /**< does fragment shader write sample mask? */
    bool writes_edgeflag;    /**< vertex shader outputs edgeflag */
-   bool uses_kill;          /**< KILL or KILL_IF instruction used? */
    bool uses_persp_center;
    bool uses_persp_centroid;
    bool uses_persp_sample;
    bool uses_linear_center;
    bool uses_linear_centroid;
    bool uses_linear_sample;
-   bool uses_persp_opcode_interp_sample;
-   bool uses_linear_opcode_interp_sample;
+   bool uses_interp_at_sample;
    bool uses_instanceid;
-   bool uses_vertexid;
-   bool uses_vertexid_nobase;
-   bool uses_basevertex;
    bool uses_drawid;
    bool uses_primid;
    bool uses_frontface;
    bool uses_invocationid;
    bool uses_thread_id[3];
    bool uses_block_id[3];
-   bool uses_block_size;
+   bool uses_variable_block_size;
    bool uses_grid_size;
    bool uses_subgroup_info;
    bool writes_position;
@@ -378,22 +371,9 @@ struct si_shader_info {
    bool writes_primid;
    bool writes_viewport_index;
    bool writes_layer;
-   bool writes_memory; /**< contains stores or atomics to buffers or images */
-   bool uses_derivatives;
    bool uses_bindless_samplers;
    bool uses_bindless_images;
    bool uses_fbfetch;
-   unsigned clipdist_writemask;
-   unsigned culldist_writemask;
-   unsigned num_written_culldistance;
-   unsigned num_written_clipdistance;
-
-   unsigned images_declared;         /**< bitmask of declared images */
-   unsigned image_buffers;           /**< bitmask of images that are buffers */
-   unsigned msaa_images_declared;    /**< bitmask of declared MSAA images */
-   unsigned shader_buffers_declared; /**< bitmask of declared shader buffers */
-
-   unsigned properties[TGSI_PROPERTY_COUNT]; /* index with TGSI_PROPERTY_ */
 
    /** Whether all codepaths write tess factors in all invocations. */
    bool tessfactors_are_def_in_all_invocs;
@@ -440,30 +420,26 @@ struct si_shader_selector {
    ubyte cs_images_sgpr_index;
    ubyte cs_images_num_sgprs;
    ubyte cs_num_images_in_user_sgprs;
-   unsigned num_vs_inputs;
-   unsigned num_vbos_in_user_sgprs;
+   ubyte num_vs_inputs;
+   ubyte num_vbos_in_user_sgprs;
    unsigned pa_cl_vs_out_cntl;
    ubyte clipdist_mask;
    ubyte culldist_mask;
-   unsigned rast_prim;
+   ubyte rast_prim;
 
    /* ES parameters. */
-   unsigned esgs_itemsize; /* vertex stride */
-   unsigned lshs_vertex_stride;
+   uint16_t esgs_itemsize; /* vertex stride */
+   uint16_t lshs_vertex_stride;
 
    /* GS parameters. */
-   unsigned gs_input_verts_per_prim;
-   unsigned gs_output_prim;
-   unsigned gs_max_out_vertices;
-   unsigned gs_num_invocations;
-   unsigned max_gs_stream; /* count - 1 */
-   unsigned gsvs_vertex_size;
+   uint16_t gsvs_vertex_size;
+   ubyte gs_input_verts_per_prim;
    unsigned max_gsvs_emit_size;
-   unsigned enabled_streamout_buffer_mask;
+   uint16_t enabled_streamout_buffer_mask;
    bool tess_turns_off_ngg;
 
    /* PS parameters. */
-   unsigned color_attr_index[2];
+   ubyte color_attr_index[2];
    unsigned db_shader_control;
    /* Set 0xf or 0x0 (4 bits) per each written output.
     * ANDed with spi_shader_col_format.
@@ -661,6 +637,7 @@ struct si_shader_key {
    struct {
       /* For HW VS (it can be VS, TES, GS) */
       uint64_t kill_outputs; /* "get_unique_index" bits */
+      unsigned kill_pointsize : 1;
       unsigned clip_disable : 1;
 
       /* For NGG VS and TES. */