|
Blender V4.3
|
Go to the source code of this file.
Typedefs | |
| using | bool32_t = int32_t |
| using | packed_float3 = blender::float3 |
| using | packed_int3 = blender::int3 |
| using | packed_uint3 = blender::uint3 |
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 bool32_t a int boolean type matching the GLSL type.
Definition in file GPU_shader_shared_utils.hh.
Definition at line 61 of file GPU_shader_shared_utils.hh.
| using packed_float3 = blender::float3 |
Packed types are needed for MSL which have different alignment rules for float3.
Definition at line 78 of file GPU_shader_shared_utils.hh.
| using packed_int3 = blender::int3 |
Definition at line 79 of file GPU_shader_shared_utils.hh.
| using packed_uint3 = blender::uint3 |
Definition at line 80 of file GPU_shader_shared_utils.hh.