r600: Replace R600_ERR with R600_ASM_ERR in shader code

Doesn't depend on r600_pipe, thus usable outside Gallium

Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25695>
This commit is contained in:
Vitaliy Triang3l Kuzmin 2023-10-07 19:33:36 +03:00 committed by Marge Bot
parent 10ef3b7fe3
commit b7e5a8b5ca
4 changed files with 29 additions and 19 deletions

View file

@ -1116,7 +1116,7 @@ static int r600_bytecode_assign_kcache_banks(
switch (kcache[j].mode) {
case V_SQ_CF_KCACHE_NOP:
case V_SQ_CF_KCACHE_LOCK_LOOP_INDEX:
R600_ERR("unexpected kcache line mode\n");
R600_ASM_ERR("unexpected kcache line mode\n");
return -ENOMEM;
default:
if (kcache[j].bank == alu->src[i].kc_bank &&
@ -1431,7 +1431,7 @@ static unsigned r600_bytecode_num_tex_and_vtx_instructions(const struct r600_byt
return 16;
default:
R600_ERR("Unknown gfx level %d.\n", bc->gfx_level);
R600_ASM_ERR("Unknown gfx level %d.\n", bc->gfx_level);
return 8;
}
}
@ -1484,7 +1484,7 @@ static int r600_bytecode_add_vtx_internal(struct r600_bytecode *bc, const struct
bc->cf_last->op = CF_OP_TEX;
break;
default:
R600_ERR("Unknown gfx level %d.\n", bc->gfx_level);
R600_ASM_ERR("Unknown gfx level %d.\n", bc->gfx_level);
free(nvtx);
return -EINVAL;
}
@ -1900,7 +1900,7 @@ int r600_bytecode_build(struct r600_bytecode *bc)
r = eg_bytecode_alu_build(bc, alu, addr);
break;
default:
R600_ERR("unknown gfx level %d.\n", bc->gfx_level);
R600_ASM_ERR("unknown gfx level %d.\n", bc->gfx_level);
return -EINVAL;
}
if (r)
@ -2802,7 +2802,7 @@ void r600_vertex_data_type(enum pipe_format pformat,
}
return;
out_unknown:
R600_ERR("unsupported vertex format %s\n", util_format_name(pformat));
R600_ASM_ERR("unsupported vertex format %s\n", util_format_name(pformat));
}
void r600_bytecode_alu_read(struct r600_bytecode *bc,

View file

@ -26,10 +26,15 @@
#include "r600_pipe.h"
#include "r600_isa.h"
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
#define R600_ASM_ERR(fmt, args...) \
fprintf(stderr, "EE %s:%d %s - " fmt, __FILE__, __LINE__, __func__, ##args)
struct r600_bytecode_alu_src {
unsigned sel;
unsigned chan;

View file

@ -27,6 +27,8 @@
#include "sfn_assembler.h"
#include "../eg_sq.h"
#include "../r600_asm.h"
#include "sfn_callstack.h"
#include "sfn_conditionaljumptracker.h"
#include "sfn_debug.h"
@ -551,7 +553,7 @@ AssamblerVisitor::visit(const TexInstr& tex_instr)
else
tex.inst_mod = tex_instr.inst_mode();
if (r600_bytecode_add_tex(m_bc, &tex)) {
R600_ERR("shader_from_nir: Error creating tex assembly instruction\n");
R600_ASM_ERR("shader_from_nir: Error creating tex assembly instruction\n");
m_result = false;
}
}
@ -588,7 +590,8 @@ AssamblerVisitor::visit(const ExportInstr& exi)
output.array_base = exi.location();
break;
default:
R600_ERR("shader_from_nir: export %d type not yet supported\n", exi.export_type());
R600_ASM_ERR("shader_from_nir: export %d type not yet supported\n",
exi.export_type());
m_result = false;
}
@ -601,7 +604,7 @@ AssamblerVisitor::visit(const ExportInstr& exi)
int r = 0;
if ((r = r600_bytecode_add_output(m_bc, &output))) {
R600_ERR("Error adding export at location %d : err: %d\n", exi.location(), r);
R600_ASM_ERR("Error adding export at location %d : err: %d\n", exi.location(), r);
m_result = false;
}
}
@ -641,7 +644,7 @@ AssamblerVisitor::visit(const ScratchIOInstr& instr)
}
if (r600_bytecode_add_output(m_bc, &cf)) {
R600_ERR("shader_from_nir: Error creating SCRATCH_WR assembly instruction\n");
R600_ASM_ERR("shader_from_nir: Error creating SCRATCH_WR assembly instruction\n");
m_result = false;
}
}
@ -662,7 +665,7 @@ AssamblerVisitor::visit(const StreamOutInstr& instr)
output.op = instr.op(m_shader->bc.gfx_level);
if (r600_bytecode_add_output(m_bc, &output)) {
R600_ERR("shader_from_nir: Error creating stream output instruction\n");
R600_ASM_ERR("shader_from_nir: Error creating stream output instruction\n");
m_result = false;
}
}
@ -687,7 +690,7 @@ AssamblerVisitor::visit(const MemRingOutInstr& instr)
output.array_base = instr.array_base();
if (r600_bytecode_add_output(m_bc, &output)) {
R600_ERR("shader_from_nir: Error creating mem ring write instruction\n");
R600_ASM_ERR("shader_from_nir: Error creating mem ring write instruction\n");
m_result = false;
}
}
@ -763,13 +766,13 @@ AssamblerVisitor::visit(const FetchInstr& fetch_instr)
if (fetch_instr.has_fetch_flag(FetchInstr::use_tc)) {
if ((r600_bytecode_add_vtx_tc(m_bc, &vtx))) {
R600_ERR("shader_from_nir: Error creating tex assembly instruction\n");
R600_ASM_ERR("shader_from_nir: Error creating tex assembly instruction\n");
m_result = false;
}
} else {
if ((r600_bytecode_add_vtx(m_bc, &vtx))) {
R600_ERR("shader_from_nir: Error creating tex assembly instruction\n");
R600_ASM_ERR("shader_from_nir: Error creating tex assembly instruction\n");
m_result = false;
}
}
@ -1203,9 +1206,9 @@ bool
AssamblerVisitor::copy_dst(r600_bytecode_alu_dst& dst, const Register& d, bool write)
{
if (write && d.sel() > g_clause_local_end) {
R600_ERR("shader_from_nir: Don't support more then 123 GPRs + 4 clause "
"local, but try using %d\n",
d.sel());
R600_ASM_ERR("shader_from_nir: Don't support more then 123 GPRs + 4 clause "
"local, but try using %d\n",
d.sel());
m_result = false;
return false;
}

View file

@ -26,6 +26,8 @@
#include "sfn_shader_vs.h"
#include "../r600_asm.h"
#include "sfn_debug.h"
#include "sfn_instr_alugroup.h"
#include "sfn_instr_export.h"
@ -310,13 +312,13 @@ VertexExportForFs::emit_stream(int stream)
{
assert(m_so_info);
if (m_so_info->num_outputs > PIPE_MAX_SO_OUTPUTS) {
R600_ERR("Too many stream outputs: %d\n", m_so_info->num_outputs);
R600_ASM_ERR("Too many stream outputs: %d\n", m_so_info->num_outputs);
return false;
}
for (unsigned i = 0; i < m_so_info->num_outputs; i++) {
if (m_so_info->output[i].output_buffer >= 4) {
R600_ERR("Exceeded the max number of stream output buffers, got: %d\n",
m_so_info->output[i].output_buffer);
R600_ASM_ERR("Exceeded the max number of stream output buffers, got: %d\n",
m_so_info->output[i].output_buffer);
return false;
}
}