radeonsi: stop using TGSI_PROPERTY_GS_*
authorMarek Olšák <marek.olsak@amd.com>
Tue, 1 Sep 2020 22:08:05 +0000 (18:08 -0400)
committerVivek Pandya <vivekvpandya@gmail.com>
Mon, 7 Sep 2020 15:55:16 +0000 (21:25 +0530)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6624>

src/gallium/drivers/radeonsi/si_shader_nir.c
src/gallium/drivers/radeonsi/si_state_shaders.c

index a6e5fb8e89b5c3d2aaf9eca94894fe0a6001c106..3bbba5eacf4b7520a35ac5aaf4341b79a35825ec 100644 (file)
@@ -461,13 +461,6 @@ void si_nir_scan_shader(const struct nir_shader *nir, struct si_shader_info *inf
          info->base.tess.primitive_mode = GL_LINES;
    }
 
          info->base.tess.primitive_mode = GL_LINES;
    }
 
-   if (nir->info.stage == MESA_SHADER_GEOMETRY) {
-      info->properties[TGSI_PROPERTY_GS_INPUT_PRIM] = nir->info.gs.input_primitive;
-      info->properties[TGSI_PROPERTY_GS_OUTPUT_PRIM] = nir->info.gs.output_primitive;
-      info->properties[TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES] = nir->info.gs.vertices_out;
-      info->properties[TGSI_PROPERTY_GS_INVOCATIONS] = nir->info.gs.invocations;
-   }
-
    if (nir->info.stage == MESA_SHADER_FRAGMENT) {
       info->properties[TGSI_PROPERTY_FS_EARLY_DEPTH_STENCIL] =
          nir->info.fs.early_fragment_tests | nir->info.fs.post_depth_coverage;
    if (nir->info.stage == MESA_SHADER_FRAGMENT) {
       info->properties[TGSI_PROPERTY_FS_EARLY_DEPTH_STENCIL] =
          nir->info.fs.early_fragment_tests | nir->info.fs.post_depth_coverage;
index caf526d558f96c63de6821c12d2973f7ac7263c5..99ca237e750b1fd4190df372ceaad11be25895a9 100644 (file)
@@ -618,7 +618,7 @@ void gfx9_get_gs_info(struct si_shader_selector *es, struct si_shader_selector *
                       struct gfx9_gs_info *out)
 {
    unsigned gs_num_invocations = MAX2(gs->gs_num_invocations, 1);
                       struct gfx9_gs_info *out)
 {
    unsigned gs_num_invocations = MAX2(gs->gs_num_invocations, 1);
-   unsigned input_prim = gs->info.properties[TGSI_PROPERTY_GS_INPUT_PRIM];
+   unsigned input_prim = gs->info.base.gs.input_primitive;
    bool uses_adjacency =
       input_prim >= PIPE_PRIM_LINES_ADJACENCY && input_prim <= PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY;
 
    bool uses_adjacency =
       input_prim >= PIPE_PRIM_LINES_ADJACENCY && input_prim <= PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY;
 
@@ -815,7 +815,7 @@ static void si_shader_gs(struct si_screen *sscreen, struct si_shader *shader)
    va = shader->bo->gpu_address;
 
    if (sscreen->info.chip_class >= GFX9) {
    va = shader->bo->gpu_address;
 
    if (sscreen->info.chip_class >= GFX9) {
-      unsigned input_prim = sel->info.properties[TGSI_PROPERTY_GS_INPUT_PRIM];
+      unsigned input_prim = sel->info.base.gs.input_primitive;
       gl_shader_stage es_stage = shader->key.part.gs.es->info.stage;
       unsigned es_vgpr_comp_cnt, gs_vgpr_comp_cnt;
 
       gl_shader_stage es_stage = shader->key.part.gs.es->info.stage;
       unsigned es_vgpr_comp_cnt, gs_vgpr_comp_cnt;
 
@@ -1022,7 +1022,7 @@ static void gfx10_emit_shader_ngg_tess_gs(struct si_context *sctx)
 unsigned si_get_input_prim(const struct si_shader_selector *gs)
 {
    if (gs->info.stage == MESA_SHADER_GEOMETRY)
 unsigned si_get_input_prim(const struct si_shader_selector *gs)
 {
    if (gs->info.stage == MESA_SHADER_GEOMETRY)
-      return gs->info.properties[TGSI_PROPERTY_GS_INPUT_PRIM];
+      return gs->info.base.gs.input_primitive;
 
    if (gs->info.stage == MESA_SHADER_TESS_EVAL) {
       if (gs->info.base.tess.point_mode)
 
    if (gs->info.stage == MESA_SHADER_TESS_EVAL) {
       if (gs->info.base.tess.point_mode)
@@ -2630,15 +2630,15 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
 
    switch (sel->info.stage) {
    case MESA_SHADER_GEOMETRY:
 
    switch (sel->info.stage) {
    case MESA_SHADER_GEOMETRY:
-      sel->gs_output_prim = sel->info.properties[TGSI_PROPERTY_GS_OUTPUT_PRIM];
+      sel->gs_output_prim = sel->info.base.gs.output_primitive;
 
       /* Only possibilities: POINTS, LINE_STRIP, TRIANGLES */
       sel->rast_prim = sel->gs_output_prim;
       if (util_rast_prim_is_triangles(sel->rast_prim))
          sel->rast_prim = PIPE_PRIM_TRIANGLES;
 
 
       /* Only possibilities: POINTS, LINE_STRIP, TRIANGLES */
       sel->rast_prim = sel->gs_output_prim;
       if (util_rast_prim_is_triangles(sel->rast_prim))
          sel->rast_prim = PIPE_PRIM_TRIANGLES;
 
-      sel->gs_max_out_vertices = sel->info.properties[TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES];
-      sel->gs_num_invocations = sel->info.properties[TGSI_PROPERTY_GS_INVOCATIONS];
+      sel->gs_max_out_vertices = sel->info.base.gs.vertices_out;
+      sel->gs_num_invocations = sel->info.base.gs.invocations;
       sel->gsvs_vertex_size = sel->info.num_outputs * 16;
       sel->max_gsvs_emit_size = sel->gsvs_vertex_size * sel->gs_max_out_vertices;
 
       sel->gsvs_vertex_size = sel->info.num_outputs * 16;
       sel->max_gsvs_emit_size = sel->gsvs_vertex_size * sel->gs_max_out_vertices;
 
@@ -2647,7 +2647,7 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
          sel->max_gs_stream = MAX2(sel->max_gs_stream, sel->so.output[i].stream);
 
       sel->gs_input_verts_per_prim =
          sel->max_gs_stream = MAX2(sel->max_gs_stream, sel->so.output[i].stream);
 
       sel->gs_input_verts_per_prim =
-         u_vertices_per_prim(sel->info.properties[TGSI_PROPERTY_GS_INPUT_PRIM]);
+         u_vertices_per_prim(sel->info.base.gs.input_primitive);
 
       /* EN_MAX_VERT_OUT_PER_GS_INSTANCE does not work with tesselation so
        * we can't split workgroups. Disable ngg if any of the following conditions is true:
 
       /* EN_MAX_VERT_OUT_PER_GS_INSTANCE does not work with tesselation so
        * we can't split workgroups. Disable ngg if any of the following conditions is true: