tgjones / DotNetDxc

NuGet package for .NET wrapper of Microsoft's DirectXShaderCompiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DotNetDxc Build status NuGet

This is a .NET wrapper for Microsoft's open-source DirectXShaderCompiler. All code comes from the upstream DirectXShaderCompiler project, and this project only exists separately so that it can be easily published as a NuGet package.

Usage

var path = "shader.hlsl";

var dxcIntelliSense = HlslDxcLib.CreateDxcIntelliSense();

var index = dxcIntelliSense.CreateIndex();

var commandLineArgs = new string[0];

var unsavedFiles = new IDxcUnsavedFile[]
{
    new TrivialDxcUnsavedFile(path, File.ReadAllText(path))
};

var translationUnit = index.ParseTranslationUnit(
    path,
    commandLineArgs,
    commandLineArgs.Length,
    unsavedFiles,
    (uint) unsavedFiles.Length,
    (uint) DxcTranslationUnitFlags.DxcTranslationUnitFlags_UseCallerThread);

var numDiagnostics = translationUnit.GetNumDiagnostics();

Binaries

DotNetDxc is available as a NuGet package compatible with .NET Standard 2.0: NuGet

The NuGet package includes native DirectXShaderCompiler DLLs for all supported platforms - currently, Windows x86 and Windows x64.

License

This software is released under the University of Illinois Open Source License, the same licence as the upstream DirectXShaderCompiler project.

About

NuGet package for .NET wrapper of Microsoft's DirectXShaderCompiler


Languages

Language:C# 99.6%Language:HLSL 0.4%