sleirsgoevy / piglet-shaders

PoC of custom shaders for Piglet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Piglet custom shader PoC

This is a PoC for compiling Piglet fragment shaders using Mesa3D.

  • You need to provide a compatible vertex shader, it's needed because Mesa3D compiles both shaders at once.
  • At most one sampler is currently supported.
  • This a PoC and can break at any time.

victim.c is loosely based on this EGL sample

Dependencies

  • Mesa3D (obviously)
  • CLRX

Usage

cd compiler
make
bash compile.sh vertex.glsl fragment.glsl vertex.bin fragment.bin

Known non-trivial bugs (require Mesa patching to fix)

  • Matrices other than mat4 are broken (std140)
  • Arrays of anything but vec4 and mat4 are broken (std140)
  • Constant arrays are not supported, pass them as uniforms instead

About

PoC of custom shaders for Piglet


Languages

Language:Python 61.0%Language:C 32.1%Language:Assembly 3.3%Language:Shell 2.9%Language:Makefile 0.6%