Blender  V3.3
GPU_shader_shared_utils.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2022 Blender Foundation. All rights reserved. */
3 
30 #ifdef GPU_SHADER
31 # define BLI_STATIC_ASSERT_ALIGN(type_, align_)
32 # define BLI_STATIC_ASSERT_SIZE(type_, size_)
33 # define static
34 # define inline
35 # define cosf cos
36 # define sinf sin
37 # define tanf tan
38 # define acosf acos
39 # define asinf asin
40 # define atanf atan
41 # define floorf floor
42 # define ceilf ceil
43 # define sqrtf sqrt
44 # define expf exp
45 
46 # define float2 vec2
47 # define float3 vec3
48 # define float4 vec4
49 # define float4x4 mat4
50 # define int2 ivec2
51 # define int3 ivec3
52 # define int4 ivec4
53 # define uint2 uvec2
54 # define uint3 uvec3
55 # define uint4 uvec4
56 # define bool1 bool
57 # define bool2 bvec2
58 # define bool3 bvec3
59 # define bool4 bvec4
60 
61 #else /* C / C++ */
62 # pragma once
63 
64 # include "BLI_assert.h"
65 
66 # ifdef __cplusplus
67 # include "BLI_float4x4.hh"
68 # include "BLI_math_vec_types.hh"
69 using blender::float2;
70 using blender::float3;
71 using blender::float4;
72 using blender::float4x4;
73 using blender::int2;
74 using blender::int3;
75 using blender::int4;
76 using blender::uint2;
77 using blender::uint3;
78 using blender::uint4;
79 using bool1 = int;
80 using bool2 = blender::int2;
81 using bool3 = blender::int3;
82 using bool4 = blender::int4;
83 
84 # else /* C */
85 typedef float float2[2];
86 typedef float float3[3];
87 typedef float float4[4];
88 typedef float float4x4[4][4];
89 typedef int int2[2];
90 typedef int int3[2];
91 typedef int int4[4];
92 typedef uint uint2[2];
93 typedef uint uint3[3];
94 typedef uint uint4[4];
95 typedef int bool1;
96 typedef int bool2[2];
97 typedef int bool3[2];
98 typedef int bool4[4];
99 # endif
100 
101 #endif
unsigned int uint
Definition: BLI_sys_types.h:67
int bool2[2]
float float4x4[4][4]
float float4[4]
int bool4[4]
int bool3[2]
vec_base< uint32_t, 3 > uint3
vec_base< float, 3 > float3
vec_base< float, 4 > float4
vec_base< int32_t, 4 > int4
vec_base< uint32_t, 2 > uint2
vec_base< float, 2 > float2
vec_base< int32_t, 3 > int3
vec_base< uint32_t, 4 > uint4
vec_base< int32_t, 2 > int2