Blender  V2.93
GPU_select.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2014 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "BLI_sys_types.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 struct rcti;
33 
34 /* flags for mode of operation */
35 enum {
37  /* gpu_select_query */
40  /* gpu_select_pick */
43 };
44 
46  unsigned int *buffer, unsigned int bufsize, const struct rcti *input, char mode, int oldhits);
47 bool GPU_select_load_id(unsigned int id);
49 unsigned int GPU_select_end(void);
50 
51 /* cache selection region */
52 bool GPU_select_is_cached(void);
53 void GPU_select_cache_begin(void);
54 void GPU_select_cache_load_id(void);
55 void GPU_select_cache_end(void);
56 
57 /* utilities */
58 const uint *GPU_select_buffer_near(const uint *buffer, int hits);
59 uint GPU_select_buffer_remove_by_id(uint *buffer, int hits, uint select_id);
60 void GPU_select_buffer_stride_realign(const struct rcti *src, const struct rcti *dst, uint *r_buf);
61 
62 #ifdef __cplusplus
63 }
64 #endif
unsigned int uint
Definition: BLI_sys_types.h:83
void GPU_select_finalize(void)
uint GPU_select_buffer_remove_by_id(uint *buffer, int hits, uint select_id)
Definition: gpu_select.c:215
void GPU_select_cache_begin(void)
Definition: gpu_select.c:159
bool GPU_select_load_id(unsigned int id)
Definition: gpu_select.c:108
bool GPU_select_is_cached(void)
Definition: gpu_select.c:185
void GPU_select_cache_load_id(void)
Definition: gpu_select.c:169
void GPU_select_buffer_stride_realign(const struct rcti *src, const struct rcti *dst, uint *r_buf)
void GPU_select_cache_end(void)
Definition: gpu_select.c:177
@ GPU_SELECT_NEAREST_SECOND_PASS
Definition: GPU_select.h:39
@ GPU_SELECT_NEAREST_FIRST_PASS
Definition: GPU_select.h:38
@ GPU_SELECT_PICK_ALL
Definition: GPU_select.h:41
@ GPU_SELECT_ALL
Definition: GPU_select.h:36
@ GPU_SELECT_PICK_NEAREST
Definition: GPU_select.h:42
unsigned int GPU_select_end(void)
Definition: gpu_select.c:131
const uint * GPU_select_buffer_near(const uint *buffer, int hits)
Definition: gpu_select.c:200
void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, const struct rcti *input, char mode, int oldhits)
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer