Blender
V4.5
intern
cycles
util
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
9
CCL_NAMESPACE_BEGIN
10
11
#ifndef __KERNEL_NATIVE_VECTOR_TYPES__
12
struct
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
23
__forceinline
int
&
operator[]
(
int
i
)
24
{
25
util_assert
(
i
>= 0);
26
util_assert
(
i
< 2);
27
return
*(&
x
+
i
);
28
}
29
# endif
30
};
31
32
ccl_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
39
CCL_NAMESPACE_END
x
x
Definition
BLI_expr_pylike_eval_test.cc:345
y
y
Definition
compositor_morphological_blur_info.hh:22
util_assert
#define util_assert(statement)
ccl_device_inline
#define ccl_device_inline
__forceinline
#define __forceinline
CCL_NAMESPACE_END
#define CCL_NAMESPACE_END
Definition
device/cuda/compat.h:10
make_int2
ccl_device_forceinline int2 make_int2(const int x, const int y)
Definition
device/metal/compat.h:242
CCL_NAMESPACE_BEGIN
Definition
python.cpp:37
int2
Definition
types_int2.h:12
int2::x
int x
Definition
types_int2.h:13
int2::y
int y
Definition
types_int2.h:13
int2::operator[]
__forceinline int operator[](int i) const
Definition
types_int2.h:16
int2::operator[]
__forceinline int & operator[](int i)
Definition
types_int2.h:23
i
i
Definition
text_draw.cc:230
types_base.h
Generated on
for Blender by
doxygen
1.18.0