Skip to content

Instantly share code, notes, and snippets.

View Yey007's full-sized avatar

Utku Melemetci Yey007

  • Youth Passion Project
View GitHub Profile
@Yey007
Yey007 / SPIRVJSONReader.ttinclude
Created February 15, 2021 15:44
Can't get this to work, even though it finds the correct assembly, it refuses to discover the attribute classes.
<#@ assembly name="System.Runtime.Serialization"#>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Runtime.Serialization"#>
<#@ import namespace="System.Runtime.Serialization.Json"#>
<#
var json = new DataContractJsonSerializer(typeof(SPIRVGrammar));
var file = File.Open("spirv.core.grammar.json", FileMode.Open);
var grammar = (SPIRVGrammar) json.ReadObject(file);
unsafe struct FSMUnit
{
public int tx;
public int ty;
public fixed int test[256];
public fixed int test2[256];
}
unsafe static void MathKernel(Index2 index, ArrayView2D<FSMUnit> grid)
{
int tx = index.X;
public BufferedFastMatrix<T> AddShared(BufferedFastMatrix<T> one, BufferedFastMatrix<T> two)
{
if (one == null || two == null)
{
throw new ArgumentNullException();
}
if ((one.GetSize(0) != two.GetSize(0)) || (one.GetSize(1) != two.GetSize(1)))
{
throw new BadDimensionException(one.GetSize(0), one.GetSize(1), two.GetSize(0),
two.GetSize(1));