v3d: Stop tracking num_inputs for VPM loads.
authorEric Anholt <eric@anholt.net>
Fri, 15 Feb 2019 05:01:05 +0000 (21:01 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 19 Feb 2019 02:09:07 +0000 (18:09 -0800)
It's unused in the VS (since we need vattr_sizes[] anyway), so move it to
FS prog data.

src/broadcom/compiler/nir_to_vir.c
src/broadcom/compiler/v3d_compiler.h
src/broadcom/compiler/vir.c
src/broadcom/compiler/vir_opt_dead_code.c
src/gallium/drivers/v3d/v3d_program.c
src/gallium/drivers/v3d/v3dx_draw.c

index 331fc5d73c6b0a96c70596e4e55cf4a83099552e..27694f66a441b42e3c3138595c19ab40d78fe18e 100644 (file)
@@ -1481,7 +1481,6 @@ ntq_emit_vpm_read(struct v3d_compile *c,
 
         if (*num_components_queued != 0) {
                 (*num_components_queued)--;
-                c->num_inputs++;
                 return vir_MOV(c, vpm);
         }
 
@@ -1491,7 +1490,6 @@ ntq_emit_vpm_read(struct v3d_compile *c,
 
         *num_components_queued = num_components - 1;
         *remaining -= num_components;
-        c->num_inputs++;
 
         return vir_MOV(c, vpm);
 }
index cb55e2bb51818dba18d1283a514cbb501b5d6852..3995bb1e74fc599983f180f761f9fb4e572a9a40 100644 (file)
@@ -675,7 +675,6 @@ struct v3d_prog_data {
         uint32_t ubo_size;
         uint32_t spill_size;
 
-        uint8_t num_inputs;
         uint8_t threads;
 
         /* For threads > 1, whether the program should be dispatched in the
@@ -723,6 +722,7 @@ struct v3d_fs_prog_data {
 
         uint32_t centroid_flags[((V3D_MAX_FS_INPUTS - 1) / 24) + 1];
 
+        uint8_t num_inputs;
         bool writes_z;
         bool disable_ez;
         bool uses_center_w;
index c0fb6b92c223af81aee24bf6f3a1167530fc0ab9..3b0274450e994955c28be6cc372e51977a409139 100644 (file)
@@ -665,8 +665,6 @@ static void
 v3d_vs_set_prog_data(struct v3d_compile *c,
                      struct v3d_vs_prog_data *prog_data)
 {
-        prog_data->base.num_inputs = c->num_inputs;
-
         /* The vertex data gets format converted by the VPM so that
          * each attribute channel takes up a VPM column.  Precompute
          * the sizes for the shader record.
@@ -722,7 +720,7 @@ static void
 v3d_set_fs_prog_data_inputs(struct v3d_compile *c,
                             struct v3d_fs_prog_data *prog_data)
 {
-        prog_data->base.num_inputs = c->num_inputs;
+        prog_data->num_inputs = c->num_inputs;
         memcpy(prog_data->input_slots, c->input_slots,
                c->num_inputs * sizeof(*c->input_slots));
 
index a486708bfa552402413f145814f3ba39a6d44aea..56b276d581b1eb6529ab0f89a2cf39ee9ecf84b5 100644 (file)
@@ -194,7 +194,6 @@ vir_opt_dead_code(struct v3d_compile *c)
                                 uint32_t offset = (inst->src[i].index % 4);
 
                                 if (c->vattr_sizes[attr] == offset) {
-                                        c->num_inputs--;
                                         c->vattr_sizes[attr]--;
                                 }
                         }
index 30769047a9617801563634f51edfb3b1ec298ada..0224df08d0b513557d1b5c0a4110ccfed09b3619 100644 (file)
@@ -614,7 +614,7 @@ v3d_update_compiled_vs(struct v3d_context *v3d, uint8_t prim_mode)
         memset(key, 0, sizeof(*key));
         v3d_setup_shared_key(v3d, &key->base, &v3d->tex[PIPE_SHADER_VERTEX]);
         key->base.shader_state = v3d->prog.bind_vs;
-        key->num_fs_inputs = v3d->prog.fs->prog_data.fs->base.num_inputs;
+        key->num_fs_inputs = v3d->prog.fs->prog_data.fs->num_inputs;
         STATIC_ASSERT(sizeof(key->fs_inputs) ==
                       sizeof(v3d->prog.fs->prog_data.fs->input_slots));
         memcpy(key->fs_inputs, v3d->prog.fs->prog_data.fs->input_slots,
index 60fe745fbd36af189776594c2260df86210df23c..ebdc436318d824744a136c8ef782daa8a8bfa2be 100644 (file)
@@ -215,7 +215,7 @@ v3d_emit_gl_shader_state(struct v3d_context *v3d,
                         v3d->prog.fs->prog_data.fs->uses_center_w;
 
                 shader.number_of_varyings_in_fragment_shader =
-                        v3d->prog.fs->prog_data.base->num_inputs;
+                        v3d->prog.fs->prog_data.fs->num_inputs;
 
                 shader.coordinate_shader_propagate_nans = true;
                 shader.vertex_shader_propagate_nans = true;