Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
wgsl_diagnostics.hpp
Go to the documentation of this file.
1#pragma once
2
11
12#include <cstdint>
13#include <string>
14#include <string_view>
15#include <vector>
16
17namespace pulp::render {
18
20 enum class Severity : std::uint8_t { error, warning, info };
21
25 std::uint32_t line = 0;
27 std::uint32_t column = 0;
28 std::string message;
29};
30
32
35std::string format_wgsl_diagnostic(std::string_view source_name, const WgslDiagnostic& diagnostic);
36
38std::string format_wgsl_diagnostics(std::string_view source_name,
39 const std::vector<WgslDiagnostic>& diagnostics);
40
41bool has_wgsl_errors(const std::vector<WgslDiagnostic>& diagnostics);
42
43} // namespace pulp::render
Definition gpu_fwd.hpp:31
std::string format_wgsl_diagnostics(std::string_view source_name, const std::vector< WgslDiagnostic > &diagnostics)
One formatted diagnostic per line.
bool has_wgsl_errors(const std::vector< WgslDiagnostic > &diagnostics)
std::string_view wgsl_severity_name(WgslDiagnostic::Severity severity)
std::string format_wgsl_diagnostic(std::string_view source_name, const WgslDiagnostic &diagnostic)
name:line:column: severity: message, or name: severity: message without a position.
Definition wgsl_diagnostics.hpp:19
std::uint32_t line
1-based line, or 0 when the message has no source position (a pipeline-level validation error,...
Definition wgsl_diagnostics.hpp:25
std::uint32_t column
1-based column, or 0 with line.
Definition wgsl_diagnostics.hpp:27
Severity severity
Definition wgsl_diagnostics.hpp:22
Severity
Definition wgsl_diagnostics.hpp:20
@ warning
Definition wgsl_diagnostics.hpp:20
@ info
Definition wgsl_diagnostics.hpp:20
@ error
Definition wgsl_diagnostics.hpp:20
std::string message
Definition wgsl_diagnostics.hpp:28