v3d: Rename v3d_tmu_config_data to v3d_unit_data.
authorEric Anholt <eric@anholt.net>
Tue, 19 Mar 2019 18:29:02 +0000 (11:29 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 21 Mar 2019 21:20:50 +0000 (14:20 -0700)
I want to reuse this for encoding small constant UBO/SSBO offsets into the
uniform stream to reduce the extra uniform loads and adds for the small
constant offsets.

src/broadcom/compiler/v3d_compiler.h
src/broadcom/compiler/vir_dump.c
src/gallium/drivers/v3d/v3d_uniforms.c

index 1f908648f3e4d93bd699f031170afa160fd7c7ae..81307e0996fe32d2c709601efe7341fcbc0f2d27 100644 (file)
@@ -281,17 +281,17 @@ enum quniform_contents {
         QUNIFORM_SHARED_OFFSET,
 };
 
-static inline uint32_t v3d_tmu_config_data_create(uint32_t unit, uint32_t value)
+static inline uint32_t v3d_unit_data_create(uint32_t unit, uint32_t value)
 {
         return unit << 24 | value;
 }
 
-static inline uint32_t v3d_tmu_config_data_get_unit(uint32_t data)
+static inline uint32_t v3d_unit_data_get_unit(uint32_t data)
 {
         return data >> 24;
 }
 
-static inline uint32_t v3d_tmu_config_data_get_value(uint32_t data)
+static inline uint32_t v3d_unit_data_get_offset(uint32_t data)
 {
         return data & 0xffffff;
 }
index 8fd32931c1bfe524309554215aa1e4a67aac17e6..be98539b0be7fb098c10b584f6f1736d84158803 100644 (file)
@@ -53,20 +53,20 @@ vir_dump_uniform(enum quniform_contents contents,
 
         case QUNIFORM_TMU_CONFIG_P0:
                 fprintf(stderr, "tex[%d].p0 | 0x%x",
-                        v3d_tmu_config_data_get_unit(data),
-                        v3d_tmu_config_data_get_value(data));
+                        v3d_unit_data_get_unit(data),
+                        v3d_unit_data_get_offset(data));
                 break;
 
         case QUNIFORM_TMU_CONFIG_P1:
                 fprintf(stderr, "tex[%d].p1 | 0x%x",
-                        v3d_tmu_config_data_get_unit(data),
-                        v3d_tmu_config_data_get_value(data));
+                        v3d_unit_data_get_unit(data),
+                        v3d_unit_data_get_offset(data));
                 break;
 
         case QUNIFORM_IMAGE_TMU_CONFIG_P0:
                 fprintf(stderr, "img[%d].p0 | 0x%x",
-                        v3d_tmu_config_data_get_unit(data),
-                        v3d_tmu_config_data_get_value(data));
+                        v3d_unit_data_get_unit(data),
+                        v3d_unit_data_get_offset(data));
                 break;
 
         case QUNIFORM_TEXTURE_WIDTH:
index 307ccaafa3dc24c602bcd39b91ffe23452538cc6..371568b31e6e7875884de9ae8a7d6519c8582aa8 100644 (file)
@@ -172,13 +172,13 @@ write_tmu_p0(struct v3d_job *job,
              struct v3d_texture_stateobj *texstate,
              uint32_t data)
 {
-        int unit  = v3d_tmu_config_data_get_unit(data);
+        int unit = v3d_unit_data_get_unit(data);
         struct pipe_sampler_view *psview = texstate->textures[unit];
         struct v3d_sampler_view *sview = v3d_sampler_view(psview);
         struct v3d_resource *rsc = v3d_resource(sview->texture);
 
         cl_aligned_reloc(&job->indirect, uniforms, sview->bo,
-                         v3d_tmu_config_data_get_value(data));
+                         v3d_unit_data_get_offset(data));
         v3d_job_add_bo(job, rsc->bo);
 }
 
@@ -210,7 +210,7 @@ write_tmu_p1(struct v3d_job *job,
              struct v3d_texture_stateobj *texstate,
              uint32_t data)
 {
-        uint32_t unit = v3d_tmu_config_data_get_unit(data);
+        uint32_t unit = v3d_unit_data_get_unit(data);
         struct pipe_sampler_state *psampler = texstate->samplers[unit];
         struct v3d_sampler_state *sampler = v3d_sampler_state(psampler);
         struct pipe_sampler_view *psview = texstate->textures[unit];
@@ -223,7 +223,7 @@ write_tmu_p1(struct v3d_job *job,
         cl_aligned_reloc(&job->indirect, uniforms,
                          v3d_resource(sampler->sampler_state)->bo,
                          sampler->sampler_state_offset[variant] |
-                         v3d_tmu_config_data_get_value(data));
+                         v3d_unit_data_get_offset(data));
 }
 
 struct v3d_cl_reloc