Skip to content

Instantly share code, notes, and snippets.

Avatar

Utku Melemetci Yey007

  • Youth Passion Project
View GitHub Profile
@Yey007
Yey007 / SPIRVJSONReader.ttinclude
Created Feb 15, 2021
Can't get this to work, even though it finds the correct assembly, it refuses to discover the attribute classes.
View SPIRVJSONReader.ttinclude
<#@ 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);
View ILGPUErrorFixedArrays.cs
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;
View InvalidArgument.cs
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));