Skip to content

Instantly share code, notes, and snippets.

View tgsstdio's full-sized avatar

David Young tgsstdio

  • Melbourne, Australia
View GitHub Profile
@tgsstdio
tgsstdio / BasicModel.py
Created February 11, 2016 04:46
[PYTHON] custom Blender object model exporter to json
# ExportHelper is a helper class, defines filename and
# invoke() function which calls the file selector.
import bpy
import json
import mathutils
import os
from bpy_extras.io_utils import ExportHelper, axis_conversion
from bpy.props import StringProperty, BoolProperty, EnumProperty, FloatProperty, FloatVectorProperty, IntProperty
from bpy.types import Operator
using BenchmarkDotNet.Attributes;
using System;
using System.Diagnostics;
using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Security;
// Based on fork and see
// http://xoofx.com/blog/2010/10/23/high-performance-memcpy-gotchas-in-c/
using System;
// For generating hexadecimal prefixes for reversed UInt32
// IDEA : UInt32 represents a unique item id made up of UInt32 containing a prefix (i.e. block) and group item id
// prefix is group or block id (usually first 4 bytes)
// suffix is group member id (usually last 4 bytes)
// REASONING : middle bits left unused so the max group size can be adjusted
// even after items are being used
namespace LeftShift
@tgsstdio
tgsstdio / gltrace.py
Last active May 23, 2019 17:46
vkInvalidateMappedBufferRange => glFlushMappedBuffer
if function.name == 'glFlushMappedBufferRange':
print ' GLvoid *map = NULL;'
print ' _glGetBufferPointerv(target, GL_BUFFER_MAP_POINTER, &map);'
print ' if (map && length > 0) {'
self.emit_memcpy('(const char *)map + offset', 'length')
print ' }'
if function.name == 'glFlushMappedBufferRangeAPPLE':
print ' GLvoid *map = NULL;'
print ' _glGetBufferPointerv(target, GL_BUFFER_MAP_POINTER, &map);'
print ' if (map && size > 0) {'