Skip to content

Instantly share code, notes, and snippets.

Hans-Kristian Arntzen Themaister

Block or report user

Report or block Themaister

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:7c5b011cde3c7585459b089f80f897e2
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 };
View jitter.cpp
// 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"
View jitter.hpp
// 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 Jan 10, 2019
Android Gradle basic setup for Vulkan
View Setup.md

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 {
View gist:873021cba88acb48e04c668eae3ab4e9
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
View setup_android_sdk_ndk.sh
#!/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"
View gist:95188a695d0f49285647772536a54516
./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
View gist:23ebf87a6104f99a499054550196d5d5
cbuffer Foo : register(b0)
{
float4x4 MVP;
};
float4 main(float4 pos : POSITION) : SV_Position
{
return mul(MVP, pos);
}
View gist:00b70d81bf7c0d0d6c36bb3ce5cfbdf0
git clone git://github.com/ARM-software/vulkan-sdk
cd vulkan-sdk
cmake . -DPLATFORM=xcb
make -j16
./samples/multipass/multipass
View gist:6a866b188edbe0f3e039bd9db3c73c76
AppendStructuredBuffer<float4> append_buffer;
ConsumeStructuredBuffer<float4> consume_buffer;
RWStructuredBuffer<float4> rw_struct_buffer;
RWStructuredBuffer<float4> rw_struct_buffer_no_counter;
StructuredBuffer<float4> struct_buffer;
float4 main(uint pos : FOO) : SV_Target0
{
rw_struct_buffer_no_counter[10] = float4(1.0, 2.0, 3.0, 4.0);
You can’t perform that action at this time.