public byte[] Compile(string profile)
        {
            if (_hlslCompiler == null)
                _hlslCompiler = LoadHlslCompiler();

            if (_hlslCompiler == null)
            {
                _shared.Diagnostics.Add(
                    Severity.Error,
                    new SourceRange(),
                    "Could not load HLSL compiler from SparkCPP.dll");
                return new byte[] { };
            }

            string hlslErrors = null;
            var result = _hlslCompiler.Compile(
                Span.ToString(),
                "main",
                profile,
                out hlslErrors);

            if (!string.IsNullOrEmpty(hlslErrors))
            {
                FormatDiagnostics(hlslErrors, _shared.Diagnostics, profile);
            }

            return result;
        }
 public static void Register(IHlslCompiler compiler)
 {
     _compiler = compiler;
 }