r300: do not include newline in the error messages

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33529>
This commit is contained in:
Pavel Ondračka
2025-02-13 16:58:59 +01:00
committed by Marge Bot
parent 62507a2aa7
commit 6b7b8738b3
10 changed files with 24 additions and 27 deletions
@@ -38,7 +38,7 @@ struct r300_emit_state {
#define error(fmt, args...) \
do { \
rc_error(&c->Base, "%s::%s(): " fmt "\n", __FILE__, __func__, ##args); \
rc_error(&c->Base, "%s::%s(): " fmt, __FILE__, __func__, ##args); \
} while (0)
static unsigned int
@@ -141,7 +141,7 @@ emit_alu(struct r300_emit_state *emit, struct rc_pair_instruction *inst)
/* rc_recompute_ips does not give an exact count, because it counts extra stuff
* like BEGINTEX, but here it is intended to be only approximative anyway,
* just to give some idea how close to the limit we are. */
rc_error(&c->Base, "Too many ALU instructions used: %u, max: %u.\n",
rc_error(&c->Base, "Too many ALU instructions used: %u, max: %u",
rc_recompute_ips(&c->Base), c->Base.max_alu_insts);
return 0;
}
@@ -456,7 +456,7 @@ r300BuildFragmentProgramHwCode(struct radeon_compiler *c, void *user)
}
if (code->pixsize >= compiler->Base.max_temp_regs)
rc_error(&compiler->Base, "Too many hardware temporaries used.\n");
rc_error(&compiler->Base, "Too many hardware temporaries used");
if (compiler->Base.Error)
return;
@@ -159,7 +159,7 @@ translate_alu_result_op(struct r300_fragment_program_compiler *c, rc_compare_fun
case RC_COMPARE_FUNC_GEQUAL: return R500_INST_ALU_RESULT_OP_GE;
case RC_COMPARE_FUNC_NOTEQUAL: return R500_INST_ALU_RESULT_OP_NE;
default:
rc_error(&c->Base, "%s: unsupported compare func %i\n", __func__, func);
rc_error(&c->Base, "%s: unsupported compare func %i", __func__, func);
return 0;
}
}
@@ -569,7 +569,7 @@ emit_flowcontrol(struct emit_state *s, struct rc_instruction *inst)
s->CurrentBranchDepth--;
break;
default:
rc_error(s->C, "%s: unknown opcode %s\n", __func__,
rc_error(s->C, "%s: unknown opcode %s", __func__,
rc_get_opcode_info(inst->U.I.Opcode)->Name);
}
}
@@ -607,7 +607,7 @@ r500BuildFragmentProgramHwCode(struct radeon_compiler *c, void *user)
}
if (code->max_temp_idx >= compiler->Base.max_temp_regs)
rc_error(&compiler->Base, "Too many hardware temporaries used\n");
rc_error(&compiler->Base, "Too many hardware temporaries used");
if (compiler->Base.Error)
return;
@@ -91,7 +91,7 @@ rc_error(struct radeon_compiler *c, const char *fmt, ...)
int
rc_if_fail_helper(struct radeon_compiler *c, const char *file, int line, const char *assertion)
{
rc_error(c, "ICE at %s:%i: assertion failed: %s\n", file, line, assertion);
rc_error(c, "ICE at %s:%i: assertion failed: %s", file, line, assertion);
return 1;
}
@@ -530,7 +530,7 @@ rc_validate_final_shader(struct radeon_compiler *c, void *user)
{
/* Check the number of constants. */
if (c->Program.Constants.Count > c->max_constants) {
rc_error(c, "Too many constants. Max: %i, Got: %i\n", c->max_constants,
rc_error(c, "Too many constants. Max: %i, Got: %i", c->max_constants,
c->Program.Constants.Count);
}
}
@@ -682,7 +682,7 @@ rc_get_constant_value(struct radeon_compiler *c, unsigned int index, unsigned in
float base = 1.0f;
int swz = GET_SWZ(swizzle, chan);
if (swz >= 4 || index >= c->Program.Constants.Count) {
rc_error(c, "get_constant_value: Can't find a value.\n");
rc_error(c, "get_constant_value: Can't find a value");
return 0.0f;
}
if (GET_BIT(negate, chan)) {
@@ -649,7 +649,7 @@ get_readers_for_single_write(void *userdata, struct rc_instruction *writer,
endloop = tmp;
tmp = rc_match_endloop(tmp);
if (!tmp) {
rc_error(d->C, "Failed to match endloop.\n");
rc_error(d->C, "Failed to match endloop");
d->ReaderData->Abort = 1;
return;
}
@@ -89,7 +89,7 @@ get_used_ptr(struct deadcode_state *s, rc_register_file file, unsigned int index
{
if (file == RC_FILE_OUTPUT || file == RC_FILE_TEMPORARY) {
if (index >= RC_REGISTER_MAX_INDEX) {
rc_error(s->C, "%s: index %i is out of bounds for file %i\n", __func__, index, file);
rc_error(s->C, "%s: index %i is out of bounds for file %i", __func__, index, file);
return NULL;
}
@@ -101,7 +101,7 @@ get_used_ptr(struct deadcode_state *s, rc_register_file file, unsigned int index
return &s->R.Address;
} else if (file == RC_FILE_SPECIAL) {
if (index >= RC_NUM_SPECIAL_REGISTERS) {
rc_error(s->C, "%s: special file index %i out of bounds\n", __func__, index);
rc_error(s->C, "%s: special file index %i out of bounds", __func__, index);
return NULL;
}
@@ -261,14 +261,14 @@ rc_dataflow_deadcode(struct radeon_compiler *c, void *user)
s.BranchStackSize--;
} else if (opcode->Opcode == RC_OPCODE_ELSE) {
if (branch->HaveElse) {
rc_error(c, "%s: Multiple ELSE for one IF/ENDIF\n", __func__);
rc_error(c, "%s: Multiple ELSE for one IF/ENDIF", __func__);
} else {
memcpy(&branch->StoreElse, &s.R, sizeof(s.R));
memcpy(&s.R, &branch->StoreEndif, sizeof(s.R));
branch->HaveElse = 1;
}
} else {
rc_error(c, "%s: Unhandled control flow instruction %s\n", __func__, opcode->Name);
rc_error(c, "%s: Unhandled control flow instruction %s", __func__, opcode->Name);
}
}
}
@@ -150,7 +150,7 @@ get_reg_valuep(struct schedule_state *s, rc_register_file file, unsigned int ind
return NULL;
if (index >= RC_REGISTER_MAX_INDEX) {
rc_error(s->C, "%s: index %i out of bounds\n", __func__, index);
rc_error(s->C, "%s: index %i out of bounds", __func__, index);
return NULL;
}
@@ -764,7 +764,7 @@ rgb_to_alpha_remap(struct schedule_state *s, struct rc_instruction *inst,
/* This conversion is not possible, we must have made a mistake in
* is_rgb_to_alpha_possible. */
if (new_src_index < 0) {
rc_error(s->C, "rgb_to_alpha_remap failed to allocate src.\n");
rc_error(s->C, "rgb_to_alpha_remap failed to allocate src");
return;
}
@@ -1181,7 +1181,7 @@ scan_read(void *data, struct rc_instruction *inst, rc_register_file file, unsign
(*v)->NumReaders++;
if (s->Current->NumReadValues >= 12) {
rc_error(s->C, "%s: NumReadValues overflow\n", __func__);
rc_error(s->C, "%s: NumReadValues overflow", __func__);
} else {
s->Current->ReadValues[s->Current->NumReadValues++] = *v;
}
@@ -1216,7 +1216,7 @@ scan_write(void *data, struct rc_instruction *inst, rc_register_file file, unsig
*pv = newv;
if (s->Current->NumWriteValues >= 4) {
rc_error(s->C, "%s: NumWriteValues overflow\n", __func__);
rc_error(s->C, "%s: NumWriteValues overflow", __func__);
} else {
s->Current->WriteValues[s->Current->NumWriteValues++] = newv;
}
@@ -224,8 +224,7 @@ set_pair_instruction(struct r300_fragment_program_compiler *c, struct rc_pair_in
source = rc_pair_alloc_source(pair, srcrgb, srcalpha, inst->SrcReg[i].File,
inst->SrcReg[i].Index);
if (source < 0) {
rc_error(&c->Base, "Failed to translate "
"rgb instruction.\n");
rc_error(&c->Base, "Failed to translate rgb instruction");
return;
}
pair->RGB.Arg[i].Source = source;
@@ -251,8 +250,7 @@ set_pair_instruction(struct r300_fragment_program_compiler *c, struct rc_pair_in
source = rc_pair_alloc_source(pair, srcrgb, srcalpha, inst->SrcReg[i].File,
inst->SrcReg[i].Index);
if (source < 0) {
rc_error(&c->Base, "Failed to translate "
"alpha instruction.\n");
rc_error(&c->Base, "Failed to translate alpha instruction");
return;
}
pair->Alpha.Arg[i].Source = source;
@@ -316,7 +314,7 @@ check_opcode_support(struct r300_fragment_program_compiler *c, struct rc_sub_ins
if (opcode->HasDstReg) {
if (inst->SaturateMode == RC_SATURATE_MINUS_PLUS_ONE) {
rc_error(&c->Base, "Fragment program does not support signed Saturate.\n");
rc_error(&c->Base, "Fragment program does not support signed Saturate");
return;
}
}
@@ -324,7 +322,7 @@ check_opcode_support(struct r300_fragment_program_compiler *c, struct rc_sub_ins
for (unsigned i = 0; i < opcode->NumSrcRegs; i++) {
if (inst->SrcReg[i].RelAddr) {
rc_error(&c->Base, "Fragment program does not support relative addressing "
" of source operands.\n");
" of source operands.");
return;
}
}
@@ -64,7 +64,7 @@ rc_find_free_temporary(struct radeon_compiler *c)
c->max_temp_index++;
if (c->max_temp_index > RC_REGISTER_MAX_INDEX) {
rc_error(c, "Ran out of temporary registers\n");
rc_error(c, "Ran out of temporary registers");
return 0;
}
return c->max_temp_index;
@@ -76,8 +76,7 @@ reserve_predicate_reg(struct vert_fc_state *fc_state)
}
}
if (i == fc_state->C->max_temp_regs) {
rc_error(fc_state->C, "No free temporary to use for"
" predicate stack counter.\n");
rc_error(fc_state->C, "No free temporary to use for predicate stack counter");
return -1;
}
return 1;