Module: Mesa
Branch: master
Commit: 77ca550224515516c780c0f0534d667beab0e891
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=77ca550224515516c780c0f0534d667beab0e891

Author: Konstantin Kharlamov <[email protected]>
Date:   Fri Dec 29 08:32:28 2017 +0300

r600g: constify some variables

Just a nice hint for both peoples and compilers.

Signed-off-by: Konstantin Kharlamov <[email protected]>
Signed-off-by: Marek Olšák <[email protected]>

---

 src/gallium/drivers/r600/cayman_msaa.c     |  2 +-
 src/gallium/drivers/r600/evergreen_state.c |  2 +-
 src/gallium/drivers/r600/r600_query.c      |  2 +-
 src/gallium/drivers/r600/r600_state.c      | 12 ++++++------
 src/gallium/drivers/r600/sb/sb_expr.cpp    |  2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/r600/cayman_msaa.c 
b/src/gallium/drivers/r600/cayman_msaa.c
index e349cdb9e1..9f401642b4 100644
--- a/src/gallium/drivers/r600/cayman_msaa.c
+++ b/src/gallium/drivers/r600/cayman_msaa.c
@@ -225,7 +225,7 @@ void cayman_emit_msaa_state(struct radeon_cmdbuf *cs, int 
nr_samples,
 
        if (setup_samples > 1) {
                /* indexed by log2(nr_samples) */
-               unsigned max_dist[] = {
+               const unsigned max_dist[] = {
                        0,
                        eg_max_dist_2x,
                        eg_max_dist_4x,
diff --git a/src/gallium/drivers/r600/evergreen_state.c 
b/src/gallium/drivers/r600/evergreen_state.c
index ed156ae771..7718a65865 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -1599,7 +1599,7 @@ static void evergreen_set_min_samples(struct pipe_context 
*ctx, unsigned min_sam
 }
 
 /* 8xMSAA */
-static uint32_t sample_locs_8x[] = {
+static const uint32_t sample_locs_8x[] = {
        FILL_SREG(-1,  1,  1,  5,  3, -5,  5,  3),
        FILL_SREG(-7, -1, -3, -7,  7, -3, -5,  7),
        FILL_SREG(-1,  1,  1,  5,  3, -5,  5,  3),
diff --git a/src/gallium/drivers/r600/r600_query.c 
b/src/gallium/drivers/r600/r600_query.c
index 7058216c0c..ccabab9cdb 100644
--- a/src/gallium/drivers/r600/r600_query.c
+++ b/src/gallium/drivers/r600/r600_query.c
@@ -1945,7 +1945,7 @@ void r600_query_fix_enabled_rb_mask(struct 
r600_common_screen *rscreen)
 #define XG(group_, name_, query_type_, type_, result_type_) \
        XFULL(name_, query_type_, type_, result_type_, 
R600_QUERY_GROUP_##group_)
 
-static struct pipe_driver_query_info r600_driver_query_list[] = {
+static const struct pipe_driver_query_info r600_driver_query_list[] = {
        X("num-compilations",           NUM_COMPILATIONS,       UINT64, 
CUMULATIVE),
        X("num-shaders-created",        NUM_SHADERS_CREATED,    UINT64, 
CUMULATIVE),
        X("num-shader-cache-hits",      NUM_SHADER_CACHE_HITS,  UINT64, 
CUMULATIVE),
diff --git a/src/gallium/drivers/r600/r600_state.c 
b/src/gallium/drivers/r600/r600_state.c
index 1160672c7f..6af1fc4b8e 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -1222,22 +1222,22 @@ static void r600_set_framebuffer_state(struct 
pipe_context *ctx,
        rctx->framebuffer.do_update_surf_dirtiness = true;
 }
 
-static uint32_t sample_locs_2x[] = {
+static const uint32_t sample_locs_2x[] = {
        FILL_SREG(-4, 4, 4, -4, -4, 4, 4, -4),
        FILL_SREG(-4, 4, 4, -4, -4, 4, 4, -4),
 };
-static unsigned max_dist_2x = 4;
+static const unsigned max_dist_2x = 4;
 
-static uint32_t sample_locs_4x[] = {
+static const uint32_t sample_locs_4x[] = {
        FILL_SREG(-2, -2, 2, 2, -6, 6, 6, -6),
        FILL_SREG(-2, -2, 2, 2, -6, 6, 6, -6),
 };
-static unsigned max_dist_4x = 6;
-static uint32_t sample_locs_8x[] = {
+static const unsigned max_dist_4x = 6;
+static const uint32_t sample_locs_8x[] = {
        FILL_SREG(-1,  1,  1,  5,  3, -5,  5,  3),
        FILL_SREG(-7, -1, -3, -7,  7, -3, -5,  7),
 };
-static unsigned max_dist_8x = 7;
+static const unsigned max_dist_8x = 7;
 
 static void r600_get_sample_position(struct pipe_context *ctx,
                                     unsigned sample_count,
diff --git a/src/gallium/drivers/r600/sb/sb_expr.cpp 
b/src/gallium/drivers/r600/sb/sb_expr.cpp
index ad798453bc..05674ff24b 100644
--- a/src/gallium/drivers/r600/sb/sb_expr.cpp
+++ b/src/gallium/drivers/r600/sb/sb_expr.cpp
@@ -332,7 +332,7 @@ void expr_handler::apply_alu_src_mod(const bc_alu &bc, 
unsigned src,
 }
 
 void expr_handler::apply_alu_dst_mod(const bc_alu &bc, literal &v) {
-       float omod_coeff[] = {2.0f, 4.0, 0.5f};
+       const float omod_coeff[] = {2.0f, 4.0, 0.5f};
 
        if (bc.omod)
                v = v.f * omod_coeff[bc.omod - 1];

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to