Blender V5.0
types_int2.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#include "util/types_base.h"
8
10
11#ifndef __KERNEL_NATIVE_VECTOR_TYPES__
12struct int2 {
13 int x, y;
14
15# ifndef __KERNEL_GPU__
16 __forceinline int operator[](int i) const
17 {
18 util_assert(i >= 0);
19 util_assert(i < 2);
20 return *(&x + i);
21 }
22
24 {
25 util_assert(i >= 0);
26 util_assert(i < 2);
27 return *(&x + i);
28 }
29# endif
30};
31
32ccl_device_inline int2 make_int2(const int x, const int y)
33{
34 int2 a = {x, y};
35 return a;
36}
37#endif /* __KERNEL_NATIVE_VECTOR_TYPES__ */
38
40{
41 return {i, i};
42}
43
#define util_assert(statement)
#define ccl_device_inline
#define __forceinline
#define CCL_NAMESPACE_END
__forceinline int operator[](int i) const
Definition types_int2.h:16
__forceinline int & operator[](int i)
Definition types_int2.h:23
i
Definition text_draw.cc:230
ccl_device_inline int2 make_int2(const int x, const int y)
Definition types_int2.h:32