|
Blender V5.0
|
#include "BLI_assert.h"#include "BLI_sys_types.h"#include <math.h>#include "BLI_math_matrix_types.hh"#include "BLI_math_vector_types.hh"Go to the source code of this file.
Macros | |
| #define | GPU_THREAD error_not_in_a_shader_question_mark |
Typedefs | |
| using | bool32_t = int32_t |
| using | packed_float3 = blender::float3 |
| using | packed_int3 = blender::int3 |
| using | packed_uint3 = blender::uint3 |
| using | float2 |
| using | float4 |
| using | int2 |
| using | int4 |
| using | uint2 |
| using | uint4 |
| using | float3 |
| using | int3 |
| using | uint3 |
| using | float2x2 |
| using | float4x2 |
| using | float2x4 |
| using | float3x4 |
| using | float4x4 |
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 bool32_t a int boolean type matching the GLSL type.
Definition in file GPU_shader_shared_utils.hh.
| #define GPU_THREAD error_not_in_a_shader_question_mark |
Definition at line 124 of file GPU_shader_shared_utils.hh.
Definition at line 83 of file GPU_shader_shared_utils.hh.
| using blender::float2 |
Definition at line 618 of file BLI_math_vector_types.hh.
| using blender::float2x2 |
Definition at line 1004 of file BLI_math_matrix_types.hh.
| using blender::float2x4 |
Definition at line 1006 of file BLI_math_matrix_types.hh.
| using blender::float3 |
IMPORTANT: Do not use in shared struct. Use packed_(float/int/uint)3 instead. Here for static functions usage only.
Definition at line 619 of file BLI_math_vector_types.hh.
| using blender::float3x4 |
Definition at line 1009 of file BLI_math_matrix_types.hh.
| using blender::float4 |
Definition at line 620 of file BLI_math_vector_types.hh.
| using blender::float4x2 |
Definition at line 1010 of file BLI_math_matrix_types.hh.
| using blender::float4x4 |
Definition at line 1012 of file BLI_math_matrix_types.hh.
| using blender::int2 |
Definition at line 601 of file BLI_math_vector_types.hh.
| using blender::int3 |
Definition at line 602 of file BLI_math_vector_types.hh.
| using blender::int4 |
Definition at line 603 of file BLI_math_vector_types.hh.
| using packed_float3 = blender::float3 |
Packed types are needed for MSL which have different alignment rules for float3.
Definition at line 100 of file GPU_shader_shared_utils.hh.
| using packed_int3 = blender::int3 |
Definition at line 101 of file GPU_shader_shared_utils.hh.
| using packed_uint3 = blender::uint3 |
Definition at line 102 of file GPU_shader_shared_utils.hh.
| using blender::uint2 |
Definition at line 605 of file BLI_math_vector_types.hh.
| using blender::uint3 |
Definition at line 606 of file BLI_math_vector_types.hh.
| using blender::uint4 |
Definition at line 607 of file BLI_math_vector_types.hh.