Skip to content

Instantly share code, notes, and snippets.

View Themaister's full-sized avatar

Hans-Kristian Arntzen Themaister

View GitHub Profile
#!/usr/bin/env python
"""Python 3 script which converts simple RetroArch Cg shaders to modern XML/GLSL format."""
import sys
import os
def remove_comments(source_lines):
ret = []
killed_comments = [line.split('//')[0] for line in source_lines]
SIMD8 shader: 26 instructions. 0 loops. 572 cycles. 0:0 spills:fills. scheduled with mode top-down. Promoted 0 constants. Compacted 416 to 336 bytes (19%)
START B0 (352 cycles)
add(16) g4<1>UW g1.4<1,4,0>UW 0x11001010V { align1 WE_all 1H };
pln(8) g9<1>F g6<0,1,0>F g2<8,8,1>F { align1 1Q compacted };
pln(8) g10<1>F g6.4<0,1,0>F g2<8,8,1>F { align1 1Q compacted };
mov(8) g2<1>F g4<8,4,1>UW { align1 1Q };
mov(8) g3<1>F g4.4<8,4,1>UW { align1 1Q };
add(8) g2<1>F g2<8,8,1>F 0x3f000000F /* 0.5F */ { align1 1Q };
add(8) g3<1>F g3<8,8,1>F 0x3f000000F /* 0.5F */ { align1 1Q };
mov(8) g4<1>D g2<8,8,1>F { align1 1Q compacted };
// License: MIT
#include "jitter.hpp"
#include "llvm/IR/DataLayout.h"
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/Transforms/InstCombine/InstCombine.h"
#include "llvm/Transforms/Scalar.h"
// License: MIT
#pragma once
#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
#include "llvm/ExecutionEngine/Orc/Core.h"
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
#include "llvm/IR/IRBuilder.h"
@Themaister
Themaister / Setup.md
Last active January 10, 2019 20:32
Android Gradle basic setup for Vulkan

settings.gradle

include ':android' // Will pull in android/ folder as a subproject. I think you need this file even if you only have one project.

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
11-09 19:07:55.899 26914 26935 I Granite : Starting WSITiming frame serial: 468
11-09 19:07:55.899 26914 26935 I Granite : Updating frame pacing base to serial: 463 (delta: 16.760 ms)
11-09 19:07:55.899 26914 26935 I Granite : Have presentation timing for 5 frames in the past.
11-09 19:07:55.899 26914 26935 E Granite : *** Image was presented 1 frames late (target: 272190980.538 ms, rounded target: 272190979.494 ms, actual: 272190997.292 ms) compared to desired target. This normally happens in startup phase, but otherwise it's either a real hitch or app bug. ***
11-09 19:07:55.899 26914 26935 I Granite : Total latency: 61.869 ms, slack time: 16.608
11-09 19:07:55.899 26914 26935 E Granite : *** HITCH DETECTED ***
11-09 19:07:55.899 26914 26935 E Granite : Observed 1 dropped frames!
11-09 19:07:55.899 26914 26935 I Granite : Frame time ID #463: 33.470 ms
11-09 19:07:55.902 26914 26935 I Granite : Reported frame time: 16.793 ms
11-09 19:07:55.916 26914 26935 I Granite : Starting WSITiming frame serial: 469
#!/bin/bash
if [ -z $ANDROID_HOME ]; then
ANDROID_HOME="$HOME/Android/Sdk"
fi
echo "=== Installing SDK and NDK to $ANDROID_HOME. If this is not desired, override ANDROID_HOME environment variable! ==="
mkdir -p "$ANDROID_HOME"
cd "$ANDROID_HOME"
./cli/fossilize-disasm /tmp/emergency.json --device-index 1 --graphics-pipeline 0 --target amd --stage frag 20:50
WARNING: radv is not a conformant vulkan implementation, testing use only.
Fossilize INFO: Chose GPU:
Fossilize INFO: name: AMD RADV POLARIS10 (LLVM 6.0.0)
Fossilize INFO: apiVersion: 1.0.57
Fossilize INFO: vendorID: 0x1002
Fossilize INFO: deviceID: 0x67df
Fossilize INFO: Creating shader module #0
Fossilize INFO: ... Succeeded!
Fossilize INFO: Creating shader module #1
cbuffer Foo : register(b0)
{
float4x4 MVP;
};
float4 main(float4 pos : POSITION) : SV_Position
{
return mul(MVP, pos);
}
git clone git://github.com/ARM-software/vulkan-sdk
cd vulkan-sdk
cmake . -DPLATFORM=xcb
make -j16
./samples/multipass/multipass