Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The 'Use no error context' setting will prevent the game from loading on some AM
:::

# Finding Compilation Errors
Iris does not have proper support for line numbers in error messages. Line numbers in error messages correspond to the patched version of your shader code, which will not necessarily line up with the line numbers in your original code, especially if you have made use of the `#include` directive. The patched shader output can be found in the `.minecraft/patched_shaders`. Here's an example.
Iris does not have proper support for line numbers in error messages. Line numbers in error messages correspond to the patched version of your shader code, which will not necessarily line up with the line numbers in your original code, especially if you have made use of [the `#include` directive](../include). The patched shader output can be found in the `.minecraft/patched_shaders`. Here's an example.

![`deferred2.fsh: ERROR: 0:336: 'something' : undeclared identifier`](../../../../../assets/debugging/compilationerror.webp)
In this error message, we can see that the error occurs on line 336 of `deferred2.fsh`.
Expand Down
20 changes: 20 additions & 0 deletions src/content/docs/current/Reference/Miscellaneous/include.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: include
description: Allows the shader to be split across multiple files
sidebar:
label: include
order: 2
---

### `#include "<path>"`

This preprocessor directive is replaced with the contents of the included file.

Absolute imports have a leading slash, and are treated as relative to the top-level `shaders/` folder.

Relative imports lack a leading slash, and are treated as relative to the current file.

```glsl title="shaders/overworld/foo"
#include "/bar" // includes shaders/bar
#include "bar" // includes shaders/overworld/bar
```