summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/program_parse.y4
-rw-r--r--src/mesa/shader/slang/slang_codegen.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y
index 3f1a350c24d..b40b216d658 100644
--- a/src/mesa/shader/program_parse.y
+++ b/src/mesa/shader/program_parse.y
@@ -2297,7 +2297,9 @@ set_dst_reg(struct prog_dst_register *r, gl_register_file file, GLint index)
const GLint maxIndex = 1 << INST_INDEX_BITS;
const GLint minIndex = 0;
ASSERT(index >= minIndex);
+ (void) minIndex;
ASSERT(index <= maxIndex);
+ (void) maxIndex;
ASSERT(file == PROGRAM_TEMPORARY ||
file == PROGRAM_ADDRESS ||
file == PROGRAM_OUTPUT);
@@ -2338,7 +2340,9 @@ set_src_reg_swz(struct asm_src_register *r, gl_register_file file, GLint index,
const GLint minIndex = -(1 << INST_INDEX_BITS);
ASSERT(file < PROGRAM_FILE_MAX);
ASSERT(index >= minIndex);
+ (void) minIndex;
ASSERT(index <= maxIndex);
+ (void) maxIndex;
memset(r, 0, sizeof(*r));
r->Base.File = file;
r->Base.Index = index;
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index b62cfc36af1..372a9acdd03 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -4249,14 +4249,15 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper)
if (oper->children[0].type == SLANG_OPER_IDENTIFIER) {
/* Check that var is writeable */
+ const char *varName = (char *) oper->children[0].a_id;
slang_variable *var
= _slang_variable_locate(oper->children[0].locals,
oper->children[0].a_id, GL_TRUE);
if (!var) {
- slang_info_log_error(A->log, "undefined variable '%s'",
- (char *) oper->children[0].a_id);
+ slang_info_log_error(A->log, "undefined variable '%s'", varName);
return NULL;
}
+
if (var->type.qualifier == SLANG_QUAL_CONST ||
var->type.qualifier == SLANG_QUAL_ATTRIBUTE ||
var->type.qualifier == SLANG_QUAL_UNIFORM ||
@@ -4264,7 +4265,7 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper)
A->program->Target == GL_FRAGMENT_PROGRAM_ARB)) {
slang_info_log_error(A->log,
"illegal assignment to read-only variable '%s'",
- (char *) oper->children[0].a_id);
+ varName);
return NULL;
}