From bbf84eaec7ccb4beff8392455d5d594cd87733c4 Mon Sep 17 00:00:00 2001 From: Josh Britain <50422789+jbritain@users.noreply.github.com> Date: Thu, 1 Aug 2024 13:27:41 +0100 Subject: [PATCH] Add info on defines for optional features --- .../docs/reference/Shaders.Properties/flags.mdx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/content/docs/reference/Shaders.Properties/flags.mdx b/src/content/docs/reference/Shaders.Properties/flags.mdx index 84f369a..1a95f6c 100644 --- a/src/content/docs/reference/Shaders.Properties/flags.mdx +++ b/src/content/docs/reference/Shaders.Properties/flags.mdx @@ -12,6 +12,7 @@ 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. +
To use the flags add the following to your `shaders.properties`: ```properties @@ -19,7 +20,18 @@ iris.features.required=SEPARATE_HARDWARE_SAMPLERS COMPUTE_SHADERS iris.features.optional=BLOCK_EMISSION_ATTRIBUTE ENTITY_TRANSLUCENT SSBO ``` -The following are currently valid options: +
+ +The define an optional feature flag creates is in the format `IRIS_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))