Skip to content
Yours3lf edited this page Jun 18, 2020 · 13 revisions

Welcome to the rpi-vk-driver wiki!

Shader patching

The Broadcom Videocore IV needs a couple of operations to happen in shader code that might have fixed function hardware on other platforms.
These are:

  • writing stencil state setup register
  • writing depth value to depth buffer
  • performing blending in software
  • writing vertex parameter memory read and write setup registers

Since the project will not include a compiler, but rather works with an assembly based shader setup, I decided not to patch shaders based on the state provided to the driver, but rather let the developer have full control. This means that regardless of what

  • depth write state
  • blending state
  • stencil state
  • vertex attribute state

is passed to the driver, this will not be reflected in the final behaviour unless the developer adds it to the assembly shaders. Helper functionality will be provided to aid with encoding register values. Additionally, general documentation will be provided on how to perform these operations.

This will enable developers to take full control and optimise shaders to the last cycle.

Clone this wiki locally