Skip to content

Iris Patcher

The code contained in a shader pack is not the final code that is compiled and executed. In order to ensure maximum compatibility, Iris runs the shader code through glsl-transformer, which generates patched shader code. This is the code that actually ends up on the GPU. In the context of developing shaders, there are several important consequences to note:

  • Since the patcher removes non-necessary whitespace in the code, line numbers in errors will not match up with the line numbers in your code
  • You cannot name your functions or variables in a similar manner as internal Iris variables:
    • iris_
    • irisMain
    • moj_import
  • The patcher will sometimes fix code that should otherwise fail
  • Conversely, the patcher may not be flawless. If you’re experiencing a bug and have exhausted all other possibilites, its worth checking the patched shader code

More information can be found here.