Skip to content

Instantly share code, notes, and snippets.

@hikiko
hikiko / dump_float_rgba_tex.c
Last active Mar 7, 2021
copy paste it to dump float rgba textures (*data = the pointer I'd give in TexImage2D)
View dump_float_rgba_tex.c
static bool
dump_float_image_rgba(const char *fname,
int w, int h,
float *data)
{
FILE *fp;
int i;
float *p;
if (!(fp = fopen(fname, "wb"))) {
@hikiko
hikiko / args.gn
Last active Mar 7, 2021
gn args I use in angle, on GDB: set directories $HOME/igalia/code/angle/out/Debug
View args.gn
clang_emit_debug_info_for_profiling = true
enable_iterator_debugging = true
is_debug = true
symbol_level = 2
use_dwarf5 = false
strip_debug_info = false
use_debug_fission = false
@hikiko
hikiko / iso_angle.sh
Created Feb 18, 2021
set env for angle just notes to myself (I set those paths better in shctx Makefiles check each branch)
View iso_angle.sh
#!/bin/sh
PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \[\033[0;36m\]\h \w\[\033[0;32m\]$(__git_ps1)\n\[\033[0;32m\]└─\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\] ▶\[\033[0m\] '
PS1="[angle] $PS1"
export PATH=$PATH:$HOME/igalia/install/bin:~/igalia/code/depot_tools
export LD_LIBRARY_PATH=/home/eleni/igalia/code/angle/out/Debug:/home/eleni/igalia/install/lib
export LD_RUN_PATH=/home/eleni/igalia/code/angle/out/Debug:/home/eleni/igalia/install/lib
export LIBGL_DRIVERS_PATH=$HOME/igalia/install/lib/x86_64-linux-gnu/dri/
export MESA_DEBUG=1
@hikiko
hikiko / image-list.pl
Last active Nov 19, 2020
perl script to create an index.html from a dir of images
View image-list.pl
#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
use Getopt::Long;
use File::MimeInfo;
my @files;
@hikiko
hikiko / run_mustpass_selection.pl
Last active Nov 18, 2020
Reads CTS from files and runs them with run_cts.pl (previous gist).
View run_mustpass_selection.pl
#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
use Getopt::Long;
use File::Copy 'move';
my $file_sel_tests = "";
@hikiko
hikiko / run_cts.pl
Last active Nov 18, 2020
Run and display a cts test, save the result image in a directory png/<testname.png> for later, ./run_cts -h
View run_cts.pl
#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
use Getopt::Long;
use Cwd qw(cwd);
my $test = "";
View build_mesa_i965.sh
#!/bin/bash
PS1="[isolated] $PS1"
export VK_ICD_FILENAMES=$HOME/igalia/install/share/vulkan/icd.d/intel_icd.x86_64.json
#export VK_ICD_FILENAMES=$HOME/igalia/install/share/vulkan/icd.d/radeon_icd.x86_64.json
export PATH=$PATH:$HOME/igalia/install/bin
export LD_LIBRARY_PATH=$HOME/igalia/install/lib
export LD_RUN_PATH=$HOME/igalia/install/lib
export XDG_DATA_DIRS=$XDG_DATA_DIRS:$HOME/igalia/install/share
@hikiko
hikiko / foobar.c
Created Jul 22, 2020
note to myself
View foobar.c
struct {
float z;
uint32_t zs;
} *pixels;
int i;
pixels = calloc(w * h, 8);
glGetTextureImage(vkgl_depth_tex, 0,
GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV,
w * h * 8,
pixels);
@hikiko
hikiko / xor.vert.frag
Last active Apr 13, 2020
xor pattern shader (the comment) :p
View xor.vert.frag
#version 430
#extension GL_ARB_separate_shader_objects : enable
const vec2 vdata[] = vec2[] (
vec2(1.0, 1.0),
vec2(1.0, 0.0),
vec2(0.0, 1.0),
vec2(0.0, 0.0));
void main()
@hikiko
hikiko / dump_ppm.c
Created Apr 7, 2020
the code I use to dump ppm because I always forget those P6, P3 etc :p
View dump_ppm.c
{
unsigned char pix[160 * 160 * 4];
FILE *fp;
int i;
glBindTexture(GL_TEXTURE_2D, gl_tex);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, pix);
if ((fp = fopen("/tmp/foo.ppm", "wb"))) {
//fprintf(fp, "P6\n160 160\n255\n");