Skip to content

Instantly share code, notes, and snippets.

View bwrsandman's full-sized avatar

Sandy bwrsandman

  • Montreal
View GitHub Profile
#include <execution>
#include <benchmark/benchmark.h>
#include <entt/entity/registry.hpp>
#include <glm/vec3.hpp>
static void BM_AoS(benchmark::State& state)
{
struct Zoomer
{
@bwrsandman
bwrsandman / ctr_parser.py
Last active October 17, 2021 21:58
Parser for LionHead's Black & White CTR files containing animations, hair and extra data for the hand and creatures (.hbn, cbn)
import ctypes
import itertools
from collections import OrderedDict
import pprint
from pathlib import Path
class Vec3(ctypes.Structure):
_fields_ = [
("x", ctypes.c_float),
@bwrsandman
bwrsandman / cwfilt.py
Created November 4, 2019 21:11 — forked from jackoalan/cwfilt.py
CodeWarrior C++ Symbol Demangler
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
def demangleNode(node):
pointer = False
ref = False
const = False
unsigned = False
Windows:
i> 00003380 Build: linux / 88b5899952eeca6021c59ce390637e122635841f on Jul 19 2019
i> 00003380 Content root: XXXXX
i> 00003380 Initializing Vulkan 1.1.0...
i> 00003380 Found 4 global layers:
i> 00003380 - VK_LAYER_NV_optimus (spec: 1.1.70, impl: 0.0.1)
i> 00003380 NVIDIA Optimus layer
i> 00003380 - VK_LAYER_VALVE_steam_overlay (spec: 1.1.73, impl: 0.0.1)
i> 00003380 Steam Overlay Layer
i> 00003380 - VK_LAYER_VALVE_steam_fossilize (spec: 1.1.73, impl: 0.0.1)
@bwrsandman
bwrsandman / constant_propagation_pass.diff
Created March 10, 2019 02:50
Adding __attribute__ ((optnone)) to set_zero in src/xenia/cpu/hir/value.h
--- /proc/self/fd/11 2019-03-09 21:47:38.316521355 -0500
+++ /proc/self/fd/13 2019-03-09 21:47:38.316521355 -0500
@@ -1,5 +1,5 @@
-opt/constant_propagation_pass.o: file format elf64-x86-64
+noopt/constant_propagation_pass.o: file format elf64-x86-64
architecture: i386:x86-64, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x0000000000000000
@@ -3027,15 +3027,24 @@
@bwrsandman
bwrsandman / O0-constant_propagation_pass.o
Created March 10, 2019 00:38
constant_propagation_pass optimization issue
O0/constant_propagation_pass.o: file format elf64-x86-64
architecture: i386:x86-64, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x0000000000000000
Disassembly of section .text:
0000000000000000 <xe::cpu::compiler::passes::ConstantPropagationPass::ConstantPropagationPass()>:
#0 0x00005555555e1362 in xe::copy_and_swap_16_aligned(void*, void const*, unsigned long) (dest_ptr=0x7fffffffaf40, src_ptr=0x7fffffffaee2, count=41) at ../src/xenia/base/memory.cc:43
input = {19512248310515026, 6113271908}
output = {140737488331056, 7}
dest = 0x7fffffffaf40
src = 0x7fffffffaee2
shufmask = {434320308619640833, 1013041691324254217}
i = 1
unaligned_words = 0
#1 0x000055555556675f in ()::xe::base::test::____C_A_T_C_H____T_E_S_T__(void) () at ../src/xenia/base/testing/memory_test.cc:77
a = 52651
@bwrsandman
bwrsandman / tri.frag
Last active April 17, 2016 17:18
LunarG Vulkan Triangle Demo ported to SDL2 (Linux-tested only)
/*
* Copyright (c) 2015-2016 The Khronos Group Inc.
* Copyright (c) 2015-2016 Valve Corporation
* Copyright (c) 2015-2016 LunarG, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and/or associated documentation files (the "Materials"), to
* deal in the Materials without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Materials, and to permit persons to whom the Materials are
# Maintainer: Nascher <kevin at nascher dot org>
# Contributor: Ludovic LE ROUX <bojurama12@yahoo.com>
# This package is based on the gog-terraria package and the gog-freedom-planet package from Ainola.
pkgname=gog-shovel-knight
pkgver=2.5.0.7
pkgrel=2
_gamename=${pkgname#gog-}
_gamename_=${_gamename//-/_}

Keybase proof

I hereby claim:

  • I am bwrsandman on github.
  • I am bwrsandman (https://keybase.io/bwrsandman) on keybase.
  • I have a public key whose fingerprint is C3C2 5B39 3568 109B 5B23 5ED3 A619 A81D B067 F56A

To claim this, I am signing this object: