Skip to content

Instantly share code, notes, and snippets.

@SaschaWillems
SaschaWillems / gist:3cf27f4ed450694c274ee585b8e1659d
Created August 3, 2024 14:45
Spacescape to PowerVR Textools
Export using Source export (BK, FT, LT, RT, UP, DN)
Assign in PowerVR TexTools:
X-Negative: LF
X-Positive: RT
Y-Positive: UP
Y-Negative: DN
Z-Position: FT
Z-Negative: BK
import json
import argparse
import sys
import os
import subprocess
parser = argparse.ArgumentParser(description='Convert a glTF file textures to the ktx format')
parser.add_argument('--input', type=str, help='glTF file')
parser.add_argument('--output', type=str, help='Filename for updated glTF file')
parser.add_argument('--format', type=str, help='KTX format')
@SaschaWillems
SaschaWillems / activity.java
Last active November 1, 2023 06:54
Displaying a native android alert dialog from C++ using JNI
package com.yourpackage.appname;
import java.util.concurrent.Semaphore;
public class MyActivity extends NativeActivity {
static {
// Load native library
System.loadLibrary("native-lib");
}
@SaschaWillems
SaschaWillems / vk.cpp
Last active November 23, 2023 10:02
Multiple Vulkan buffer binding points
Shader
layout (location = 0) in vec3 inPos;
layout (location = 1) in vec3 inColor;
layout (location = 2) in vec3 inPosB;
layout (location = 3) in vec3 inColorB;
...
Application

Keybase proof

I hereby claim:

  • I am saschawillems on github.
  • I am swillems (https://keybase.io/swillems) on keybase.
  • I have a public key ASAGD9NZGcY5mKC3hFhPsYe7sltAYmC03Pt6nwHJ3MOBDQo

To claim this, I am signing this object:

Totals: 23523 hits 410992 bytes
OpLoad[ 61] = 2729 hits (11.60%) 43664 bytes (10.62%)
0 hits with memory access 0.00%
OpName[ 5] = 2337 hits ( 9.93%) 40856 bytes ( 9.94%)
OpVariable[ 59] = 1874 hits ( 7.97%) 29984 bytes ( 7.30%)
0 hits with initializer 0.00%
OpStore[ 62] = 1496 hits ( 6.36%) 17952 bytes ( 4.37%)
0 hits with memory access 0.00%
OpDecorate[ 71] = 1408 hits ( 5.99%) 21700 bytes ( 5.28%)
207 hits with no literals 14.70%
Loading data
Doing quality evals...
xxHash64 xxHash64-32 City64 City64-32 Mum Farm64 Farm64-32 SpookyV2-64 xxHash32 Murmur3-X64-64 Murmur2A Murmur3-32 Mum-32 City32 Farm32 SipRef SipRef-32 CRC32 MD5-32 SHA1-32 FNV-1a FNV-1amod djb2 SDBM ELFLikeBadHash
Doing performance evals...
iter 1/9
iter 2/9
iter 3/9
iter 4/9
iter 5/9
iter 6/9
@SaschaWillems
SaschaWillems / gist:47be6970a3e99a3d30e1
Last active September 26, 2018 22:09
Intel Vulkan Mesa on Ubuntu 15.10
# Pre requisites
- Enable DRI3 as described in https://vulkan.lunarg.com/app/docs/v1.0.3.1/getting_started_linux
- Install a library for SHA, e.g. sudo apt-get install libgcrypt11-dev (if not already present)
- Otherwise the driver may throw an error with "_mesa_sha1_compute" when loading SPIR-V shaders
# Building
- Clone Mesa Master : git clone git://anongit.freedesktop.org/mesa/mesa -b Master
- cd mesa
- autoreconf -vfi
- ./configure --with-dri-drivers=i965 --with-gallium-drivers= --with-sha1= --with-vulkan-drivers=intel