/tasty-pastry

A 4k demo framework for Raspberry Pi

Primary LanguageC

tasty-pastry

A 4k demo framework for Raspberry Pi

Introduction

Tasty-pastry is a work-in-progress demo framework for the Raspberry Pi. This is a long term project, but there are some useful gems already that might be of use to others. The size-oriented linking and fast ESSL trig primitives are believed to be state of the art on Raspberry Pi.

Implemented features

  • C framework to initialise OpenGL ES
  • 4k optimised link process
  • Executable packer
  • OpenGL ES shader language fast sin and cos primitives

4k optimised link process

The link and pack process shrinks executables to a fraction of their original size.

  • Removal of debug information
  • Removal of sections unnecessary for execution
  • Removal of section table itself (courtesy sstrip)

Executable packer

Raspbian Wheezy ships with gzip, bzip2 and best of all xz. The best compression ratios were achieved using xz with the legacy LZMA format, which has a smaller header. Tasty-pastry uses a bash decompression stub to decompress, execute, delete and exit. One file is written in /tmp, and deleted on exit.

  • LZMA based packer (gzip and bzip2 also available)
  • 54 byte decompression stub (53 for gzip)

Shader acceleration

Videocore, the Raspberry Pi GPU, lacks accelerated support for a lot of natives. All trigonometry is calculated longhand. Tasty-pastry provides new trig functions that execute in half the time, but still return results to 0.1% error or less.

Credits