Skip to content

Instantly share code, notes, and snippets.

View AquaGeneral's full-sized avatar

Jesse Stiller AquaGeneral

View GitHub Profile
@AquaGeneral
AquaGeneral / Compute Buffer Test [odin-gl].md
Last active December 3, 2021 07:58
Code of a test Odin project where I am simply trying to write to a shader resource buffer in OpenGL with SPIR-V binary shaders. It's only working with GLSL shaders, no SPIR-V shader

Odin language project using odin-gl https://github.com/vassvik/odin-gl

Loading and binding in the Odin programming language

path       := path.join(shaderDir, fileName)
shaderComp := dxc.compile_from_file(path, generate_args("../computeshader.hlsl", "cs_6_0"))
shader     := gl.CreateShader(gl.COMPUTE_SHADER)
gl.ShaderBinary(1, &shader, gl.SHADER_BINARY_FORMAT_SPIR_V, shaderComp.bitCode, i32(shaderComp.bitCodeLen / 2))
gl.SpecializeShader(shader, cast(^u8)strings.clone_to_cstring("main"), 0, nil, nil)	
@AquaGeneral
AquaGeneral / SystemInfoInspector.cs
Created May 16, 2018 11:45
See all of the values that Unity's SystemInfo class contains. Reflection is used to remove redundant work, and simultaneously makes this work in any version of Unity (I hope). A lot of work can be done to make it look nicer.
using System;
using System.Collections.Generic;
using System.Reflection;
using UnityEditor;
using UnityEngine;
public class SystemInfoInspector : EditorWindow {
private static PropertyInfo[] properties;
private static MethodInfo[] methods;
private Vector2 scrollPosition;