1 /*
2  * Copyright 2017 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can
5  * be found in the LICENSE file.
6  *
7  */
8 
9 #ifndef SKC_ONCE_SKC_CREATE_CL
10 #define SKC_ONCE_SKC_CREATE_CL
11 
12 //
13 //
14 //
15 
16 #ifdef __APPLE__
17 #include "OpenCL/opencl.h"
18 #else
19 #include "CL/opencl.h"
20 #endif
21 
22 //
23 //
24 //
25 
26 #include "skc.h"
27 
28 //
29 // CONTEXT CREATION
30 //
31 
32 skc_err
33 skc_context_create_cl(skc_context_t * context,
34                       cl_context      context_cl,
35                       cl_device_id    device_id_cl);
36 
37 //
38 // SURFACE RENDER FRAMEBUFFER TYPES
39 //
40 
41 typedef enum skc_framebuffer_cl_mem_type {
42   SKC_FRAMEBUFFER_CL_IMAGE2D,
43   SKC_FRAMEBUFFER_CL_GL_RENDERBUFFER,
44   SKC_FRAMEBUFFER_CL_GL_TEXTURE
45 } skc_framebuffer_cl_mem_type;
46 
47 struct skc_framebuffer_cl
48 {
49   skc_framebuffer_cl_mem_type type;
50   cl_mem                      mem;
51   struct skc_interop        * interop;
52   void                     (* post_render)(struct skc_interop * interop);
53 };
54 
55 //
56 //
57 //
58 
59 #endif
60 
61 //
62 //
63 //
64