Yotsuba Shader
English

Build from source

Build the solution, run the tests and validate the SPIR-V module the example produces.


Build

Terminal
dotnet build YotsubaShader.sln

Run the example

The example project assembles a fragment-shader module instruction by instruction with SpirVModule and encodes it with SpirVCompiler.

Terminal
dotnet run --project YotsubaShader.Example/YotsubaShader.Example.csproj

This creates mi modulo spirv.spv in the working directory.

Validate the module

If you have SPIRV-Tools installed, validate and disassemble the output:

Terminal
spirv-val "mi modulo spirv.spv"
spirv-dis "mi modulo spirv.spv"

Run the tests

The frontend test project covers shader discovery and analysis.

Terminal
dotnet test YotsubaShader.Frontend.Tests

Repository architecture

ProjectRole
YotsubaShader.LanguageAuthoring layer: stages, attributes, resources and the types you map to the GPU.
YotsubaShader.RoslynDiscovery and semantic analysis of C# shaders.
YotsubaShader.IRShared model between the frontend and backends.
YotsubaShader.Compiler.SpirVSPIR-V module construction and encoding.
YotsubaShader.GeneratorSPIR-V operation table generated from the Khronos grammar.
YotsubaShader.ExampleExecutable example of low-level SPIR-V assembly.
YotsubaShader.Frontend.TestsFrontend discovery and analysis tests.