NetShaderc 1.0.0

dotnet add package NetShaderc --version 1.0.0
                    
NuGet\Install-Package NetShaderc -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetShaderc" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetShaderc" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NetShaderc" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NetShaderc --version 1.0.0
                    
#r "nuget: NetShaderc, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=NetShaderc&version=1.0.0
                    
Install NetShaderc as a Cake Addin
#tool nuget:?package=NetShaderc&version=1.0.0
                    
Install NetShaderc as a Cake Tool

Simple .NET Shaderc Bindings

Usage:

Simple SPIR-V compilation:

Given the files vertex.vert and fragment.frag you can compile them by simply using:

var compiler = new Compiler();

var vert = File.ReadAllText("vertex.vert");
var frag = File.ReadAllText("fragment.frag");

var vertres = compiler.Compile(vert, CompileType.CodeToSPIRV, ShaderKind.VertexShader);
var fragres = compiler.Compile(frag, CompileType.CodeToSPIRV, ShaderKind.FragmentShader);

To display Errors you can just:

if (vertres.Status != CompilationStatus.Success)
	Console.WriteLine(vertres.ErrorMessage);

if (fragres.Status != CompilationStatus.Success)
	Console.WriteLine(fragres.ErrorMessage);

To write the result to a file just:

if (vertres.Code is not null) File.WriteAllBytes("vertex.spv", vertres.Code);
if (fragres.Code is not null) File.WriteAllBytes("fragment.spv", fragres.Code);
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NetShaderc:

Package Downloads
Alkata

Tools to handle Alkata files

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 280 1/27/2025