Mesa (master): r600g: constify r600_shader_tgsi_instruction lists.

Emil Velikov evelikov at kemper.freedesktop.org
Tue Mar 17 23:55:17 UTC 2015


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

Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Mon Mar 16 14:47:09 2015 +0000

r600g: constify r600_shader_tgsi_instruction lists.

Massive list of constant data. Annotate it as such.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/gallium/drivers/r600/r600_shader.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index acac89f..28b290a 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -283,7 +283,7 @@ struct r600_shader_ctx {
 	unsigned				type;
 	unsigned				file_offset[TGSI_FILE_COUNT];
 	unsigned				temp_reg;
-	struct r600_shader_tgsi_instruction	*inst_info;
+	const struct r600_shader_tgsi_instruction	*inst_info;
 	struct r600_bytecode			*bc;
 	struct r600_shader			*shader;
 	struct r600_shader_src			src[4];
@@ -316,7 +316,7 @@ struct r600_shader_tgsi_instruction {
 };
 
 static int emit_gs_ring_writes(struct r600_shader_ctx *ctx, bool ind);
-static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[], eg_shader_tgsi_instruction[], cm_shader_tgsi_instruction[];
+static const struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[], eg_shader_tgsi_instruction[], cm_shader_tgsi_instruction[];
 static int tgsi_helper_tempx_replicate(struct r600_shader_ctx *ctx);
 static inline void callstack_push(struct r600_shader_ctx *ctx, unsigned reason);
 static void fc_pushlevel(struct r600_shader_ctx *ctx, int type);
@@ -7270,7 +7270,7 @@ static int tgsi_umad(struct r600_shader_ctx *ctx)
 	return 0;
 }
 
-static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[] = {
+static const struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[] = {
 	[TGSI_OPCODE_ARL]	= { ALU_OP0_NOP, tgsi_r600_arl},
 	[TGSI_OPCODE_MOV]	= { ALU_OP1_MOV, tgsi_op2},
 	[TGSI_OPCODE_LIT]	= { ALU_OP0_NOP, tgsi_lit},
@@ -7475,7 +7475,7 @@ static struct r600_shader_tgsi_instruction r600_shader_tgsi_instruction[] = {
 	[TGSI_OPCODE_LAST]	= { ALU_OP0_NOP, tgsi_unsupported},
 };
 
-static struct r600_shader_tgsi_instruction eg_shader_tgsi_instruction[] = {
+static const struct r600_shader_tgsi_instruction eg_shader_tgsi_instruction[] = {
 	[TGSI_OPCODE_ARL]	= { ALU_OP0_NOP, tgsi_eg_arl},
 	[TGSI_OPCODE_MOV]	= { ALU_OP1_MOV, tgsi_op2},
 	[TGSI_OPCODE_LIT]	= { ALU_OP0_NOP, tgsi_lit},
@@ -7674,7 +7674,7 @@ static struct r600_shader_tgsi_instruction eg_shader_tgsi_instruction[] = {
 	[TGSI_OPCODE_LAST]	= { ALU_OP0_NOP, tgsi_unsupported},
 };
 
-static struct r600_shader_tgsi_instruction cm_shader_tgsi_instruction[] = {
+static const struct r600_shader_tgsi_instruction cm_shader_tgsi_instruction[] = {
 	[TGSI_OPCODE_ARL]	= { ALU_OP0_NOP, tgsi_eg_arl},
 	[TGSI_OPCODE_MOV]	= { ALU_OP1_MOV, tgsi_op2},
 	[TGSI_OPCODE_LIT]	= { ALU_OP0_NOP, tgsi_lit},




More information about the mesa-commit mailing list