Blender V4.3
types_float2_impl.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#ifndef __UTIL_TYPES_H__
8# error "Do not include this file directly, include util/types.h instead."
9#endif
10
12
13#ifndef __KERNEL_NATIVE_VECTOR_TYPES__
14# ifndef __KERNEL_GPU__
16{
17 util_assert(i >= 0);
18 util_assert(i < 2);
19 return *(&x + i);
20}
21
23{
24 util_assert(i >= 0);
25 util_assert(i < 2);
26 return *(&x + i);
27}
28# endif
29
31{
32 float2 a = {x, y};
33 return a;
34}
35#endif /* __KERNEL_NATIVE_VECTOR_TYPES__ */
36
38{
39#ifdef __KERNEL_PRINTF__
40 printf("%s: %.8f %.8f\n", label, (double)a.x, (double)a.y);
41#endif
42}
43
#define printf
#define util_assert(statement)
Definition defines.h:98
const char * label
#define ccl_private
#define ccl_device_inline
#define CCL_NAMESPACE_END
#define __forceinline
__forceinline float operator[](int i) const
ccl_device_inline void print_float2(ccl_private const char *label, const float2 a)
ccl_device_inline float2 make_float2(float x, float y)