Blender V4.3
GPU_shader_shared_utils.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
31#ifdef GPU_SHADER
32/* Silence macros when compiling for shaders. */
33# define BLI_STATIC_ASSERT(cond, msg)
34# define BLI_STATIC_ASSERT_ALIGN(type_, align_)
35# define BLI_STATIC_ASSERT_SIZE(type_, size_)
36# define ENUM_OPERATORS(a, b)
37# define UNUSED_VARS(a)
38/* Incompatible keywords. */
39# define static
40# define inline
41/* Math function renaming. */
42# define cosf cos
43# define sinf sin
44# define tanf tan
45# define acosf acos
46# define asinf asin
47# define atanf atan
48# define floorf floor
49# define ceilf ceil
50# define sqrtf sqrt
51# define expf exp
52
53#else /* C / C++ */
54# pragma once
55
56# include "BLI_assert.h"
57
60
62// using bool2 = blender::int2; /* Size is not consistent across backend. */
63// using bool3 = blender::int3; /* Size is not consistent across backend. */
64// using bool4 = blender::int4; /* Size is not consistent across backend. */
65
66using blender::float2;
67using blender::float4;
68using blender::int2;
69using blender::int4;
70using blender::uint2;
71using blender::uint4;
74using blender::float3;
75using blender::int3;
76using blender::uint3;
81
83// using blender::float3x2; /* Does not follow alignment rules of GPU. */
85// using blender::float2x3; /* Does not follow alignment rules of GPU. */
86// using blender::float3x3; /* Does not follow alignment rules of GPU. */
87// using blender::float4x3; /* Does not follow alignment rules of GPU. */
91
92#endif
int32_t bool32_t
VecBase< uint32_t, 3 > uint3
VecBase< int32_t, 3 > int3
VecBase< float, 3 > float3
signed int int32_t
Definition stdint.h:77