radeonsi: remove redundant si_shader_info::writes_memory
[mesa.git] / src / gallium / drivers / radeonsi / si_shader_llvm_gs.c
index 0cda555328e243eaac34f68a22bc36d1ddf81f20..c7e331114ac5a5d7c56e6fd3368a756554af7002 100644 (file)
@@ -49,12 +49,10 @@ static LLVMValueRef si_llvm_load_input_gs(struct ac_shader_abi *abi, unsigned in
    struct si_shader *shader = ctx->shader;
    LLVMValueRef vtx_offset, soffset;
    struct si_shader_info *info = &shader->selector->info;
-   unsigned semantic_name = info->input_semantic_name[input_index];
-   unsigned semantic_index = info->input_semantic_index[input_index];
    unsigned param;
    LLVMValueRef value;
 
-   param = si_shader_io_get_unique_index(semantic_name, semantic_index, false);
+   param = si_shader_io_get_unique_index(info->input_semantic[input_index], false);
 
    /* GFX9 has the ESGS ring in LDS. */
    if (ctx->screen->info.chip_class >= GFX9) {
@@ -162,7 +160,7 @@ static void si_set_es_return_value_for_gs(struct si_shader_context *ctx)
    }
 
    unsigned vgpr;
-   if (ctx->type == PIPE_SHADER_VERTEX)
+   if (ctx->stage == MESA_SHADER_VERTEX)
       vgpr = 8 + GFX9_VSGS_NUM_USER_SGPR;
    else
       vgpr = 8 + GFX9_TESGS_NUM_USER_SGPR;
@@ -200,12 +198,11 @@ void si_llvm_emit_es_epilogue(struct ac_shader_abi *abi, unsigned max_outputs, L
    for (i = 0; i < info->num_outputs; i++) {
       int param;
 
-      if (info->output_semantic_name[i] == TGSI_SEMANTIC_VIEWPORT_INDEX ||
-          info->output_semantic_name[i] == TGSI_SEMANTIC_LAYER)
+      if (info->output_semantic[i] == VARYING_SLOT_VIEWPORT ||
+          info->output_semantic[i] == VARYING_SLOT_LAYER)
          continue;
 
-      param = si_shader_io_get_unique_index(info->output_semantic_name[i],
-                                            info->output_semantic_index[i], false);
+      param = si_shader_io_get_unique_index(info->output_semantic[i], false);
 
       for (chan = 0; chan < 4; chan++) {
          if (!(info->output_usagemask[i] & (1 << chan)))
@@ -300,7 +297,7 @@ static void si_llvm_emit_vertex(struct ac_shader_abi *abi, unsigned stream, LLVM
       LLVMBuildICmp(ctx->ac.builder, LLVMIntULT, gs_next_vertex,
                     LLVMConstInt(ctx->ac.i32, shader->selector->gs_max_out_vertices, 0), "");
 
-   bool use_kill = !info->writes_memory;
+   bool use_kill = !info->base.writes_memory;
    if (use_kill) {
       ac_build_kill_if_false(&ctx->ac, can_emit);
    } else {
@@ -360,7 +357,7 @@ static void si_llvm_emit_primitive(struct ac_shader_abi *abi, unsigned stream)
 void si_preload_esgs_ring(struct si_shader_context *ctx)
 {
    if (ctx->screen->info.chip_class <= GFX8) {
-      unsigned ring = ctx->type == PIPE_SHADER_GEOMETRY ? SI_GS_RING_ESGS : SI_ES_RING_ESGS;
+      unsigned ring = ctx->stage == MESA_SHADER_GEOMETRY ? SI_GS_RING_ESGS : SI_ES_RING_ESGS;
       LLVMValueRef offset = LLVMConstInt(ctx->ac.i32, ring, 0);
       LLVMValueRef buf_ptr = ac_get_arg(&ctx->ac, ctx->rw_buffers);
 
@@ -477,7 +474,7 @@ struct si_shader *si_generate_gs_copy_shader(struct si_screen *sscreen,
                         si_get_wave_size(sscreen, MESA_SHADER_VERTEX,
                                          false, false, false, false));
    ctx.shader = shader;
-   ctx.type = PIPE_SHADER_VERTEX;
+   ctx.stage = MESA_SHADER_VERTEX;
 
    builder = ctx.ac.builder;
 
@@ -500,8 +497,7 @@ struct si_shader *si_generate_gs_copy_shader(struct si_screen *sscreen,
 
    /* Fill in output information. */
    for (i = 0; i < gsinfo->num_outputs; ++i) {
-      outputs[i].semantic_name = gsinfo->output_semantic_name[i];
-      outputs[i].semantic_index = gsinfo->output_semantic_index[i];
+      outputs[i].semantic = gsinfo->output_semantic[i];
 
       for (int chan = 0; chan < 4; chan++) {
          outputs[i].vertex_stream[chan] = (gsinfo->output_streams[i] >> (2 * chan)) & 3;
@@ -563,13 +559,13 @@ struct si_shader *si_generate_gs_copy_shader(struct si_screen *sscreen,
 
    LLVMBuildRetVoid(ctx.ac.builder);
 
-   ctx.type = PIPE_SHADER_GEOMETRY; /* override for shader dumping */
+   ctx.stage = MESA_SHADER_GEOMETRY; /* override for shader dumping */
    si_llvm_optimize_module(&ctx);
 
    bool ok = false;
    if (si_compile_llvm(sscreen, &ctx.shader->binary, &ctx.shader->config, ctx.compiler, &ctx.ac,
-                       debug, PIPE_SHADER_GEOMETRY, "GS Copy Shader", false)) {
-      if (si_can_dump_shader(sscreen, PIPE_SHADER_GEOMETRY))
+                       debug, MESA_SHADER_GEOMETRY, "GS Copy Shader", false)) {
+      if (si_can_dump_shader(sscreen, MESA_SHADER_GEOMETRY))
          fprintf(stderr, "GS Copy Shader:\n");
       si_shader_dump(sscreen, ctx.shader, debug, stderr, true);