~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to intern/cycles/kernel/kernel_globals.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
/* Constant Globals */
20
20
 
21
 
#ifdef __KERNEL_CPU__
22
 
 
23
 
#ifdef __OSL__
24
 
#include "osl_globals.h"
25
 
#endif
26
 
 
27
 
#endif
28
 
 
29
21
CCL_NAMESPACE_BEGIN
30
22
 
31
23
/* On the CPU, we pass along the struct KernelGlobals to nearly everywhere in
32
 
   the kernel, to access constant data. These are all stored as "textures", but
33
 
   these are really just standard arrays. We can't use actually globals because
34
 
   multiple renders may be running inside the same process. */
 
24
 * the kernel, to access constant data. These are all stored as "textures", but
 
25
 * these are really just standard arrays. We can't use actually globals because
 
26
 * multiple renders may be running inside the same process. */
35
27
 
36
28
#ifdef __KERNEL_CPU__
37
29
 
 
30
#ifdef __OSL__
 
31
struct OSLGlobals;
 
32
struct OSLThreadData;
 
33
struct OSLShadingSystem;
 
34
#endif
 
35
 
 
36
#define MAX_BYTE_IMAGES   512
 
37
#define MAX_FLOAT_IMAGES  5
 
38
 
38
39
typedef struct KernelGlobals {
 
40
        texture_image_uchar4 texture_byte_images[MAX_BYTE_IMAGES];
 
41
        texture_image_float4 texture_float_images[MAX_FLOAT_IMAGES];
39
42
 
40
43
#define KERNEL_TEX(type, ttype, name) ttype name;
41
 
#define KERNEL_IMAGE_TEX(type, ttype, name) ttype name;
 
44
#define KERNEL_IMAGE_TEX(type, ttype, name)
42
45
#include "kernel_textures.h"
43
46
 
44
47
        KernelData __data;
45
48
 
46
49
#ifdef __OSL__
47
50
        /* On the CPU, we also have the OSL globals here. Most data structures are shared
48
 
           with SVM, the difference is in the shaders and object/mesh attributes. */
49
 
        OSLGlobals osl;
 
51
         * with SVM, the difference is in the shaders and object/mesh attributes. */
 
52
        OSLGlobals *osl;
 
53
        OSLShadingSystem *osl_ss;
 
54
        OSLThreadData *osl_tdata;
50
55
#endif
51
56
 
52
57
} KernelGlobals;
54
59
#endif
55
60
 
56
61
/* For CUDA, constant memory textures must be globals, so we can't put them
57
 
   into a struct. As a result we don't actually use this struct and use actual
58
 
   globals and simply pass along a NULL pointer everywhere, which we hope gets
59
 
   optimized out. */
 
62
 * into a struct. As a result we don't actually use this struct and use actual
 
63
 * globals and simply pass along a NULL pointer everywhere, which we hope gets
 
64
 * optimized out. */
60
65
 
61
66
#ifdef __KERNEL_CUDA__
62
67