Skip to content

Commit

Permalink
Add info on defines for optional features
Browse files Browse the repository at this point in the history
  • Loading branch information
jbritain authored Aug 1, 2024
1 parent 2686822 commit bbf84ea
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/content/docs/reference/Shaders.Properties/flags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,26 @@ sidebar:
#### Location: shaders.properties

Feature flags are an Iris system to query the activation state of certain features. To activate them there are two directives that can be placed in `shaders.properties`: `iris.features.required` and `iris.features.optional`. `iris.features.required` will throw an error if your device or version of Iris does not support the feature. `iris.features.optional` will create a define that can be used to test the availability of such a feature. Additionally the `IS_IRIS` define can be used to test if your shader is in Iris or optifine, and always exists.

<br/>
To use the flags add the following to your `shaders.properties`:
```properties
iris.features.required=SEPARATE_HARDWARE_SAMPLERS COMPUTE_SHADERS
iris.features.optional=BLOCK_EMISSION_ATTRIBUTE ENTITY_TRANSLUCENT SSBO
```

The following are currently valid options:
<br>

The define an optional feature flag creates is in the format `IRIS_FEATURE_<feature>`. For example, if you had:
```properties
iris.features.optional=BLOCK_EMISSION_ATTRIBUTE
```
Then you could check for this with
```glsl
#ifdef IRIS_FEATURE_BLOCK_EMISSION_ATTRIBUTE
```

The following are currently valid feature flags:

`SEPARATE_HARDWARE_SAMPLERS` (required for [Separate Hardware Shadow Samplers](/reference/buffers/shadowtex))

Expand Down

0 comments on commit bbf84ea

Please sign in to comment.