Blender  V3.3
types_int2_impl.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #ifndef __UTIL_TYPES_INT2_IMPL_H__
5 #define __UTIL_TYPES_INT2_IMPL_H__
6 
7 #ifndef __UTIL_TYPES_H__
8 # error "Do not include this file directly, include util/types.h instead."
9 #endif
10 
12 
13 #if !defined(__KERNEL_GPU__) || defined(__KERNEL_ONEAPI__)
14 int int2::operator[](int i) const
15 {
16  util_assert(i >= 0);
17  util_assert(i < 2);
18  return *(&x + i);
19 }
20 
21 int &int2::operator[](int i)
22 {
23  util_assert(i >= 0);
24  util_assert(i < 2);
25  return *(&x + i);
26 }
27 
29 {
30  int2 a = {x, y};
31  return a;
32 }
33 #endif /* !defined(__KERNEL_GPU__) || defined(__KERNEL_ONEAPI__) */
34 
36 
37 #endif /* __UTIL_TYPES_INT2_IMPL_H__ */
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
#define ccl_device_inline
Definition: cuda/compat.h:34
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
#define util_assert(statement)
Definition: defines.h:94
static unsigned a[3]
Definition: RandGen.cpp:78
int x
Definition: types_int2.h:15
__forceinline int operator[](int i) const
ccl_device_inline int2 make_int2(int x, int y)