Mesa (main): ir3: Use ir3_shader_variant::type more often

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri May 13 17:52:17 UTC 2022


Module: Mesa
Branch: main
Commit: 21e3dd57d3d7699155b183f19dfc8bac8bb9e383
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=21e3dd57d3d7699155b183f19dfc8bac8bb9e383

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Wed Feb 16 18:19:58 2022 +0100

ir3: Use ir3_shader_variant::type more often

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16147>

---

 src/freedreno/ir3/ir3_nir.c        | 2 +-
 src/freedreno/ir3/ir3_shader.c     | 4 ++--
 src/freedreno/ir3/ir3_shader.h     | 6 +++---
 src/freedreno/vulkan/tu_pipeline.c | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/freedreno/ir3/ir3_nir.c b/src/freedreno/ir3/ir3_nir.c
index 6a3bce58687..4ecc60e79bf 100644
--- a/src/freedreno/ir3/ir3_nir.c
+++ b/src/freedreno/ir3/ir3_nir.c
@@ -571,7 +571,7 @@ ir3_nir_lower_variant(struct ir3_shader_variant *so, nir_shader *s)
    bool progress = false;
 
    if (so->key.has_gs || so->key.tessellation) {
-      switch (so->shader->type) {
+      switch (so->type) {
       case MESA_SHADER_VERTEX:
          NIR_PASS_V(s, ir3_nir_lower_to_explicit_output, so,
                     so->key.tessellation);
diff --git a/src/freedreno/ir3/ir3_shader.c b/src/freedreno/ir3/ir3_shader.c
index 5aec6a77a28..927635b4690 100644
--- a/src/freedreno/ir3/ir3_shader.c
+++ b/src/freedreno/ir3/ir3_shader.c
@@ -233,7 +233,7 @@ assemble_variant(struct ir3_shader_variant *v)
 {
    v->bin = ir3_shader_assemble(v);
 
-   bool dbg_enabled = shader_debug_enabled(v->shader->type);
+   bool dbg_enabled = shader_debug_enabled(v->type);
    if (dbg_enabled || ir3_shader_override_path || v->disasm_info.write_disasm) {
       unsigned char sha1[21];
       char sha1buf[41];
@@ -272,7 +272,7 @@ assemble_variant(struct ir3_shader_variant *v)
                  "Native code%s for unnamed %s shader %s with sha1 %s:\n",
                  shader_overridden ? " (overridden)" : "", ir3_shader_stage(v),
                  v->name, sha1buf);
-         if (v->shader->type == MESA_SHADER_FRAGMENT)
+         if (v->type == MESA_SHADER_FRAGMENT)
             fprintf(stream, "SIMD0\n");
          ir3_shader_disasm(v, v->bin, stream);
          fclose(stream);
diff --git a/src/freedreno/ir3/ir3_shader.h b/src/freedreno/ir3/ir3_shader.h
index 8ab5c4a01bb..c6f912a822f 100644
--- a/src/freedreno/ir3/ir3_shader.h
+++ b/src/freedreno/ir3/ir3_shader.h
@@ -898,12 +898,12 @@ ir3_max_const(const struct ir3_shader_variant *v)
 {
    const struct ir3_compiler *compiler = v->shader->compiler;
 
-   if ((v->shader->type == MESA_SHADER_COMPUTE) ||
-       (v->shader->type == MESA_SHADER_KERNEL)) {
+   if ((v->type == MESA_SHADER_COMPUTE) ||
+       (v->type == MESA_SHADER_KERNEL)) {
       return compiler->max_const_compute;
    } else if (v->key.safe_constlen) {
       return compiler->max_const_safe;
-   } else if (v->shader->type == MESA_SHADER_FRAGMENT) {
+   } else if (v->type == MESA_SHADER_FRAGMENT) {
       return compiler->max_const_frag;
    } else {
       return compiler->max_const_geom;
diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c
index 6b4946e28cc..d97141348bf 100644
--- a/src/freedreno/vulkan/tu_pipeline.c
+++ b/src/freedreno/vulkan/tu_pipeline.c
@@ -2393,7 +2393,7 @@ tu_append_executable(struct tu_pipeline *pipeline, struct ir3_shader_variant *va
    ralloc_steal(pipeline->executables_mem_ctx, variant->disasm_info.disasm);
 
    struct tu_pipeline_executable exe = {
-      .stage = variant->shader->type,
+      .stage = variant->type,
       .nir_from_spirv = nir_from_spirv,
       .nir_final = variant->disasm_info.nir,
       .disasm = variant->disasm_info.disasm,



More information about the mesa-commit mailing list