nir: Rename num_shared to shared_size
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 31 Aug 2020 18:04:50 +0000 (13:04 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Sep 2020 17:30:51 +0000 (17:30 +0000)
This one is always a size in bytes.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6524>

src/compiler/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_clone.c
src/compiler/nir/nir_lower_io.c
src/compiler/nir/nir_print.c
src/compiler/nir/nir_serialize.c
src/intel/compiler/brw_fs.cpp

index aa259806d541fa280c55edab6548ce21b279e796..79e4ae3002703a663e0afb78834030c9f377c245 100644 (file)
@@ -60,7 +60,7 @@ nir_shader_create(void *mem_ctx,
    shader->num_inputs = 0;
    shader->num_outputs = 0;
    shader->num_uniforms = 0;
-   shader->num_shared = 0;
+   shader->shared_size = 0;
 
    return shader;
 }
index e5091831350a3de3b86623ffc68160fdda2fb108..6195a66fd25e92e69e59877e89ff340983e46ead 100644 (file)
@@ -3325,7 +3325,10 @@ typedef struct nir_shader {
     * the highest index a load_input_*, load_uniform_*, etc. intrinsic can
     * access plus one
     */
-   unsigned num_inputs, num_uniforms, num_outputs, num_shared;
+   unsigned num_inputs, num_uniforms, num_outputs;
+
+   /** Size in bytes of required shared memory */
+   unsigned shared_size;
 
    /** Size in bytes of required scratch space */
    unsigned scratch_size;
index 9e0bd7bf8918cbf9f61c9f1e9b170ab04c490144..946b9ebf0a75fc97106ebd1f502004875c7eea8d 100644 (file)
@@ -756,7 +756,7 @@ nir_shader_clone(void *mem_ctx, const nir_shader *s)
    ns->num_inputs = s->num_inputs;
    ns->num_uniforms = s->num_uniforms;
    ns->num_outputs = s->num_outputs;
-   ns->num_shared = s->num_shared;
+   ns->shared_size = s->shared_size;
    ns->scratch_size = s->scratch_size;
 
    ns->constant_data_size = s->constant_data_size;
index be1cfdfef3876033d6f566f26ab397160915315f..9250a7ec1bbfde5eba09376d62bb34402d0e4dab 100644 (file)
@@ -1578,7 +1578,7 @@ lower_vars_to_explicit(nir_shader *shader,
       break;
    case nir_var_mem_shared:
       shader->info.cs.shared_size = offset;
-      shader->num_shared = offset;
+      shader->shared_size = offset;
       break;
    default:
       unreachable("Unsupported mode");
index 00cf235166b35cbd80487dce9695050372e87b79..07d1cdc3c79c31dcd412ff688647bb6abdf4719f 100644 (file)
@@ -1586,7 +1586,7 @@ nir_print_shader_annotated(nir_shader *shader, FILE *fp,
    fprintf(fp, "uniforms: %u\n", shader->num_uniforms);
    if (shader->info.num_ubos)
       fprintf(fp, "ubos: %u\n", shader->info.num_ubos);
-   fprintf(fp, "shared: %u\n", shader->num_shared);
+   fprintf(fp, "shared: %u\n", shader->shared_size);
    if (shader->scratch_size)
       fprintf(fp, "scratch: %u\n", shader->scratch_size);
    if (shader->constant_data_size)
index 626b7d44a021ddaff019c1aa1a30e0528b1c1d75..33c740cf623ce75e496bd72aeb15fa20ac2994cf 100644 (file)
@@ -2022,7 +2022,7 @@ nir_serialize(struct blob *blob, const nir_shader *nir, bool strip)
    blob_write_uint32(blob, nir->num_inputs);
    blob_write_uint32(blob, nir->num_uniforms);
    blob_write_uint32(blob, nir->num_outputs);
-   blob_write_uint32(blob, nir->num_shared);
+   blob_write_uint32(blob, nir->shared_size);
    blob_write_uint32(blob, nir->scratch_size);
 
    blob_write_uint32(blob, exec_list_length(&nir->functions));
@@ -2075,7 +2075,7 @@ nir_deserialize(void *mem_ctx,
    ctx.nir->num_inputs = blob_read_uint32(blob);
    ctx.nir->num_uniforms = blob_read_uint32(blob);
    ctx.nir->num_outputs = blob_read_uint32(blob);
-   ctx.nir->num_shared = blob_read_uint32(blob);
+   ctx.nir->shared_size = blob_read_uint32(blob);
    ctx.nir->scratch_size = blob_read_uint32(blob);
 
    unsigned num_functions = blob_read_uint32(blob);
index ec08d84554a68e8f291036f1eba0182592300a1a..2cf05a2fdfb816961f07c23749d9e714bbdff37b 100644 (file)
@@ -8948,7 +8948,7 @@ brw_compile_cs(const struct brw_compiler *compiler, void *log_data,
                char **error_str)
 {
    prog_data->base.total_shared = src_shader->info.cs.shared_size;
-   prog_data->slm_size = src_shader->num_shared;
+   prog_data->slm_size = src_shader->shared_size;
 
    /* Generate code for all the possible SIMD variants. */
    bool generate_all;