Skip to content

Instantly share code, notes, and snippets.

View Themaister's full-sized avatar

Hans-Kristian Arntzen Themaister

View GitHub Profile
This is probably not the best place to put this, but whatever. I needed to get this down somewhere before I forget.
I've been looking at the latest efforts in software rendered N64 lately and the graphics programmer in me got interested.
Since I'm a (GP)GPU programmer I want to see this accelerated on the GPU somehow but the naive "render triangles method" is inadequate I think and trying to do LLE with a HLE mindset is fundamentally flawed.
Looking at Angrylion's RDP plugin, the N64 clearly has an extremely specific rasterization and interpolation algorithm
which I believe is not possible to recreate exactly with naive "draw triangle" in OpenGL or any other API (I haven't seen any evidence to the contrary).
Apparently all the OpenGL LLE implementations atm are horribly and utterly broken, so clearly it’s quite hard.
We need a custom rasterizer and this is where things will start to get interesting ...
From cc3255fa6810e63b34d8c1fa98bec1b2037625d4 Mon Sep 17 00:00:00 2001
From: Hans-Kristian Arntzen <maister@archlinux.us>
Date: Sat, 30 Jan 2016 00:14:00 +0100
Subject: [PATCH] Should fix few issues with netplay.
One perf fix and 3/4 player fix.
---
netplay/netplay.c | 7 +++++++
netplay/netplay_net.c | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
@Themaister
Themaister / gist:efdae15e71b16b00daf3
Created January 26, 2016 20:32
Blind attempt for analog netplay
From 83746a68b4029d207f4eec7d7c3cf3987fa77a71 Mon Sep 17 00:00:00 2001
From: Hans-Kristian Arntzen <maister@archlinux.us>
Date: Tue, 26 Jan 2016 21:31:58 +0100
Subject: [PATCH] Blind attempt to support RETRO_DEVICE_ANALOG in netplay.
---
netplay/netplay.c | 82 ++++++++++++++++++++++++++++++++++-------------
netplay/netplay_private.h | 9 +++---
2 files changed, 64 insertions(+), 27 deletions(-)
From 429188faf002ec326593bde627e9660943113896 Mon Sep 17 00:00:00 2001
From: Hans-Kristian Arntzen <maister@archlinux.us>
Date: Tue, 26 Jan 2016 20:07:26 +0100
Subject: [PATCH] Strip lines with #pragma parameter.
It's not valid GLSL to have quotes in them, and it's meaningless
to pass in the #pragmas to the driver.
---
gfx/drivers_shader/shader_glsl.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <sys/fcntl.h>
#include <sys/un.h>
#include <stdbool.h>
#include <stdio.h>
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/fcntl.h>
#include <sys/un.h>
#include <stdbool.h>
#include <stdio.h>
#include <errno.h>
#include <stdint.h>
#include <unistd.h>
// GLSL source
#version 450
layout(location = 0) uniform mat4 uMVP;
layout(location = 0) in vec4 aPosition;
void main()
{
gl_Position = uMVP * aPosition;
// Original source
#version 310 es
layout(local_size_x = 1) in;
layout(std430, binding = 0) writeonly buffer SSBO
{
vec4 data[];
} outdata;
// Compile: gcc -o dark.so -shared dark.c -std=c99 -O3 -Wall -pedantic -fPIC
#include "softfilter.h"
#include <stdlib.h>
static unsigned impl_input_fmts(void)
{
return SOFTFILTER_FMT_XRGB8888;
}
// Compile: g++ -o dark.so -shared dark.c -std=c99 -O3 -Wall -pedantic -fPIC
#include "softfilter.h"
#include <stdlib.h>
static unsigned impl_input_fmts(void)
{
return SOFTFILTER_FMT_XRGB8888;
}