Blender  V3.3
Typedefs
GPU_shader_shared_utils.h File Reference
#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]
 

Detailed Description

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:

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 Documentation

◆ bool1

typedef int bool1

Definition at line 95 of file GPU_shader_shared_utils.h.

◆ bool2

typedef int bool2[2]

Definition at line 96 of file GPU_shader_shared_utils.h.

◆ bool3

typedef int bool3[2]

Definition at line 97 of file GPU_shader_shared_utils.h.

◆ bool4

typedef int bool4[4]

Definition at line 98 of file GPU_shader_shared_utils.h.

◆ float2

typedef float float2[2]

Definition at line 85 of file GPU_shader_shared_utils.h.

◆ float3

typedef float float3[3]

Definition at line 86 of file GPU_shader_shared_utils.h.

◆ float4

typedef float float4[4]

Definition at line 87 of file GPU_shader_shared_utils.h.

◆ float4x4

typedef float float4x4[4][4]

Definition at line 88 of file GPU_shader_shared_utils.h.

◆ int2

typedef int int2[2]

Definition at line 89 of file GPU_shader_shared_utils.h.

◆ int3

typedef int int3[2]

Definition at line 90 of file GPU_shader_shared_utils.h.

◆ int4

typedef int int4[4]

Definition at line 91 of file GPU_shader_shared_utils.h.

◆ uint2

typedef uint uint2[2]

Definition at line 92 of file GPU_shader_shared_utils.h.

◆ uint3

typedef uint uint3[3]

Definition at line 93 of file GPU_shader_shared_utils.h.

◆ uint4

typedef uint uint4[4]

Definition at line 94 of file GPU_shader_shared_utils.h.