Skip to content

Instantly share code, notes, and snippets.

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

James Ross-Gowan rossy

👊
平気、へっちゃら!
View GitHub Profile
@rossy
rossy / mpv.log
Created January 24, 2022 13:43
gpu-next d3d11 feature level 10_0 log
[ 0.006][v][cplayer] mpv 0.34.0-154-gd92c4238da Copyright © 2000-2021 mpv/MPlayer/mplayer2 projects
[ 0.006][v][cplayer] built on Mon Jan 24 23:47:15 AEDT 2022
[ 0.006][v][cplayer] FFmpeg library versions:
[ 0.007][v][cplayer] libavutil 56.70.100
[ 0.007][v][cplayer] libavcodec 58.134.100
[ 0.007][v][cplayer] libavformat 58.76.100
[ 0.007][v][cplayer] libswscale 5.9.100
[ 0.007][v][cplayer] libavfilter 7.110.100
[ 0.007][v][cplayer] libswresample 3.9.100
[ 0.007][v][cplayer] FFmpeg version: 4.4.1
@rossy
rossy / hole-struct.c
Created January 12, 2022 03:34
Demonstration of how struct padding byte values are unspecified (YMMV depending on compiler)
// clang -Wall -O0 hole-struct.c -o hole-struct
// gcc -Wall -O0 hole-struct.c -o hole-struct
#include <stdio.h>
#include <string.h>
struct hole_struct {
char a;
// char hole1[3];
int b;
@rossy
rossy / unround.c
Created June 30, 2021 14:09
Windows 11 rounded windows
#include <stdbool.h>
#include <windows.h>
#include <dwmapi.h>
extern IMAGE_DOS_HEADER __ImageBase;
#define HINST_THISCOMPONENT ((HINSTANCE)&__ImageBase)
#define DWMWA_WINDOW_CORNER_PREFERENCE (33)
typedef enum {
#define PLAYLIST_ITEMS (50)
#define RAND_WINDOWS (1)
#define RAND_FREEBSD (2)
#define USE_RAND RAND_WINDOWS
#define BIG_PLAYLIST (PLAYLIST_ITEMS > 50)
#define _CRT_RAND_S
#define __USE_MINGW_ANSI_STDIO
Adapter 0:
Device Name: NVIDIA GeForce GTX 670
Device ID: 10de:1189 (rev a1)
Subsystem ID: 1043:841a
LUID: 0000000000009c30
Output 0:
Device Name: \\.\DISPLAY1
Coordinates: 2560x1440+0+0
Attached to desktop: TRUE
Bits-per-color: 8
@rossy
rossy / dark-mode.c
Created September 21, 2019 13:14
Windows 10 dark mode
#include <windows.h>
#include <uxtheme.h>
#include <dwmapi.h>
#define DWMWA_USE_IMMERSIVE_DARK_MODE 19
extern IMAGE_DOS_HEADER __ImageBase;
#define HINST_THISCOMPONENT ((HINSTANCE)&__ImageBase)
struct window {
#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;
; 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