Skip to content

Instantly share code, notes, and snippets.

View rossy's full-sized avatar
👊
平気、へっちゃら!

James Ross-Gowan rossy

👊
平気、へっちゃら!
View GitHub Profile
@rossy
rossy / SublimeClang.sublime-settings
Created August 31, 2012 01:31
MinGW SublimeClang configuration
{
"show_output_panel": false,
"dont_prepend_clang_includes": true,
"additional_language_options":
{
"c++" :
[
"-std=gnu++11",
"-isystem", "C:\\cygwin\\usr\\i686-w64-mingw32\\sys-root\\mingw\\include\\c++\\4.8.0",
#version 450
#extension GL_ARB_compute_shader : enable
#extension GL_ARB_shader_image_load_store : enable
#define tex1D texture
#define tex3D texture
#define LUT_POS(x, lut_size) mix(0.5 / (lut_size), 1.0 - 0.5 / (lut_size), (x))
layout(std140, binding=0) uniform UBO {
layout(offset=0) vec2 texture_size0;
layout(offset=16) mat2 texture_rot0;
layout(offset=48) vec2 texture_off0;
@rossy
rossy / thread_name.c
Last active May 6, 2019 19:33
MinGW-w64 set_thread_name
#include <windows.h>
#include <winnt.h>
#include <winternl.h>
#include <pshpack8.h>
typedef struct {
DWORD dwType;
LPCSTR szName;
DWORD dwThreadID;
DWORD dwFlags;
using System;
using System.IO;
using System.IO.Pipes;
using System.Security.Principal;
using System.Threading.Tasks;
namespace NamedPipeClient
{
class Program
{
#include <windows.h>
#include <stdlib.h>
struct m_thread_info {
DWORD tid;
};
typedef struct m_thread_info *pthread_t;
static DWORD mpv_tls_index = FLS_OUT_OF_INDEXES;
; SPIR-V
; Version: 1.0
; Generator: Google Shaderc over Glslang; 7
; Bound: 41
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
; SPIR-V
; Version: 1.0
; Generator: Google Shaderc over Glslang; 7
; Bound: 40
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %main "main"
OpExecutionMode %main LocalSize 1 1 1
@rossy
rossy / dxgiinfo-amd.txt
Created January 2, 2018 06:37
dxgiinfo results for AMD switchable graphics
Adapter 0:
Device Name: AMD Radeon R7 M360
Device ID: 1002:6900 (rev 81)
Subsystem ID: 1028:06de
LUID: 0000000000008d7e
Output 0:
Device Name: \\.\DISPLAY1
Coordinates: 1920x1080+0+0
Attached to desktop: TRUE
Bits-per-color: 8
#define _WIN32_WINNT 0x0600
#include <windows.h>
#include <dwmapi.h>
#include <stdio.h>
#include <inttypes.h>
uint64_t qpc_freq;
static void print_ratio(const char *name, UNSIGNED_RATIO val)
{
Adapter 0:
Device Name: NVIDIA GeForce GTX 670
Device ID: 10de:1189 (rev a1)
Subsystem ID: 1043:841a
LUID: 0000000000008fc8
Output 0:
Device Name: \\.\DISPLAY1
Coordinates: 2560x1440+0+0
Attached to desktop: TRUE
Bits-per-color: 8