r300: make global variables const (if possible)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12860>
This commit is contained in:
Filip Gawin 2021-09-14 23:14:51 +02:00 committed by Marge Bot
parent 765b3b3b11
commit 4655196796
10 changed files with 14 additions and 14 deletions

View File

@ -195,7 +195,7 @@ static void r300_swizzle_split(
}
}
struct rc_swizzle_caps r300_swizzle_caps = {
const struct rc_swizzle_caps r300_swizzle_caps = {
.IsNative = r300_swizzle_is_native,
.Split = r300_swizzle_split
};

View File

@ -30,7 +30,7 @@
#include "radeon_swizzle.h"
extern struct rc_swizzle_caps r300_swizzle_caps;
extern const struct rc_swizzle_caps r300_swizzle_caps;
unsigned int r300FPTranslateRGBSwizzle(unsigned int src, unsigned int swizzle);
unsigned int r300FPTranslateAlphaSwizzle(unsigned int src, unsigned int swizzle);

View File

@ -864,7 +864,7 @@ static void rc_emulate_negative_addressing(struct radeon_compiler *compiler, voi
transform_negative_addressing(c, lastARL, inst, min_offset);
}
struct rc_swizzle_caps r300_vertprog_swizzle_caps = {
const struct rc_swizzle_caps r300_vertprog_swizzle_caps = {
.IsNative = &swizzle_is_native,
.Split = 0 /* should never be called */
};

View File

@ -26,7 +26,7 @@
#include <stdio.h>
static char* r300_vs_ve_ops[] = {
static const char* r300_vs_ve_ops[] = {
/* R300 vector ops */
" VE_NO_OP",
" VE_DOT_PRODUCT",
@ -63,7 +63,7 @@ static char* r300_vs_ve_ops[] = {
" (reserved)",
};
static char* r300_vs_me_ops[] = {
static const char* r300_vs_me_ops[] = {
/* R300 math ops */
" ME_NO_OP",
" ME_EXP_BASE2_DX",
@ -101,14 +101,14 @@ static char* r300_vs_me_ops[] = {
};
/* XXX refactor to avoid clashing symbols */
static char* r300_vs_src_debug[] = {
static const char* r300_vs_src_debug[] = {
"t",
"i",
"c",
"a",
};
static char* r300_vs_dst_debug[] = {
static const char* r300_vs_dst_debug[] = {
"t",
"a0",
"o",
@ -119,7 +119,7 @@ static char* r300_vs_dst_debug[] = {
"u",
};
static char* r300_vs_swiz_debug[] = {
static const char* r300_vs_swiz_debug[] = {
"X",
"Y",
"Z",

View File

@ -266,7 +266,7 @@ static void r500_swizzle_split(struct rc_src_register src, unsigned int usemask,
}
}
struct rc_swizzle_caps r500_swizzle_caps = {
const struct rc_swizzle_caps r500_swizzle_caps = {
.IsNative = r500_swizzle_is_native,
.Split = r500_swizzle_split
};

View File

@ -40,7 +40,7 @@ extern void r500BuildFragmentProgramHwCode(struct radeon_compiler *c, void *user
extern void r500FragmentProgramDump(struct radeon_compiler *c, void *user);
extern struct rc_swizzle_caps r500_swizzle_caps;
extern const struct rc_swizzle_caps r500_swizzle_caps;
extern int r500_transform_IF(
struct radeon_compiler * c,

View File

@ -68,7 +68,7 @@ struct radeon_compiler {
* of the compiler
*/
/*@{*/
struct rc_swizzle_caps * SwizzleCaps;
const struct rc_swizzle_caps * SwizzleCaps;
/*@}*/
struct emulate_loop_state loop_state;

View File

@ -32,7 +32,7 @@
#include "util/compiler.h"
struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = {
const struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = {
{
.Opcode = RC_OPCODE_NOP,
.Name = "NOP"

View File

@ -268,7 +268,7 @@ struct rc_opcode_info {
unsigned int IsStandardScalar:1;
};
extern struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE];
extern const struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE];
static inline const struct rc_opcode_info * rc_get_opcode_info(rc_opcode opcode)
{

View File

@ -54,6 +54,6 @@ struct rc_swizzle_caps {
void (*Split)(struct rc_src_register reg, unsigned int mask, struct rc_swizzle_split * split);
};
extern struct rc_swizzle_caps r300_vertprog_swizzle_caps;
extern const struct rc_swizzle_caps r300_vertprog_swizzle_caps;
#endif /* RADEON_SWIZZLE_H */