Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/draw/engines/overlay/overlay_shader_shared.h')
-rw-r--r--source/blender/draw/engines/overlay/overlay_shader_shared.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_shader_shared.h b/source/blender/draw/engines/overlay/overlay_shader_shared.h
new file mode 100644
index 00000000000..4b1d4eea69a
--- /dev/null
+++ b/source/blender/draw/engines/overlay/overlay_shader_shared.h
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef GPU_SHADER
+# include "GPU_shader_shared_utils.h"
+
+# ifdef __cplusplus
+extern "C" {
+# else
+typedef enum OVERLAY_GridBits OVERLAY_GridBits;
+# endif
+typedef struct OVERLAY_GridData OVERLAY_GridData;
+#endif
+
+enum OVERLAY_GridBits {
+ SHOW_AXIS_X = (1 << 0),
+ SHOW_AXIS_Y = (1 << 1),
+ SHOW_AXIS_Z = (1 << 2),
+ SHOW_GRID = (1 << 3),
+ PLANE_XY = (1 << 4),
+ PLANE_XZ = (1 << 5),
+ PLANE_YZ = (1 << 6),
+ CLIP_ZPOS = (1 << 7),
+ CLIP_ZNEG = (1 << 8),
+ GRID_BACK = (1 << 9),
+ GRID_CAMERA = (1 << 10),
+ PLANE_IMAGE = (1 << 11),
+ CUSTOM_GRID = (1 << 12),
+};
+
+/* Match: #SI_GRID_STEPS_LEN */
+#define OVERLAY_GRID_STEPS_LEN 8
+
+struct OVERLAY_GridData {
+ float4 steps[OVERLAY_GRID_STEPS_LEN]; /* float arrays are padded to float4 in std130. */
+ float4 size; /* float3 padded to float4. */
+ float distance;
+ float line_size;
+ float zoom_factor; /* Only for UV editor */
+ float _pad0;
+};
+BLI_STATIC_ASSERT_ALIGN(OVERLAY_GridData, 16)
+
+#ifndef GPU_SHADER
+# ifdef __cplusplus
+}
+# endif
+#endif