Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/device/cpu/globals.h
| Show All 28 Lines | |||||
| * multiple renders may be running inside the same process. */ | * multiple renders may be running inside the same process. */ | ||||
| #ifdef __OSL__ | #ifdef __OSL__ | ||||
| struct OSLGlobals; | struct OSLGlobals; | ||||
| struct OSLThreadData; | struct OSLThreadData; | ||||
| struct OSLShadingSystem; | struct OSLShadingSystem; | ||||
| #endif | #endif | ||||
| typedef struct KernelGlobals { | typedef struct KernelGlobalsCPU { | ||||
| #define KERNEL_TEX(type, name) texture<type> name; | #define KERNEL_TEX(type, name) texture<type> name; | ||||
| #include "kernel/kernel_textures.h" | #include "kernel/kernel_textures.h" | ||||
| KernelData __data; | KernelData __data; | ||||
| #ifdef __OSL__ | #ifdef __OSL__ | ||||
| /* On the CPU, we also have the OSL globals here. Most data structures are shared | /* On the CPU, we also have the OSL globals here. Most data structures are shared | ||||
| * with SVM, the difference is in the shaders and object/mesh attributes. */ | * with SVM, the difference is in the shaders and object/mesh attributes. */ | ||||
| OSLGlobals *osl; | OSLGlobals *osl; | ||||
| OSLShadingSystem *osl_ss; | OSLShadingSystem *osl_ss; | ||||
| OSLThreadData *osl_tdata; | OSLThreadData *osl_tdata; | ||||
| #endif | #endif | ||||
| /* **** Run-time data **** */ | /* **** Run-time data **** */ | ||||
| ProfilingState profiler; | ProfilingState profiler; | ||||
| } KernelGlobals; | } KernelGlobalsCPU; | ||||
| /* TODO: ccl_attr_maybe_unused? */ | |||||
| typedef const KernelGlobalsCPU *ccl_restrict KernelGlobals; | |||||
sergey: From my understanding you can only inform the compiler that it's OK to have typedef which is… | |||||
| /* Abstraction macros */ | /* Abstraction macros */ | ||||
| #define kernel_tex_fetch(tex, index) (kg->tex.fetch(index)) | #define kernel_tex_fetch(tex, index) (kg->tex.fetch(index)) | ||||
| #define kernel_tex_array(tex) (kg->tex.data) | #define kernel_tex_array(tex) (kg->tex.data) | ||||
| #define kernel_data (kg->__data) | #define kernel_data (kg->__data) | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
From my understanding you can only inform the compiler that it's OK to have typedef which is unused, but you can't make it so variables are "inheriting" the maybe-unused attribute.