mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 01:30:08 +01:00
clc: Use stringstream for printing spirv errors
The type of the spv_position_t components can differ across platforms, it's simpler to just let C++ overloading handle it. Reviewed-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15437>
This commit is contained in:
parent
fb69d9925e
commit
f226222846
1 changed files with 12 additions and 14 deletions
|
|
@ -1012,22 +1012,20 @@ public:
|
|||
void operator()(spv_message_level_t level, const char *src,
|
||||
const spv_position_t &pos, const char *msg)
|
||||
{
|
||||
switch(level) {
|
||||
case SPV_MSG_FATAL:
|
||||
case SPV_MSG_INTERNAL_ERROR:
|
||||
case SPV_MSG_ERROR:
|
||||
clc_error(logger, "(file=%s,line=%ld,column=%ld,index=%ld): %s\n",
|
||||
src, pos.line, pos.column, pos.index, msg);
|
||||
break;
|
||||
if (level == SPV_MSG_INFO || level == SPV_MSG_DEBUG)
|
||||
return;
|
||||
|
||||
case SPV_MSG_WARNING:
|
||||
clc_warning(logger, "(file=%s,line=%ld,column=%ld,index=%ld): %s\n",
|
||||
src, pos.line, pos.column, pos.index, msg);
|
||||
break;
|
||||
std::ostringstream message;
|
||||
message << "(file=" << src
|
||||
<< ",line=" << pos.line
|
||||
<< ",column=" << pos.column
|
||||
<< ",index=" << pos.index
|
||||
<< "): " << msg << "\n";
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (level == SPV_MSG_WARNING)
|
||||
clc_warning(logger, "%s", message.str().c_str());
|
||||
else
|
||||
clc_error(logger, "%s", message.str().c_str());
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue