Blender
V3.3
|
#include "BLI_assert.h"
Go to the source code of this file.
Typedefs | |
typedef float | float2[2] |
typedef float | float3[3] |
typedef float | float4[4] |
typedef float | float4x4[4][4] |
typedef int | int2[2] |
typedef int | int3[2] |
typedef int | int4[4] |
typedef uint | uint2[2] |
typedef uint | uint3[3] |
typedef uint | uint4[4] |
typedef int | bool1 |
typedef int | bool2[2] |
typedef int | bool3[2] |
typedef int | bool4[4] |
Glue definition to make shared declaration of struct & functions work in both C / C++ and GLSL. We use the same vector and matrix types as Blender C++. Some math functions are defined to use the float version to match the GLSL syntax. This file can be used for C & C++ code and the syntax used should follow the same rules. Some preprocessing is done by the GPU back-end to make it GLSL compatible.
IMPORTANT:
u
suffix for enum values. GLSL do not support implicit cast.uint32_t
as underlying type (enum eMyEnum : uint32_t
).uint
instead.NOTE: Due to alignment restriction and buggy drivers, do not try to use mat3 inside structs. NOTE: (UBO only) Do not use arrays of float. They are padded to arrays of vec4 and are not worth it. This does not apply to SSBO.
IMPORTANT: Do not forget to align mat4, vec3 and vec4 to 16 bytes, and vec2 to 8 bytes.
NOTE: You can use bool type using bool1 a int boolean type matching the GLSL type.
Definition in file GPU_shader_shared_utils.h.
typedef int bool1 |
Definition at line 95 of file GPU_shader_shared_utils.h.
typedef int bool2[2] |
Definition at line 96 of file GPU_shader_shared_utils.h.
typedef int bool3[2] |
Definition at line 97 of file GPU_shader_shared_utils.h.
typedef int bool4[4] |
Definition at line 98 of file GPU_shader_shared_utils.h.
Definition at line 85 of file GPU_shader_shared_utils.h.
Definition at line 86 of file GPU_shader_shared_utils.h.
typedef float float4[4] |
Definition at line 87 of file GPU_shader_shared_utils.h.
typedef float float4x4[4][4] |
Definition at line 88 of file GPU_shader_shared_utils.h.
typedef int int2[2] |
Definition at line 89 of file GPU_shader_shared_utils.h.
typedef int int3[2] |
Definition at line 90 of file GPU_shader_shared_utils.h.
typedef int int4[4] |
Definition at line 91 of file GPU_shader_shared_utils.h.
Definition at line 92 of file GPU_shader_shared_utils.h.
Definition at line 93 of file GPU_shader_shared_utils.h.
Definition at line 94 of file GPU_shader_shared_utils.h.