We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6f84ac3 + e3af8aa commit 1269439Copy full SHA for 1269439
tutorials/shaders/shader_reference/shader_preprocessor.rst
@@ -355,6 +355,24 @@ Defines the optional block which is included when the previously defined ``#if``
355
356
Used as terminator for the ``#if``, ``#ifdef``, ``#ifndef`` or subsequent ``#else`` directives.
357
358
+#error
359
+^^^^^^
360
+
361
+**Syntax:** ``#error <message>``
362
363
+The ``#error`` directive forces the preprocessor to emit an error with optional message.
364
+For example, it's useful when used within ``#if`` block to provide a strict limitation of the
365
+defined value.
366
367
+.. code-block:: glsl
368
369
+ #define MAX_LOD 3
370
+ #define LOD 4
371
372
+ #if LOD > MAX_LOD
373
+ #error LOD exceeds MAX_LOD
374
+ #endif
375
376
#include
377
^^^^^^^^
378
0 commit comments