Skip to content

Instantly share code, notes, and snippets.

View kusma's full-sized avatar

Erik Faye-Lund kusma

View GitHub Profile
### Keybase proof
I hereby claim:
* I am kusma on github.
* I am kusma (https://keybase.io/kusma) on keybase.
* I have a public key whose fingerprint is FF4C F638 C624 C3CF 21ED 2CF2 27EF 763A 2AA3 9F96
To claim this, I am signing this object:
@kusma
kusma / log.txt
Created June 21, 2018 16:32
vrend crash
vrend_compile_shader: context error reported 22 "Xwayland" Illegal shader 0
shader failed to compile
0:16(37): error: if the first operand of >> is scalar, the second must be scalar as well
0:16(37): error: type mismatch
0:16(21): error: no matching function for call to `intBitsToFloat(error)'; candidates are:
0:16(21): error: float intBitsToFloat(int)
0:16(21): error: vec2 intBitsToFloat(ivec2)
0:16(21): error: vec3 intBitsToFloat(ivec3)
0:16(21): error: vec4 intBitsToFloat(ivec4)
0:16(21): error: type mismatch
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 4.17.0-1 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_ARM_DMA_USE_IOMMU=y
CONFIG_ARM_DMA_IOMMU_ALIGNMENT=8
CONFIG_MIGHT_HAVE_PCI=y
@kusma
kusma / mesa3d.svg
Created June 7, 2018 08:33
attempt at a mesa logo for the new website
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kusma
kusma / gears-2d.py
Last active June 6, 2018 15:13
A 2D SVG-rendering of the famous glxgears program
import svgwrite
import math
def gear_outline(outer_radius, teeth, tooth_depth):
r1 = outer_radius - tooth_depth / 2.0
r2 = outer_radius + tooth_depth / 2.0
da = 2.0 * math.pi / teeth / 4.0
polygon = []
for i in range(teeth):
@kusma
kusma / ConsoleApp2.csproj
Last active May 25, 2018 10:30
alpha channel test
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6561C4EB-18A8-482D-8C28-C5C7C6E9BF07}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>ConsoleApp2</RootNamespace>
<AssemblyName>ConsoleApp2</AssemblyName>
FRAG
PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1
DCL IN[0].xy, GENERIC[9], PERSPECTIVE
DCL OUT[0], COLOR
DCL SAMP[0]
DCL SVIEW[0], 2D, FLOAT
DCL TEMP[0], LOCAL
0: MOV TEMP[0].xy, IN[0].xyyy
1: TEX TEMP[0], TEMP[0], SAMP[0], 2D
2: MOV OUT[0], TEMP[0]
@kusma
kusma / clz.c
Last active April 2, 2017 22:15
clz emulation
static inline int clz(uint32_t input)
{
const uint8_t clz_lut[16] = { 4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
unsigned c = 0;
if (input & 0xFFFF0000)
input >>= 16;
else
c = 16;
@kusma
kusma / BasicStyle.ux
Last active August 19, 2020 11:36
Fuse.BasicTheme
<Fuse.Style ux:Class="Fuse.BasicTheme.BasicStyle" xmlns:b="Fuse.BasicTheme" ux:AutoCtor="false">
<Font ux:Global="RobotoThin" File="Fonts/Roboto-Thin.ttf" />
<Font ux:Global="RobotoCondensedBold" File="Fonts/RobotoCondensed-Bold.ttf" />
<Font ux:Global="RobotoCondensedBoldItalic" File="Fonts/RobotoCondensed-BoldItalic.ttf" />
<Font ux:Global="RobotoCondensedItalic" File="Fonts/RobotoCondensed-Italic.ttf" />
<Font ux:Global="RobotoCondensedLight" File="Fonts/RobotoCondensed-Light.ttf" />
<Font ux:Global="RobotoCondensedLightItalic" File="Fonts/RobotoCondensed-LightItalic.ttf" />
<Font ux:Global="RobotoCondensedRegular" File="Fonts/RobotoCondensed-Regular.ttf" />
<Font ux:Global="RobotoItalic" File="Fonts/Roboto-Italic.ttf" />
@kusma
kusma / atanlut.m
Last active January 31, 2017 13:26
ATAN lut generator
% ATAN lut-generator for Mesa3D
% Based on polyfitc, http://www.mathworks.com/matlabcentral/fileexchange/47851-constraint-polynomial-fit
X = linspace(0, 1);
Y = atan(X)';
N = [1, 3, 5, 7, 9, 11];
lsqM = ones(numel(X), numel(N));
for n = 1:numel(N)
lsqM(:, n) = X.^N(n);
end