forked from bartvdbraak/blender
Merge branch 'master' into blender2.8
This commit is contained in:
commit
78a6689aea
@ -29,4 +29,4 @@ void xml_read_file(Scene *scene, const char *filepath);
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __CYCLES_XML_H__ */
|
||||
#endif /* __CYCLES_XML_H__ */
|
||||
|
@ -33,4 +33,4 @@ void CCL_logging_verbosity_set(int verbosity);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CCL_API_H__ */
|
||||
#endif /* __CCL_API_H__ */
|
||||
|
@ -22,7 +22,7 @@ void CCL_init_logging(const char *argv0)
|
||||
ccl::util_logging_init(argv0);
|
||||
}
|
||||
|
||||
void CCL_start_debug_logging(void)
|
||||
void CCL_start_debug_logging()
|
||||
{
|
||||
ccl::util_logging_start();
|
||||
}
|
||||
|
@ -46,4 +46,4 @@ private:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BLENDER_OBJECT_CULL_H__ */
|
||||
#endif /* __BLENDER_OBJECT_CULL_H__ */
|
||||
|
@ -843,18 +843,18 @@ void *CCL_python_module_init()
|
||||
#ifdef WITH_NETWORK
|
||||
PyModule_AddObject(mod, "with_network", Py_True);
|
||||
Py_INCREF(Py_True);
|
||||
#else /* WITH_NETWORK */
|
||||
#else /* WITH_NETWORK */
|
||||
PyModule_AddObject(mod, "with_network", Py_False);
|
||||
Py_INCREF(Py_False);
|
||||
#endif /* WITH_NETWORK */
|
||||
#endif /* WITH_NETWORK */
|
||||
|
||||
#ifdef WITH_EMBREE
|
||||
PyModule_AddObject(mod, "with_embree", Py_True);
|
||||
Py_INCREF(Py_True);
|
||||
#else /* WITH_EMBREE */
|
||||
#else /* WITH_EMBREE */
|
||||
PyModule_AddObject(mod, "with_embree", Py_False);
|
||||
Py_INCREF(Py_False);
|
||||
#endif /* WITH_EMBREE */
|
||||
#endif /* WITH_EMBREE */
|
||||
|
||||
return (void*)mod;
|
||||
}
|
||||
|
@ -179,4 +179,4 @@ protected:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BLENDER_SESSION_H__ */
|
||||
#endif /* __BLENDER_SESSION_H__ */
|
||||
|
@ -628,8 +628,8 @@ static ShaderNode *add_node(Scene *scene,
|
||||
}
|
||||
}
|
||||
#else
|
||||
(void)b_data;
|
||||
(void)b_ntree;
|
||||
(void) b_data;
|
||||
(void) b_ntree;
|
||||
#endif
|
||||
}
|
||||
else if(b_node.is_a(&RNA_ShaderNodeTexImage)) {
|
||||
|
@ -208,4 +208,4 @@ private:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BLENDER_SYNC_H__ */
|
||||
#endif /* __BLENDER_SYNC_H__ */
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "render/mesh.h"
|
||||
|
||||
#include "util/util_algorithm.h"
|
||||
#include "util/util_array.h"
|
||||
#include "util/util_map.h"
|
||||
#include "util/util_path.h"
|
||||
#include "util/util_set.h"
|
||||
@ -838,4 +839,4 @@ protected:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BLENDER_UTIL_H__ */
|
||||
#endif /* __BLENDER_UTIL_H__ */
|
||||
|
@ -19,7 +19,7 @@
|
||||
#define __BVH_H__
|
||||
|
||||
#include "bvh/bvh_params.h"
|
||||
|
||||
#include "util/util_array.h"
|
||||
#include "util/util_types.h"
|
||||
#include "util/util_vector.h"
|
||||
|
||||
@ -126,4 +126,4 @@ struct BVHStackEntry
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BVH_H__ */
|
||||
#endif /* __BVH_H__ */
|
||||
|
@ -84,4 +84,4 @@ protected:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BVH2_H__ */
|
||||
#endif /* __BVH2_H__ */
|
||||
|
@ -84,4 +84,4 @@ protected:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BVH4_H__ */
|
||||
#endif /* __BVH4_H__ */
|
||||
|
@ -95,4 +95,4 @@ protected:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BVH8_H__ */
|
||||
#endif /* __BVH8_H__ */
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "bvh/bvh_params.h"
|
||||
#include "bvh/bvh_unaligned.h"
|
||||
|
||||
#include "util/util_array.h"
|
||||
#include "util/util_task.h"
|
||||
#include "util/util_vector.h"
|
||||
|
||||
@ -142,4 +143,4 @@ protected:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BVH_BUILD_H__ */
|
||||
#endif /* __BVH_BUILD_H__ */
|
||||
|
@ -881,4 +881,4 @@ void BVHEmbree::refit_nodes()
|
||||
}
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* WITH_EMBREE */
|
||||
#endif /* WITH_EMBREE */
|
||||
|
@ -74,6 +74,6 @@ private:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* WITH_EMBREE */
|
||||
#endif /* WITH_EMBREE */
|
||||
|
||||
#endif /* __BVH_EMBREE_H__ */
|
||||
#endif /* __BVH_EMBREE_H__ */
|
||||
|
@ -169,4 +169,4 @@ public:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BVH_NODE_H__ */
|
||||
#endif /* __BVH_NODE_H__ */
|
||||
|
@ -286,4 +286,4 @@ struct BVHSpatialStorage {
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BVH_PARAMS_H__ */
|
||||
#endif /* __BVH_PARAMS_H__ */
|
||||
|
@ -35,4 +35,4 @@ void bvh_reference_sort(int start,
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BVH_SORT_H__ */
|
||||
#endif /* __BVH_SORT_H__ */
|
||||
|
@ -259,4 +259,4 @@ public:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BVH_SPLIT_H__ */
|
||||
#endif /* __BVH_SPLIT_H__ */
|
||||
|
@ -77,4 +77,4 @@ protected:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BVH_UNALIGNED_H__ */
|
||||
#endif /* __BVH_UNALIGNED_H__ */
|
||||
|
@ -181,7 +181,7 @@ public:
|
||||
/* Convert the requested features structure to a build options,
|
||||
* which could then be passed to compilers.
|
||||
*/
|
||||
string get_build_options(void) const
|
||||
string get_build_options() const
|
||||
{
|
||||
string build_options = "";
|
||||
if(experimental) {
|
||||
@ -240,8 +240,8 @@ std::ostream& operator <<(std::ostream &os,
|
||||
/* Device */
|
||||
|
||||
struct DeviceDrawParams {
|
||||
function<void(void)> bind_display_space_shader_cb;
|
||||
function<void(void)> unbind_display_space_shader_cb;
|
||||
function<void()> bind_display_space_shader_cb;
|
||||
function<void()> unbind_display_space_shader_cb;
|
||||
};
|
||||
|
||||
class Device {
|
||||
@ -374,4 +374,4 @@ private:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __DEVICE_H__ */
|
||||
#endif /* __DEVICE_H__ */
|
||||
|
@ -81,11 +81,11 @@ public:
|
||||
|
||||
/* Silence potential warnings about unused variables
|
||||
* when compiling without some architectures. */
|
||||
(void)kernel_sse2;
|
||||
(void)kernel_sse3;
|
||||
(void)kernel_sse41;
|
||||
(void)kernel_avx;
|
||||
(void)kernel_avx2;
|
||||
(void) kernel_sse2;
|
||||
(void) kernel_sse3;
|
||||
(void) kernel_sse41;
|
||||
(void) kernel_avx;
|
||||
(void) kernel_avx2;
|
||||
#ifdef WITH_CYCLES_OPTIMIZED_KERNEL_AVX2
|
||||
if(DebugFlags().cpu.has_avx2() && system_cpu_support_avx2()) {
|
||||
architecture_name = "AVX2";
|
||||
@ -288,7 +288,7 @@ public:
|
||||
}
|
||||
#ifdef WITH_EMBREE
|
||||
bvh_layout_mask |= BVH_LAYOUT_EMBREE;
|
||||
#endif /* WITH_EMBREE */
|
||||
#endif /* WITH_EMBREE */
|
||||
return bvh_layout_mask;
|
||||
}
|
||||
|
||||
@ -1065,7 +1065,7 @@ void device_cpu_info(vector<DeviceInfo>& devices)
|
||||
devices.insert(devices.begin(), info);
|
||||
}
|
||||
|
||||
string device_cpu_capabilities(void)
|
||||
string device_cpu_capabilities()
|
||||
{
|
||||
string capabilities = "";
|
||||
capabilities += system_cpu_support_sse2() ? "SSE2 " : "";
|
||||
|
@ -73,12 +73,12 @@ const char *cuewErrorString(CUresult result)
|
||||
return error.c_str();
|
||||
}
|
||||
|
||||
const char *cuewCompilerPath(void)
|
||||
const char *cuewCompilerPath()
|
||||
{
|
||||
return CYCLES_CUDA_NVCC_EXECUTABLE;
|
||||
}
|
||||
|
||||
int cuewCompilerVersion(void)
|
||||
int cuewCompilerVersion()
|
||||
{
|
||||
return (CUDA_VERSION / 100) + (CUDA_VERSION % 100 / 10);
|
||||
}
|
||||
@ -211,7 +211,7 @@ public:
|
||||
/*cuda_abort();*/ \
|
||||
cuda_error_documentation(); \
|
||||
} \
|
||||
} (void)0
|
||||
} (void) 0
|
||||
|
||||
bool cuda_error_(CUresult result, const string& stmt)
|
||||
{
|
||||
@ -2164,7 +2164,7 @@ public:
|
||||
/*cuda_abort();*/ \
|
||||
device->cuda_error_documentation(); \
|
||||
} \
|
||||
} (void)0
|
||||
} (void) 0
|
||||
|
||||
|
||||
/* CUDA context scope. */
|
||||
@ -2373,7 +2373,7 @@ int2 CUDASplitKernel::split_kernel_global_size(device_memory& kg, device_memory&
|
||||
return global_size;
|
||||
}
|
||||
|
||||
bool device_cuda_init(void)
|
||||
bool device_cuda_init()
|
||||
{
|
||||
#ifdef WITH_CUDA_DYNLOAD
|
||||
static bool initialized = false;
|
||||
@ -2411,7 +2411,7 @@ bool device_cuda_init(void)
|
||||
return result;
|
||||
#else /* WITH_CUDA_DYNLOAD */
|
||||
return true;
|
||||
#endif /* WITH_CUDA_DYNLOAD */
|
||||
#endif /* WITH_CUDA_DYNLOAD */
|
||||
}
|
||||
|
||||
Device *device_cuda_create(DeviceInfo& info, Stats &stats, bool background)
|
||||
@ -2515,7 +2515,7 @@ void device_cuda_info(vector<DeviceInfo>& devices)
|
||||
devices.insert(devices.end(), display_devices.begin(), display_devices.end());
|
||||
}
|
||||
|
||||
string device_cuda_capabilities(void)
|
||||
string device_cuda_capabilities()
|
||||
{
|
||||
CUresult result = device_cuda_safe_init();
|
||||
if(result != CUDA_SUCCESS) {
|
||||
@ -2548,7 +2548,7 @@ string device_cuda_capabilities(void)
|
||||
capabilities += string_printf("\t\tCU_DEVICE_ATTRIBUTE_" #attr "\t\t\t%d\n", \
|
||||
value); \
|
||||
} \
|
||||
} (void)0
|
||||
} (void) 0
|
||||
/* TODO(sergey): Strip all attributes which are not useful for us
|
||||
* or does not depend on the driver.
|
||||
*/
|
||||
|
@ -166,4 +166,4 @@ protected:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __DEVICE_DENOISING_H__ */
|
||||
#endif /* __DEVICE_DENOISING_H__ */
|
||||
|
@ -22,9 +22,9 @@ CCL_NAMESPACE_BEGIN
|
||||
class Device;
|
||||
|
||||
Device *device_cpu_create(DeviceInfo& info, Stats &stats, bool background);
|
||||
bool device_opencl_init(void);
|
||||
bool device_opencl_init();
|
||||
Device *device_opencl_create(DeviceInfo& info, Stats &stats, bool background);
|
||||
bool device_cuda_init(void);
|
||||
bool device_cuda_init();
|
||||
Device *device_cuda_create(DeviceInfo& info, Stats &stats, bool background);
|
||||
Device *device_network_create(DeviceInfo& info, Stats &stats, const char *address);
|
||||
Device *device_multi_create(DeviceInfo& info, Stats &stats, bool background);
|
||||
@ -34,10 +34,10 @@ void device_opencl_info(vector<DeviceInfo>& devices);
|
||||
void device_cuda_info(vector<DeviceInfo>& devices);
|
||||
void device_network_info(vector<DeviceInfo>& devices);
|
||||
|
||||
string device_cpu_capabilities(void);
|
||||
string device_opencl_capabilities(void);
|
||||
string device_cuda_capabilities(void);
|
||||
string device_cpu_capabilities();
|
||||
string device_opencl_capabilities();
|
||||
string device_cuda_capabilities();
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __DEVICE_INTERN_H__ */
|
||||
#endif /* __DEVICE_INTERN_H__ */
|
||||
|
@ -21,6 +21,7 @@
|
||||
*
|
||||
* Data types for allocating, copying and freeing device memory. */
|
||||
|
||||
#include "util/util_array.h"
|
||||
#include "util/util_half.h"
|
||||
#include "util/util_texture.h"
|
||||
#include "util/util_types.h"
|
||||
@ -496,4 +497,4 @@ protected:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __DEVICE_MEMORY_H__ */
|
||||
#endif /* __DEVICE_MEMORY_H__ */
|
||||
|
@ -488,4 +488,4 @@ CCL_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __DEVICE_NETWORK_H__ */
|
||||
#endif /* __DEVICE_NETWORK_H__ */
|
||||
|
@ -44,7 +44,7 @@ Device *device_opencl_create(DeviceInfo& info, Stats &stats, bool background)
|
||||
}
|
||||
}
|
||||
|
||||
bool device_opencl_init(void)
|
||||
bool device_opencl_init()
|
||||
{
|
||||
static bool initialized = false;
|
||||
static bool result = false;
|
||||
@ -146,7 +146,7 @@ void device_opencl_info(vector<DeviceInfo>& devices)
|
||||
}
|
||||
}
|
||||
|
||||
string device_opencl_capabilities(void)
|
||||
string device_opencl_capabilities()
|
||||
{
|
||||
if(OpenCLInfo::device_type() == 0) {
|
||||
return "All OpenCL devices are forced to be OFF";
|
||||
@ -245,4 +245,4 @@ string device_opencl_capabilities(void)
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* WITH_OPENCL */
|
||||
#endif /* WITH_OPENCL */
|
||||
|
@ -130,4 +130,4 @@ public:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __DEVICE_SPLIT_KERNEL_H__ */
|
||||
#endif /* __DEVICE_SPLIT_KERNEL_H__ */
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
function<void(long, int)> update_progress_sample;
|
||||
function<void(RenderTile&)> update_tile_sample;
|
||||
function<void(RenderTile&)> release_tile;
|
||||
function<bool(void)> get_cancel;
|
||||
function<bool()> get_cancel;
|
||||
function<void(RenderTile*, Device*)> map_neighbor_tiles;
|
||||
function<void(RenderTile*, Device*)> unmap_neighbor_tiles;
|
||||
|
||||
@ -85,4 +85,4 @@ protected:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __DEVICE_TASK_H__ */
|
||||
#endif /* __DEVICE_TASK_H__ */
|
||||
|
@ -245,7 +245,7 @@ public:
|
||||
(device)->set_error(message); \
|
||||
fprintf(stderr, "%s\n", message.c_str()); \
|
||||
} \
|
||||
} (void)0
|
||||
} (void) 0
|
||||
|
||||
#define opencl_assert(stmt) \
|
||||
{ \
|
||||
@ -257,7 +257,7 @@ public:
|
||||
error_msg = message; \
|
||||
fprintf(stderr, "%s\n", message.c_str()); \
|
||||
} \
|
||||
} (void)0
|
||||
} (void) 0
|
||||
|
||||
class OpenCLDeviceBase : public Device
|
||||
{
|
||||
|
@ -463,4 +463,4 @@ Device *opencl_create_split_device(DeviceInfo& info, Stats& stats, bool backgrou
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* WITH_OPENCL */
|
||||
#endif /* WITH_OPENCL */
|
||||
|
@ -106,7 +106,7 @@ cl_context OpenCLCache::get_context(cl_platform_id platform,
|
||||
|
||||
cl_int ciErr = clRetainContext(slot.context);
|
||||
assert(ciErr == CL_SUCCESS);
|
||||
(void)ciErr;
|
||||
(void) ciErr;
|
||||
|
||||
return slot.context;
|
||||
}
|
||||
@ -153,7 +153,7 @@ cl_program OpenCLCache::get_program(cl_platform_id platform,
|
||||
|
||||
cl_int ciErr = clRetainProgram(entry.program);
|
||||
assert(ciErr == CL_SUCCESS);
|
||||
(void)ciErr;
|
||||
(void) ciErr;
|
||||
|
||||
return entry.program;
|
||||
}
|
||||
@ -188,7 +188,7 @@ void OpenCLCache::store_context(cl_platform_id platform,
|
||||
* The caller is going to release the object when done with it. */
|
||||
cl_int ciErr = clRetainContext(context);
|
||||
assert(ciErr == CL_SUCCESS);
|
||||
(void)ciErr;
|
||||
(void) ciErr;
|
||||
}
|
||||
|
||||
void OpenCLCache::store_program(cl_platform_id platform,
|
||||
@ -227,7 +227,7 @@ void OpenCLCache::store_program(cl_platform_id platform,
|
||||
*/
|
||||
cl_int ciErr = clRetainProgram(program);
|
||||
assert(ciErr == CL_SUCCESS);
|
||||
(void)ciErr;
|
||||
(void) ciErr;
|
||||
}
|
||||
|
||||
string OpenCLCache::get_kernel_md5()
|
||||
|
@ -18,9 +18,9 @@
|
||||
|
||||
#include "graph/node_type.h"
|
||||
|
||||
#include "util/util_array.h"
|
||||
#include "util/util_map.h"
|
||||
#include "util/util_param.h"
|
||||
#include "util/util_vector.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "graph/node_enum.h"
|
||||
|
||||
#include "util/util_array.h"
|
||||
#include "util/util_map.h"
|
||||
#include "util/util_param.h"
|
||||
#include "util/util_string.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
* with CPU/CUDA/OpenCL. */
|
||||
|
||||
#ifdef __EMBREE__
|
||||
#include "kernel/bvh/bvh_embree.h"
|
||||
# include "kernel/bvh/bvh_embree.h"
|
||||
#endif
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
@ -36,9 +36,9 @@ CCL_NAMESPACE_BEGIN
|
||||
/* Common QBVH functions. */
|
||||
#ifdef __QBVH__
|
||||
# include "kernel/bvh/qbvh_nodes.h"
|
||||
#ifdef __KERNEL_AVX2__
|
||||
# include "kernel/bvh/obvh_nodes.h"
|
||||
#endif
|
||||
# ifdef __KERNEL_AVX2__
|
||||
# include "kernel/bvh/obvh_nodes.h"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Regular BVH traversal */
|
||||
@ -190,53 +190,45 @@ ccl_device_intersect bool scene_intersect(KernelGlobals *kg,
|
||||
return false;
|
||||
}
|
||||
#ifdef __EMBREE__
|
||||
if(kernel_data.bvh.scene) {
|
||||
isect->t = ray.t;
|
||||
CCLIntersectContext ctx(kg, CCLIntersectContext::RAY_REGULAR);
|
||||
IntersectContext rtc_ctx(&ctx);
|
||||
RTCRayHit ray_hit;
|
||||
kernel_embree_setup_rayhit(ray, ray_hit, visibility);
|
||||
rtcIntersect1(kernel_data.bvh.scene, &rtc_ctx.context, &ray_hit);
|
||||
if(ray_hit.hit.geomID != RTC_INVALID_GEOMETRY_ID && ray_hit.hit.primID != RTC_INVALID_GEOMETRY_ID) {
|
||||
kernel_embree_convert_hit(kg, &ray_hit.ray, &ray_hit.hit, isect);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if(kernel_data.bvh.scene != NULL) {
|
||||
return embree_scene_intersect(kg, ray, visibility, isect);
|
||||
}
|
||||
#endif /* __EMBREE__ */
|
||||
#endif /* __EMBREE__ */
|
||||
#ifdef __OBJECT_MOTION__
|
||||
if(kernel_data.bvh.have_motion) {
|
||||
# ifdef __HAIR__
|
||||
if(kernel_data.bvh.have_curves)
|
||||
return bvh_intersect_hair_motion(kg, &ray, isect, visibility, lcg_state, difl, extmax);
|
||||
# endif /* __HAIR__ */
|
||||
return bvh_intersect_hair_motion(
|
||||
kg, &ray, isect, visibility, lcg_state, difl, extmax);
|
||||
# endif /* __HAIR__ */
|
||||
|
||||
return bvh_intersect_motion(kg, &ray, isect, visibility);
|
||||
}
|
||||
#endif /* __OBJECT_MOTION__ */
|
||||
#endif /* __OBJECT_MOTION__ */
|
||||
|
||||
#ifdef __HAIR__
|
||||
if(kernel_data.bvh.have_curves)
|
||||
return bvh_intersect_hair(kg, &ray, isect, visibility, lcg_state, difl, extmax);
|
||||
#endif /* __HAIR__ */
|
||||
return bvh_intersect_hair(
|
||||
kg, &ray, isect, visibility, lcg_state, difl, extmax);
|
||||
#endif /* __HAIR__ */
|
||||
|
||||
#ifdef __KERNEL_CPU__
|
||||
|
||||
# ifdef __INSTANCING__
|
||||
if(kernel_data.bvh.have_instancing)
|
||||
return bvh_intersect_instancing(kg, &ray, isect, visibility);
|
||||
# endif /* __INSTANCING__ */
|
||||
# endif /* __INSTANCING__ */
|
||||
|
||||
return bvh_intersect(kg, &ray, isect, visibility);
|
||||
#else /* __KERNEL_CPU__ */
|
||||
#else /* __KERNEL_CPU__ */
|
||||
|
||||
# ifdef __INSTANCING__
|
||||
return bvh_intersect_instancing(kg, &ray, isect, visibility);
|
||||
# else
|
||||
return bvh_intersect(kg, &ray, isect, visibility);
|
||||
# endif /* __INSTANCING__ */
|
||||
# endif /* __INSTANCING__ */
|
||||
|
||||
#endif /* __KERNEL_CPU__ */
|
||||
#endif /* __KERNEL_CPU__ */
|
||||
}
|
||||
|
||||
#ifdef __BVH_LOCAL__
|
||||
@ -252,69 +244,19 @@ ccl_device_intersect bool scene_intersect_local(KernelGlobals *kg,
|
||||
return false;
|
||||
}
|
||||
#ifdef __EMBREE__
|
||||
if(kernel_data.bvh.scene) {
|
||||
CCLIntersectContext ctx(kg, CCLIntersectContext::RAY_SSS);
|
||||
ctx.lcg_state = lcg_state;
|
||||
ctx.max_hits = max_hits;
|
||||
ctx.ss_isect = local_isect;
|
||||
local_isect->num_hits = 0;
|
||||
ctx.sss_object_id = local_object;
|
||||
IntersectContext rtc_ctx(&ctx);
|
||||
RTCRay rtc_ray;
|
||||
kernel_embree_setup_ray(ray, rtc_ray, PATH_RAY_ALL_VISIBILITY);
|
||||
|
||||
/* Get the Embree scene for this intersection. */
|
||||
RTCGeometry geom = rtcGetGeometry(kernel_data.bvh.scene, local_object * 2);
|
||||
if(geom) {
|
||||
float3 P = ray.P;
|
||||
float3 dir = ray.D;
|
||||
float3 idir = ray.D;
|
||||
const int object_flag = kernel_tex_fetch(__object_flag, local_object);
|
||||
if(!(object_flag & SD_OBJECT_TRANSFORM_APPLIED)) {
|
||||
Transform ob_itfm;
|
||||
rtc_ray.tfar = bvh_instance_motion_push(kg,
|
||||
local_object,
|
||||
&ray,
|
||||
&P,
|
||||
&dir,
|
||||
&idir,
|
||||
ray.t,
|
||||
&ob_itfm);
|
||||
/* bvh_instance_motion_push() returns the inverse transform but it's not needed here. */
|
||||
(void)ob_itfm;
|
||||
|
||||
rtc_ray.org_x = P.x;
|
||||
rtc_ray.org_y = P.y;
|
||||
rtc_ray.org_z = P.z;
|
||||
rtc_ray.dir_x = dir.x;
|
||||
rtc_ray.dir_y = dir.y;
|
||||
rtc_ray.dir_z = dir.z;
|
||||
}
|
||||
RTCScene scene = (RTCScene)rtcGetGeometryUserData(geom);
|
||||
if(scene) {
|
||||
rtcOccluded1(scene, &rtc_ctx.context, &rtc_ray);
|
||||
}
|
||||
}
|
||||
|
||||
return local_isect->num_hits > 0;
|
||||
if(kernel_data.bvh.scene != NULL) {
|
||||
return embree_scene_intersect_local(
|
||||
kg, ray, local_isect, local_object, lcg_state, max_hits);
|
||||
}
|
||||
#endif /* __EMBREE__ */
|
||||
#endif /* __EMBREE__ */
|
||||
#ifdef __OBJECT_MOTION__
|
||||
if(kernel_data.bvh.have_motion) {
|
||||
return bvh_intersect_local_motion(kg,
|
||||
&ray,
|
||||
local_isect,
|
||||
local_object,
|
||||
lcg_state,
|
||||
max_hits);
|
||||
return bvh_intersect_local_motion(
|
||||
kg, &ray, local_isect, local_object, lcg_state, max_hits);
|
||||
}
|
||||
#endif /* __OBJECT_MOTION__ */
|
||||
return bvh_intersect_local(kg,
|
||||
&ray,
|
||||
local_isect,
|
||||
local_object,
|
||||
lcg_state,
|
||||
max_hits);
|
||||
#endif /* __OBJECT_MOTION__ */
|
||||
return bvh_intersect_local(
|
||||
kg, &ray, local_isect, local_object, lcg_state, max_hits);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -330,73 +272,41 @@ ccl_device_intersect bool scene_intersect_shadow_all(KernelGlobals *kg,
|
||||
return false;
|
||||
}
|
||||
# ifdef __EMBREE__
|
||||
if(kernel_data.bvh.scene) {
|
||||
CCLIntersectContext ctx(kg, CCLIntersectContext::RAY_SHADOW_ALL);
|
||||
ctx.isect_s = isect;
|
||||
ctx.max_hits = max_hits;
|
||||
ctx.num_hits = 0;
|
||||
IntersectContext rtc_ctx(&ctx);
|
||||
RTCRay rtc_ray;
|
||||
kernel_embree_setup_ray(*ray, rtc_ray, PATH_RAY_SHADOW);
|
||||
rtcOccluded1(kernel_data.bvh.scene, &rtc_ctx.context, &rtc_ray);
|
||||
|
||||
if(ctx.num_hits > max_hits) {
|
||||
return true;
|
||||
}
|
||||
*num_hits = ctx.num_hits;
|
||||
return rtc_ray.tfar == -INFINITY;
|
||||
if(kernel_data.bvh.scene != NULL) {
|
||||
return embree_scene_intersect_shadow_all(
|
||||
kg, ray, isect, max_hits, num_hits);
|
||||
}
|
||||
# endif
|
||||
# ifdef __OBJECT_MOTION__
|
||||
if(kernel_data.bvh.have_motion) {
|
||||
# ifdef __HAIR__
|
||||
if(kernel_data.bvh.have_curves) {
|
||||
return bvh_intersect_shadow_all_hair_motion(kg,
|
||||
ray,
|
||||
isect,
|
||||
visibility,
|
||||
max_hits,
|
||||
num_hits);
|
||||
return bvh_intersect_shadow_all_hair_motion(
|
||||
kg, ray, isect, visibility, max_hits, num_hits);
|
||||
}
|
||||
# endif /* __HAIR__ */
|
||||
# endif /* __HAIR__ */
|
||||
|
||||
return bvh_intersect_shadow_all_motion(kg,
|
||||
ray,
|
||||
isect,
|
||||
visibility,
|
||||
max_hits,
|
||||
num_hits);
|
||||
return bvh_intersect_shadow_all_motion(
|
||||
kg, ray, isect, visibility, max_hits, num_hits);
|
||||
}
|
||||
# endif /* __OBJECT_MOTION__ */
|
||||
# endif /* __OBJECT_MOTION__ */
|
||||
|
||||
# ifdef __HAIR__
|
||||
if(kernel_data.bvh.have_curves) {
|
||||
return bvh_intersect_shadow_all_hair(kg,
|
||||
ray,
|
||||
isect,
|
||||
visibility,
|
||||
max_hits,
|
||||
num_hits);
|
||||
return bvh_intersect_shadow_all_hair(
|
||||
kg, ray, isect, visibility, max_hits, num_hits);
|
||||
}
|
||||
# endif /* __HAIR__ */
|
||||
# endif /* __HAIR__ */
|
||||
|
||||
# ifdef __INSTANCING__
|
||||
if(kernel_data.bvh.have_instancing) {
|
||||
return bvh_intersect_shadow_all_instancing(kg,
|
||||
ray,
|
||||
isect,
|
||||
visibility,
|
||||
max_hits,
|
||||
num_hits);
|
||||
return bvh_intersect_shadow_all_instancing(
|
||||
kg, ray, isect, visibility, max_hits, num_hits);
|
||||
}
|
||||
# endif /* __INSTANCING__ */
|
||||
# endif /* __INSTANCING__ */
|
||||
|
||||
return bvh_intersect_shadow_all(kg,
|
||||
ray,
|
||||
isect,
|
||||
visibility,
|
||||
max_hits,
|
||||
num_hits);
|
||||
return bvh_intersect_shadow_all(
|
||||
kg, ray, isect, visibility, max_hits, num_hits);
|
||||
}
|
||||
#endif /* __SHADOW_RECORD_ALL__ */
|
||||
|
||||
@ -413,20 +323,20 @@ ccl_device_intersect bool scene_intersect_volume(KernelGlobals *kg,
|
||||
if(kernel_data.bvh.have_motion) {
|
||||
return bvh_intersect_volume_motion(kg, ray, isect, visibility);
|
||||
}
|
||||
# endif /* __OBJECT_MOTION__ */
|
||||
# endif /* __OBJECT_MOTION__ */
|
||||
# ifdef __KERNEL_CPU__
|
||||
# ifdef __INSTANCING__
|
||||
if(kernel_data.bvh.have_instancing)
|
||||
return bvh_intersect_volume_instancing(kg, ray, isect, visibility);
|
||||
# endif /* __INSTANCING__ */
|
||||
# endif /* __INSTANCING__ */
|
||||
return bvh_intersect_volume(kg, ray, isect, visibility);
|
||||
# else /* __KERNEL_CPU__ */
|
||||
# else /* __KERNEL_CPU__ */
|
||||
# ifdef __INSTANCING__
|
||||
return bvh_intersect_volume_instancing(kg, ray, isect, visibility);
|
||||
# else
|
||||
return bvh_intersect_volume(kg, ray, isect, visibility);
|
||||
# endif /* __INSTANCING__ */
|
||||
# endif /* __KERNEL_CPU__ */
|
||||
# endif /* __INSTANCING__ */
|
||||
# endif /* __KERNEL_CPU__ */
|
||||
}
|
||||
#endif /* __VOLUME__ */
|
||||
|
||||
@ -441,27 +351,22 @@ ccl_device_intersect uint scene_intersect_volume_all(KernelGlobals *kg,
|
||||
return false;
|
||||
}
|
||||
# ifdef __EMBREE__
|
||||
if(kernel_data.bvh.scene) {
|
||||
CCLIntersectContext ctx(kg, CCLIntersectContext::RAY_VOLUME_ALL);
|
||||
ctx.isect_s = isect;
|
||||
ctx.max_hits = max_hits;
|
||||
ctx.num_hits = 0;
|
||||
IntersectContext rtc_ctx(&ctx);
|
||||
RTCRay rtc_ray;
|
||||
kernel_embree_setup_ray(*ray, rtc_ray, visibility);
|
||||
rtcOccluded1(kernel_data.bvh.scene, &rtc_ctx.context, &rtc_ray);
|
||||
return rtc_ray.tfar == -INFINITY;
|
||||
if(kernel_data.bvh.scene != NULL) {
|
||||
return embree_scene_intersect_volume_all(
|
||||
kg, ray, isect, max_hits, visibility);
|
||||
}
|
||||
# endif
|
||||
# ifdef __OBJECT_MOTION__
|
||||
if(kernel_data.bvh.have_motion) {
|
||||
return bvh_intersect_volume_all_motion(kg, ray, isect, max_hits, visibility);
|
||||
return bvh_intersect_volume_all_motion(
|
||||
kg, ray, isect, max_hits, visibility);
|
||||
}
|
||||
# endif /* __OBJECT_MOTION__ */
|
||||
# endif /* __OBJECT_MOTION__ */
|
||||
# ifdef __INSTANCING__
|
||||
if(kernel_data.bvh.have_instancing)
|
||||
return bvh_intersect_volume_all_instancing(kg, ray, isect, max_hits, visibility);
|
||||
# endif /* __INSTANCING__ */
|
||||
return bvh_intersect_volume_all_instancing(
|
||||
kg, ray, isect, max_hits, visibility);
|
||||
# endif /* __INSTANCING__ */
|
||||
return bvh_intersect_volume_all(kg, ray, isect, max_hits, visibility);
|
||||
}
|
||||
#endif /* __VOLUME_RECORD_ALL__ */
|
||||
|
@ -71,7 +71,9 @@ public:
|
||||
CCLIntersectContext* userRayExt;
|
||||
};
|
||||
|
||||
ccl_device_inline void kernel_embree_setup_ray(const Ray& ray, RTCRay& rtc_ray, const uint visibility)
|
||||
ccl_device_inline void kernel_embree_setup_ray(const Ray& ray,
|
||||
RTCRay& rtc_ray,
|
||||
const uint visibility)
|
||||
{
|
||||
rtc_ray.org_x = ray.P.x;
|
||||
rtc_ray.org_y = ray.P.y;
|
||||
@ -85,14 +87,19 @@ ccl_device_inline void kernel_embree_setup_ray(const Ray& ray, RTCRay& rtc_ray,
|
||||
rtc_ray.mask = visibility;
|
||||
}
|
||||
|
||||
ccl_device_inline void kernel_embree_setup_rayhit(const Ray& ray, RTCRayHit& rayhit, const uint visibility)
|
||||
ccl_device_inline void kernel_embree_setup_rayhit(const Ray& ray,
|
||||
RTCRayHit& rayhit,
|
||||
const uint visibility)
|
||||
{
|
||||
kernel_embree_setup_ray(ray, rayhit.ray, visibility);
|
||||
rayhit.hit.geomID = RTC_INVALID_GEOMETRY_ID;
|
||||
rayhit.hit.primID = RTC_INVALID_GEOMETRY_ID;
|
||||
}
|
||||
|
||||
ccl_device_inline void kernel_embree_convert_hit(KernelGlobals *kg, const RTCRay *ray, const RTCHit *hit, Intersection *isect)
|
||||
ccl_device_inline void kernel_embree_convert_hit(KernelGlobals *kg,
|
||||
const RTCRay *ray,
|
||||
const RTCHit *hit,
|
||||
Intersection *isect)
|
||||
{
|
||||
bool is_hair = hit->geomID & 1;
|
||||
isect->u = is_hair ? hit->u : 1.0f - hit->v - hit->u;
|
||||
@ -100,27 +107,161 @@ ccl_device_inline void kernel_embree_convert_hit(KernelGlobals *kg, const RTCRay
|
||||
isect->t = ray->tfar;
|
||||
isect->Ng = make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z);
|
||||
if(hit->instID[0] != RTC_INVALID_GEOMETRY_ID) {
|
||||
RTCScene inst_scene = (RTCScene)rtcGetGeometryUserData(rtcGetGeometry(kernel_data.bvh.scene, hit->instID[0]));
|
||||
isect->prim = hit->primID + (intptr_t)rtcGetGeometryUserData(rtcGetGeometry(inst_scene, hit->geomID)) + kernel_tex_fetch(__object_node, hit->instID[0]/2);
|
||||
RTCScene inst_scene = (RTCScene)rtcGetGeometryUserData(
|
||||
rtcGetGeometry(kernel_data.bvh.scene, hit->instID[0]));
|
||||
isect->prim = hit->primID + (intptr_t)rtcGetGeometryUserData(
|
||||
rtcGetGeometry(inst_scene, hit->geomID)) +
|
||||
kernel_tex_fetch(__object_node, hit->instID[0]/2);
|
||||
isect->object = hit->instID[0]/2;
|
||||
}
|
||||
else {
|
||||
isect->prim = hit->primID + (intptr_t)rtcGetGeometryUserData(rtcGetGeometry(kernel_data.bvh.scene, hit->geomID));
|
||||
isect->prim = hit->primID + (intptr_t)rtcGetGeometryUserData(
|
||||
rtcGetGeometry(kernel_data.bvh.scene, hit->geomID));
|
||||
isect->object = OBJECT_NONE;
|
||||
}
|
||||
isect->type = kernel_tex_fetch(__prim_type, isect->prim);
|
||||
}
|
||||
|
||||
ccl_device_inline void kernel_embree_convert_local_hit(KernelGlobals *kg, const RTCRay *ray, const RTCHit *hit, Intersection *isect, int local_object_id)
|
||||
ccl_device_inline void kernel_embree_convert_local_hit(KernelGlobals *kg,
|
||||
const RTCRay *ray,
|
||||
const RTCHit *hit,
|
||||
Intersection *isect,
|
||||
int local_object_id)
|
||||
{
|
||||
isect->u = 1.0f - hit->v - hit->u;
|
||||
isect->v = hit->u;
|
||||
isect->t = ray->tfar;
|
||||
isect->Ng = make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z);
|
||||
RTCScene inst_scene = (RTCScene)rtcGetGeometryUserData(rtcGetGeometry(kernel_data.bvh.scene, local_object_id * 2));
|
||||
isect->prim = hit->primID + (intptr_t)rtcGetGeometryUserData(rtcGetGeometry(inst_scene, hit->geomID)) + kernel_tex_fetch(__object_node, local_object_id);
|
||||
RTCScene inst_scene = (RTCScene)rtcGetGeometryUserData(
|
||||
rtcGetGeometry(kernel_data.bvh.scene, local_object_id * 2));
|
||||
isect->prim = hit->primID + (intptr_t)rtcGetGeometryUserData(
|
||||
rtcGetGeometry(inst_scene, hit->geomID)) +
|
||||
kernel_tex_fetch(__object_node, local_object_id);
|
||||
isect->object = local_object_id;
|
||||
isect->type = kernel_tex_fetch(__prim_type, isect->prim);
|
||||
}
|
||||
|
||||
ccl_device_inline bool embree_scene_intersect(KernelGlobals *kg,
|
||||
const Ray *ray,
|
||||
const uint visibility,
|
||||
Intersection *isect)
|
||||
{
|
||||
kernel_assert(kernel_data.bvh.scene != NULL);
|
||||
isect->t = ray->t;
|
||||
CCLIntersectContext ctx(kg, CCLIntersectContext::RAY_REGULAR);
|
||||
IntersectContext rtc_ctx(&ctx);
|
||||
RTCRayHit ray_hit;
|
||||
kernel_embree_setup_rayhit(*ray, ray_hit, visibility);
|
||||
rtcIntersect1(kernel_data.bvh.scene, &rtc_ctx.context, &ray_hit);
|
||||
if(ray_hit.hit.geomID != RTC_INVALID_GEOMETRY_ID &&
|
||||
ray_hit.hit.primID != RTC_INVALID_GEOMETRY_ID)
|
||||
{
|
||||
kernel_embree_convert_hit(kg, &ray_hit.ray, &ray_hit.hit, isect);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef __BVH_LOCAL__
|
||||
ccl_device_inline bool embree_scene_intersect_local(
|
||||
KernelGlobals *kg,
|
||||
const Ray ray,
|
||||
LocalIntersection *local_isect,
|
||||
int local_object,
|
||||
uint *lcg_state,
|
||||
int max_hits)
|
||||
{
|
||||
kernel_assert(kernel_data.bvh.scene != NULL);
|
||||
CCLIntersectContext ctx(kg, CCLIntersectContext::RAY_SSS);
|
||||
ctx.lcg_state = lcg_state;
|
||||
ctx.max_hits = max_hits;
|
||||
ctx.ss_isect = local_isect;
|
||||
local_isect->num_hits = 0;
|
||||
ctx.sss_object_id = local_object;
|
||||
IntersectContext rtc_ctx(&ctx);
|
||||
RTCRay rtc_ray;
|
||||
kernel_embree_setup_ray(ray, rtc_ray, PATH_RAY_ALL_VISIBILITY);
|
||||
/* Get the Embree scene for this intersection. */
|
||||
RTCGeometry geom = rtcGetGeometry(kernel_data.bvh.scene, local_object * 2);
|
||||
if(geom) {
|
||||
float3 P = ray.P;
|
||||
float3 dir = ray.D;
|
||||
float3 idir = ray.D;
|
||||
const int object_flag = kernel_tex_fetch(__object_flag, local_object);
|
||||
if(!(object_flag & SD_OBJECT_TRANSFORM_APPLIED)) {
|
||||
Transform ob_itfm;
|
||||
rtc_ray.tfar = bvh_instance_motion_push(kg,
|
||||
local_object,
|
||||
&ray,
|
||||
&P,
|
||||
&dir,
|
||||
&idir,
|
||||
ray.t,
|
||||
&ob_itfm);
|
||||
/* bvh_instance_motion_push() returns the inverse transform but
|
||||
* it's not needed here. */
|
||||
(void) ob_itfm;
|
||||
|
||||
rtc_ray.org_x = P.x;
|
||||
rtc_ray.org_y = P.y;
|
||||
rtc_ray.org_z = P.z;
|
||||
rtc_ray.dir_x = dir.x;
|
||||
rtc_ray.dir_y = dir.y;
|
||||
rtc_ray.dir_z = dir.z;
|
||||
}
|
||||
RTCScene scene = (RTCScene)rtcGetGeometryUserData(geom);
|
||||
if(scene) {
|
||||
rtcOccluded1(scene, &rtc_ctx.context, &rtc_ray);
|
||||
}
|
||||
}
|
||||
return local_isect->num_hits > 0;
|
||||
}
|
||||
#endif /* __BVH_LOCAL__ */
|
||||
|
||||
#ifdef __SHADOW_RECORD_ALL__
|
||||
ccl_device_inline bool embree_scene_intersect_shadow_all(
|
||||
KernelGlobals *kg,
|
||||
const Ray *ray,
|
||||
Intersection *isect,
|
||||
uint max_hits,
|
||||
uint *num_hits)
|
||||
{
|
||||
kernel_assert(kernel_data.bvh.scene != NULL);
|
||||
CCLIntersectContext ctx(kg, CCLIntersectContext::RAY_SHADOW_ALL);
|
||||
ctx.isect_s = isect;
|
||||
ctx.max_hits = max_hits;
|
||||
ctx.num_hits = 0;
|
||||
IntersectContext rtc_ctx(&ctx);
|
||||
RTCRay rtc_ray;
|
||||
kernel_embree_setup_ray(*ray, rtc_ray, PATH_RAY_SHADOW);
|
||||
rtcOccluded1(kernel_data.bvh.scene, &rtc_ctx.context, &rtc_ray);
|
||||
if(ctx.num_hits > max_hits) {
|
||||
return true;
|
||||
}
|
||||
*num_hits = ctx.num_hits;
|
||||
return rtc_ray.tfar == -INFINITY;
|
||||
}
|
||||
#endif /* __SHADOW_RECORD_ALL__ */
|
||||
|
||||
#ifdef __VOLUME_RECORD_ALL__
|
||||
ccl_device_inline uint embree_scene_intersect_volume_all(
|
||||
KernelGlobals *kg,
|
||||
const Ray *ray,
|
||||
Intersection *isect,
|
||||
const uint max_hits,
|
||||
const uint visibility)
|
||||
{
|
||||
kernel_assert(kernel_data.bvh.scene != NULL);
|
||||
CCLIntersectContext ctx(kg, CCLIntersectContext::RAY_VOLUME_ALL);
|
||||
ctx.isect_s = isect;
|
||||
ctx.max_hits = max_hits;
|
||||
ctx.num_hits = 0;
|
||||
IntersectContext rtc_ctx(&ctx);
|
||||
RTCRay rtc_ray;
|
||||
kernel_embree_setup_ray(*ray, rtc_ray, visibility);
|
||||
rtcOccluded1(kernel_data.bvh.scene, &rtc_ctx.context, &rtc_ray);
|
||||
return rtc_ray.tfar == -INFINITY;
|
||||
}
|
||||
#endif /* __VOLUME_RECORD_ALL__ */
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
@ -136,7 +136,7 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
node_addr,
|
||||
PATH_RAY_ALL_VISIBILITY,
|
||||
dist);
|
||||
#else // __KERNEL_SSE2__
|
||||
#else // __KERNEL_SSE2__
|
||||
traverse_mask = NODE_INTERSECT(kg,
|
||||
P,
|
||||
dir,
|
||||
@ -151,7 +151,7 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
node_addr,
|
||||
PATH_RAY_ALL_VISIBILITY,
|
||||
dist);
|
||||
#endif // __KERNEL_SSE2__
|
||||
#endif // __KERNEL_SSE2__
|
||||
|
||||
node_addr = __float_as_int(cnodes.z);
|
||||
node_addr_child1 = __float_as_int(cnodes.w);
|
||||
|
@ -124,7 +124,7 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
node_addr,
|
||||
visibility,
|
||||
dist);
|
||||
#else // __KERNEL_SSE2__
|
||||
#else // __KERNEL_SSE2__
|
||||
traverse_mask = NODE_INTERSECT(kg,
|
||||
P,
|
||||
dir,
|
||||
@ -139,7 +139,7 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
node_addr,
|
||||
visibility,
|
||||
dist);
|
||||
#endif // __KERNEL_SSE2__
|
||||
#endif // __KERNEL_SSE2__
|
||||
|
||||
node_addr = __float_as_int(cnodes.z);
|
||||
node_addr_child1 = __float_as_int(cnodes.w);
|
||||
|
@ -146,7 +146,7 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
visibility,
|
||||
dist);
|
||||
}
|
||||
#else // __KERNEL_SSE2__
|
||||
#else // __KERNEL_SSE2__
|
||||
# if BVH_FEATURE(BVH_HAIR_MINIMUM_WIDTH)
|
||||
if(difl != 0.0f) {
|
||||
traverse_mask = NODE_INTERSECT_ROBUST(kg,
|
||||
@ -184,7 +184,7 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
visibility,
|
||||
dist);
|
||||
}
|
||||
#endif // __KERNEL_SSE2__
|
||||
#endif // __KERNEL_SSE2__
|
||||
|
||||
node_addr = __float_as_int(cnodes.z);
|
||||
node_addr_child1 = __float_as_int(cnodes.w);
|
||||
|
@ -120,7 +120,7 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
node_addr,
|
||||
visibility,
|
||||
dist);
|
||||
#else // __KERNEL_SSE2__
|
||||
#else // __KERNEL_SSE2__
|
||||
traverse_mask = NODE_INTERSECT(kg,
|
||||
P,
|
||||
dir,
|
||||
@ -135,7 +135,7 @@ bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
node_addr,
|
||||
visibility,
|
||||
dist);
|
||||
#endif // __KERNEL_SSE2__
|
||||
#endif // __KERNEL_SSE2__
|
||||
|
||||
node_addr = __float_as_int(cnodes.z);
|
||||
node_addr_child1 = __float_as_int(cnodes.w);
|
||||
|
@ -124,7 +124,7 @@ uint BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
node_addr,
|
||||
visibility,
|
||||
dist);
|
||||
#else // __KERNEL_SSE2__
|
||||
#else // __KERNEL_SSE2__
|
||||
traverse_mask = NODE_INTERSECT(kg,
|
||||
P,
|
||||
dir,
|
||||
@ -139,7 +139,7 @@ uint BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals *kg,
|
||||
node_addr,
|
||||
visibility,
|
||||
dist);
|
||||
#endif // __KERNEL_SSE2__
|
||||
#endif // __KERNEL_SSE2__
|
||||
|
||||
node_addr = __float_as_int(cnodes.z);
|
||||
node_addr_child1 = __float_as_int(cnodes.w);
|
||||
|
@ -97,7 +97,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg,
|
||||
/* Traverse internal nodes. */
|
||||
while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) {
|
||||
float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0);
|
||||
(void)inodes;
|
||||
(void) inodes;
|
||||
|
||||
if(false
|
||||
#ifdef __VISIBILITY_FLAG__
|
||||
|
@ -97,7 +97,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(OBVH)(KernelGlobals *kg,
|
||||
/* Traverse internal nodes. */
|
||||
while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) {
|
||||
float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0);
|
||||
(void)inodes;
|
||||
(void) inodes;
|
||||
|
||||
if(UNLIKELY(node_dist > isect->t)
|
||||
#if BVH_FEATURE(BVH_MOTION)
|
||||
|
@ -98,7 +98,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
|
||||
/* Traverse internal nodes. */
|
||||
while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) {
|
||||
float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0);
|
||||
(void)inodes;
|
||||
(void) inodes;
|
||||
|
||||
if(false
|
||||
#ifdef __VISIBILITY_FLAG__
|
||||
|
@ -106,7 +106,7 @@ ccl_device bool BVH_FUNCTION_FULL_NAME(QBVH)(KernelGlobals *kg,
|
||||
/* Traverse internal nodes. */
|
||||
while(node_addr >= 0 && node_addr != ENTRYPOINT_SENTINEL) {
|
||||
float4 inodes = kernel_tex_fetch(__bvh_nodes, node_addr+0);
|
||||
(void)inodes;
|
||||
(void) inodes;
|
||||
|
||||
if(UNLIKELY(node_dist > isect->t)
|
||||
#if BVH_FEATURE(BVH_MOTION)
|
||||
|
@ -232,4 +232,4 @@ ccl_device int bsdf_ashikhmin_shirley_sample(const ShaderClosure *sc, float3 Ng,
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_ASHIKHMIN_SHIRLEY_H__ */
|
||||
#endif /* __BSDF_ASHIKHMIN_SHIRLEY_H__ */
|
||||
|
@ -158,4 +158,4 @@ ccl_device int bsdf_ashikhmin_velvet_sample(const ShaderClosure *sc, float3 Ng,
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_ASHIKHMIN_VELVET_H__ */
|
||||
#endif /* __BSDF_ASHIKHMIN_VELVET_H__ */
|
||||
|
@ -139,4 +139,4 @@ ccl_device int bsdf_translucent_sample(const ShaderClosure *sc, float3 Ng, float
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_DIFFUSE_H__ */
|
||||
#endif /* __BSDF_DIFFUSE_H__ */
|
||||
|
@ -103,8 +103,8 @@ ccl_device int bsdf_diffuse_ramp_sample(const ShaderClosure *sc, float3 Ng, floa
|
||||
return LABEL_REFLECT|LABEL_DIFFUSE;
|
||||
}
|
||||
|
||||
#endif /* __OSL__ */
|
||||
#endif /* __OSL__ */
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_DIFFUSE_RAMP_H__ */
|
||||
#endif /* __BSDF_DIFFUSE_RAMP_H__ */
|
||||
|
@ -277,4 +277,4 @@ ccl_device int bsdf_hair_transmission_sample(const ShaderClosure *sc, float3 Ng,
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_HAIR_H__ */
|
||||
#endif /* __BSDF_HAIR_H__ */
|
||||
|
@ -229,7 +229,7 @@ ccl_device int bsdf_principled_hair_setup(ShaderData *sd, PrincipledHairBSDF *bs
|
||||
return SD_BSDF|SD_BSDF_HAS_EVAL|SD_BSDF_NEEDS_LCG;
|
||||
}
|
||||
|
||||
#endif /* __HAIR__ */
|
||||
#endif /* __HAIR__ */
|
||||
|
||||
/* Given the Fresnel term and transmittance, generate the attenuation terms for each bounce. */
|
||||
ccl_device_inline void hair_attenuation(KernelGlobals *kg,
|
||||
@ -499,4 +499,4 @@ ccl_device void bsdf_principled_hair_blur(ShaderClosure *sc, float roughness)
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_HAIR_PRINCIPLED_H__ */
|
||||
#endif /* __BSDF_HAIR_PRINCIPLED_H__ */
|
||||
|
@ -1124,4 +1124,4 @@ ccl_device int bsdf_microfacet_beckmann_sample(KernelGlobals *kg, const ShaderCl
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_MICROFACET_H__ */
|
||||
#endif /* __BSDF_MICROFACET_H__ */
|
||||
|
@ -76,7 +76,7 @@ ccl_device_forceinline float3 MF_FUNCTION_FULL_NAME(mf_eval)(
|
||||
eval *= -lambda_r / (shadowing_lambda - lambda_r);
|
||||
else
|
||||
eval *= -lambda_r * beta(-lambda_r, shadowing_lambda+1.0f);
|
||||
#else /* MF_MULTI_GLOSSY */
|
||||
#else /* MF_MULTI_GLOSSY */
|
||||
const float G2 = 1.0f / (1.0f - (lambda_r + 1.0f) + shadowing_lambda);
|
||||
float val = G2 * 0.25f / wi.z;
|
||||
if(alpha.x == alpha.y)
|
||||
@ -129,7 +129,7 @@ ccl_device_forceinline float3 MF_FUNCTION_FULL_NAME(mf_eval)(
|
||||
phase = mf_eval_phase_glass(wr, lambda_r, wo, wo_outside, alpha, eta);
|
||||
else
|
||||
phase = mf_eval_phase_glass(wr, lambda_r, -wo, !wo_outside, alpha, 1.0f/eta);
|
||||
#else /* MF_MULTI_GLOSSY */
|
||||
#else /* MF_MULTI_GLOSSY */
|
||||
phase = mf_eval_phase_glossy(wr, lambda_r, wo, alpha) * throughput;
|
||||
#endif
|
||||
eval += throughput * phase * mf_G1(wo_outside? wo: -wo, mf_C1((outside == wo_outside)? hr: -hr), shadowing_lambda);
|
||||
@ -153,7 +153,7 @@ ccl_device_forceinline float3 MF_FUNCTION_FULL_NAME(mf_eval)(
|
||||
else if(use_fresnel && order > 0) {
|
||||
throughput *= interpolate_fresnel_color(wi_prev, wm, eta, F0, cspec0);
|
||||
}
|
||||
#else /* MF_MULTI_GLOSSY */
|
||||
#else /* MF_MULTI_GLOSSY */
|
||||
if(use_fresnel && order > 0) {
|
||||
throughput *= interpolate_fresnel_color(-wr, wm, eta, F0, cspec0);
|
||||
}
|
||||
@ -248,7 +248,7 @@ ccl_device_forceinline float3 MF_FUNCTION_FULL_NAME(mf_sample)(
|
||||
throughput *= t_color;
|
||||
}
|
||||
}
|
||||
#else /* MF_MULTI_GLOSSY */
|
||||
#else /* MF_MULTI_GLOSSY */
|
||||
if(use_fresnel) {
|
||||
float3 t_color = interpolate_fresnel_color(-wr, wm, eta, F0, cspec0);
|
||||
|
||||
|
@ -108,4 +108,4 @@ ccl_device int bsdf_oren_nayar_sample(const ShaderClosure *sc, float3 Ng, float3
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_OREN_NAYAR_H__ */
|
||||
#endif /* __BSDF_OREN_NAYAR_H__ */
|
||||
|
@ -135,8 +135,8 @@ ccl_device int bsdf_phong_ramp_sample(const ShaderClosure *sc, float3 Ng, float3
|
||||
return LABEL_REFLECT|LABEL_GLOSSY;
|
||||
}
|
||||
|
||||
#endif /* __OSL__ */
|
||||
#endif /* __OSL__ */
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_PHONG_RAMP_H__ */
|
||||
#endif /* __BSDF_PHONG_RAMP_H__ */
|
||||
|
@ -122,4 +122,4 @@ ccl_device int bsdf_principled_diffuse_sample(const ShaderClosure *sc,
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_PRINCIPLED_DIFFUSE_H__ */
|
||||
#endif /* __BSDF_PRINCIPLED_DIFFUSE_H__ */
|
||||
|
@ -108,4 +108,4 @@ ccl_device int bsdf_principled_sheen_sample(const ShaderClosure *sc,
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_PRINCIPLED_SHEEN_H__ */
|
||||
#endif /* __BSDF_PRINCIPLED_SHEEN_H__ */
|
||||
|
@ -77,4 +77,4 @@ ccl_device int bsdf_reflection_sample(const ShaderClosure *sc, float3 Ng, float3
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_REFLECTION_H__ */
|
||||
#endif /* __BSDF_REFLECTION_H__ */
|
||||
|
@ -86,4 +86,4 @@ ccl_device int bsdf_refraction_sample(const ShaderClosure *sc, float3 Ng, float3
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_REFRACTION_H__ */
|
||||
#endif /* __BSDF_REFRACTION_H__ */
|
||||
|
@ -215,4 +215,4 @@ ccl_device int bsdf_glossy_toon_sample(const ShaderClosure *sc, float3 Ng, float
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_TOON_H__ */
|
||||
#endif /* __BSDF_TOON_H__ */
|
||||
|
@ -106,4 +106,4 @@ ccl_device int bsdf_transparent_sample(const ShaderClosure *sc, float3 Ng, float
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_TRANSPARENT_H__ */
|
||||
#endif /* __BSDF_TRANSPARENT_H__ */
|
||||
|
@ -158,4 +158,4 @@ ccl_device_forceinline float3 interpolate_fresnel_color(float3 L, float3 H, floa
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __BSDF_UTIL_H__ */
|
||||
#endif /* __BSDF_UTIL_H__ */
|
||||
|
@ -499,4 +499,4 @@ ccl_device_forceinline float bssrdf_pdf(const ShaderClosure *sc, float r)
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __KERNEL_BSSRDF_H__ */
|
||||
#endif /* __KERNEL_BSSRDF_H__ */
|
||||
|
@ -49,4 +49,4 @@ CCL_NAMESPACE_BEGIN
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __FILTER_H__ */
|
||||
#endif /* __FILTER_H__ */
|
||||
|
@ -68,4 +68,4 @@ typedef struct TileInfo {
|
||||
# define ccl_get_tile_buffer(id) (tile_info->buffers[id])
|
||||
#endif
|
||||
|
||||
#endif /* __FILTER_DEFINES_H__*/
|
||||
#endif /* __FILTER_DEFINES_H__*/
|
||||
|
@ -379,7 +379,7 @@ ccl_device_forceinline bool cardinal_curve_intersect(
|
||||
float inv_mw_extension = 1.0f/mw_extension;
|
||||
if(d0 >= 0)
|
||||
coverage = (min(d1 * inv_mw_extension, 1.0f) - min(d0 * inv_mw_extension, 1.0f)) * 0.5f;
|
||||
else // inside
|
||||
else // inside
|
||||
coverage = (min(d1 * inv_mw_extension, 1.0f) + min(-d0 * inv_mw_extension, 1.0f)) * 0.5f;
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ ccl_device_noinline float subd_triangle_attribute_float(KernelGlobals *kg, const
|
||||
return a;
|
||||
}
|
||||
else
|
||||
#endif /* __PATCH_EVAL__ */
|
||||
#endif /* __PATCH_EVAL__ */
|
||||
if(desc.element == ATTR_ELEMENT_FACE) {
|
||||
if(dx) *dx = 0.0f;
|
||||
if(dy) *dy = 0.0f;
|
||||
@ -271,7 +271,7 @@ ccl_device_noinline float3 subd_triangle_attribute_float3(KernelGlobals *kg, con
|
||||
return a;
|
||||
}
|
||||
else
|
||||
#endif /* __PATCH_EVAL__ */
|
||||
#endif /* __PATCH_EVAL__ */
|
||||
if(desc.element == ATTR_ELEMENT_FACE) {
|
||||
if(dx) *dx = make_float3(0.0f, 0.0f, 0.0f);
|
||||
if(dy) *dy = make_float3(0.0f, 0.0f, 0.0f);
|
||||
|
@ -544,7 +544,7 @@ int triangle_intersect8(KernelGlobals *kg,
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* __KERNEL_AVX2__ */
|
||||
#endif /* __KERNEL_AVX2__ */
|
||||
|
||||
/* Special ray intersection routines for subsurface scattering. In that case we
|
||||
* only want to intersect with primitives in the same object, and if case of
|
||||
|
@ -63,4 +63,4 @@ void kernel_tex_copy(KernelGlobals *kg,
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __KERNEL_H__ */
|
||||
#endif /* __KERNEL_H__ */
|
||||
|
@ -35,4 +35,4 @@ ccl_device float linear_rgb_to_gray(KernelGlobals *kg, float3 c)
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __KERNEL_COLOR_H__ */
|
||||
#endif /* __KERNEL_COLOR_H__ */
|
||||
|
@ -153,4 +153,4 @@ typedef vector3<avxf> avx3f;
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __KERNEL_COMPAT_CPU_H__ */
|
||||
#endif /* __KERNEL_COMPAT_CPU_H__ */
|
||||
|
@ -150,4 +150,4 @@ ccl_device_inline uint ccl_num_groups(uint d)
|
||||
#define logf(x) __logf(((float)(x)))
|
||||
#define expf(x) __expf(((float)(x)))
|
||||
|
||||
#endif /* __KERNEL_COMPAT_CUDA_H__ */
|
||||
#endif /* __KERNEL_COMPAT_CUDA_H__ */
|
||||
|
@ -159,4 +159,4 @@
|
||||
#include "util/util_half.h"
|
||||
#include "util/util_types.h"
|
||||
|
||||
#endif /* __KERNEL_COMPAT_OPENCL_H__ */
|
||||
#endif /* __KERNEL_COMPAT_OPENCL_H__ */
|
||||
|
@ -43,7 +43,7 @@ ccl_device_inline void kernel_write_id_slots(ccl_global float *buffer, int num_s
|
||||
atomic_add_and_fetch_float(buffer+slot*2+1, weight);
|
||||
break;
|
||||
}
|
||||
#else /* __ATOMIC_PASS_WRITE__ */
|
||||
#else /* __ATOMIC_PASS_WRITE__ */
|
||||
/* If the loop reaches an empty slot, the ID isn't in any slot yet - so add it! */
|
||||
if(id_buffer[slot].x == ID_NONE) {
|
||||
id_buffer[slot].x = id;
|
||||
@ -56,7 +56,7 @@ ccl_device_inline void kernel_write_id_slots(ccl_global float *buffer, int num_s
|
||||
id_buffer[slot].y += weight;
|
||||
break;
|
||||
}
|
||||
#endif /* __ATOMIC_PASS_WRITE__ */
|
||||
#endif /* __ATOMIC_PASS_WRITE__ */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,4 +25,4 @@
|
||||
#include "util/util_texture.h"
|
||||
#include "util/util_transform.h"
|
||||
|
||||
#endif /* __KERNEL_MATH_H__ */
|
||||
#endif /* __KERNEL_MATH_H__ */
|
||||
|
@ -282,4 +282,4 @@ ccl_device float3 ensure_valid_reflection(float3 Ng, float3 I, float3 N)
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __KERNEL_MONTECARLO_CL__ */
|
||||
#endif /* __KERNEL_MONTECARLO_CL__ */
|
||||
|
@ -110,7 +110,7 @@ ccl_device_inline void kernel_write_denoising_shadow(KernelGlobals *kg, ccl_glob
|
||||
float value = path_total_shaded / max(path_total, 1e-7f);
|
||||
kernel_write_pass_float(buffer+2, value*value);
|
||||
}
|
||||
#endif /* __DENOISING_FEATURES__ */
|
||||
#endif /* __DENOISING_FEATURES__ */
|
||||
|
||||
ccl_device_inline void kernel_update_denoising_features(KernelGlobals *kg,
|
||||
ShaderData *sd,
|
||||
@ -189,7 +189,7 @@ ccl_device_inline void kernel_write_debug_passes(KernelGlobals *kg,
|
||||
L->debug_data.num_ray_bounces);
|
||||
}
|
||||
}
|
||||
#endif /* __KERNEL_DEBUG__ */
|
||||
#endif /* __KERNEL_DEBUG__ */
|
||||
|
||||
#ifdef __KERNEL_CPU__
|
||||
#define WRITE_ID_SLOT(buffer, depth, id, matte_weight, name) kernel_write_id_pass_cpu(buffer, depth * 2, id, matte_weight, kg->coverage_##name)
|
||||
@ -199,11 +199,11 @@ ccl_device_inline size_t kernel_write_id_pass_cpu(float *buffer, size_t depth, f
|
||||
(*map)[id] += matte_weight;
|
||||
return 0;
|
||||
}
|
||||
#else /* __KERNEL_CPU__ */
|
||||
#else /* __KERNEL_CPU__ */
|
||||
#define WRITE_ID_SLOT(buffer, depth, id, matte_weight, name) kernel_write_id_slots_gpu(buffer, depth * 2, id, matte_weight)
|
||||
ccl_device_inline size_t kernel_write_id_slots_gpu(ccl_global float *buffer, size_t depth, float id, float matte_weight)
|
||||
{
|
||||
#endif /* __KERNEL_CPU__ */
|
||||
#endif /* __KERNEL_CPU__ */
|
||||
kernel_write_id_slots(buffer, depth, id, matte_weight);
|
||||
return depth * 2;
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ ccl_device_forceinline VolumeIntegrateResult kernel_path_volume(
|
||||
}
|
||||
#endif /* __VOLUME__ */
|
||||
|
||||
#endif /* __SPLIT_KERNEL__ */
|
||||
#endif /* __SPLIT_KERNEL__ */
|
||||
|
||||
ccl_device_forceinline bool kernel_path_shader_apply(
|
||||
KernelGlobals *kg,
|
||||
@ -434,7 +434,7 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg,
|
||||
else if(result == VOLUME_PATH_MISSED) {
|
||||
break;
|
||||
}
|
||||
#endif /* __VOLUME__*/
|
||||
#endif /* __VOLUME__*/
|
||||
|
||||
/* Shade background. */
|
||||
if(!hit) {
|
||||
@ -557,7 +557,7 @@ ccl_device void kernel_path_indirect(KernelGlobals *kg,
|
||||
#endif /* __SUBSURFACE__ */
|
||||
}
|
||||
|
||||
#endif /* defined(__BRANCHED_PATH__) || defined(__BAKING__) */
|
||||
#endif /* defined(__BRANCHED_PATH__) || defined(__BAKING__) */
|
||||
|
||||
ccl_device_forceinline void kernel_path_integrate(
|
||||
KernelGlobals *kg,
|
||||
@ -605,7 +605,7 @@ ccl_device_forceinline void kernel_path_integrate(
|
||||
else if(result == VOLUME_PATH_MISSED) {
|
||||
break;
|
||||
}
|
||||
#endif /* __VOLUME__*/
|
||||
#endif /* __VOLUME__*/
|
||||
|
||||
/* Shade background. */
|
||||
if(!hit) {
|
||||
|
@ -55,7 +55,7 @@ ccl_device_inline void kernel_path_volume_connect_light(
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* __EMISSION__ */
|
||||
#endif /* __EMISSION__ */
|
||||
}
|
||||
|
||||
#ifdef __KERNEL_GPU__
|
||||
@ -277,10 +277,10 @@ ccl_device void kernel_branched_path_volume_connect_light(
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* __EMISSION__ */
|
||||
#endif /* __EMISSION__ */
|
||||
}
|
||||
#endif /* __SPLIT_KERNEL__ */
|
||||
#endif /* __SPLIT_KERNEL__ */
|
||||
|
||||
#endif /* __VOLUME_SCATTER__ */
|
||||
#endif /* __VOLUME_SCATTER__ */
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
@ -145,4 +145,4 @@ ccl_device int dequeue_ray_index(
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif // __KERNEL_QUEUE_H__
|
||||
#endif // __KERNEL_QUEUE_H__
|
||||
|
@ -50,7 +50,7 @@ ccl_device uint sobol_dimension(KernelGlobals *kg, int index, int dimension)
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* __SOBOL__ */
|
||||
#endif /* __SOBOL__ */
|
||||
|
||||
|
||||
ccl_device_forceinline float path_rng_1D(KernelGlobals *kg,
|
||||
|
@ -446,7 +446,7 @@ ccl_device bool shadow_blocked_transparent_stepped(
|
||||
}
|
||||
|
||||
# endif /* __KERNEL_GPU__ || !__SHADOW_RECORD_ALL__ */
|
||||
#endif /* __TRANSPARENT_SHADOWS__ */
|
||||
#endif /* __TRANSPARENT_SHADOWS__ */
|
||||
|
||||
ccl_device_inline bool shadow_blocked(KernelGlobals *kg,
|
||||
ShaderData *sd,
|
||||
|
@ -615,7 +615,7 @@ typedef ccl_addr_space struct PathRadiance {
|
||||
|
||||
#ifdef __KERNEL_DEBUG__
|
||||
DebugData debug_data;
|
||||
#endif /* __KERNEL_DEBUG__ */
|
||||
#endif /* __KERNEL_DEBUG__ */
|
||||
} PathRadiance;
|
||||
|
||||
typedef struct BsdfEval {
|
||||
@ -1705,4 +1705,4 @@ typedef struct WorkTile {
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __KERNEL_TYPES_H__ */
|
||||
#endif /* __KERNEL_TYPES_H__ */
|
||||
|
@ -87,7 +87,7 @@ ccl_device_inline bool volume_shader_sample(KernelGlobals *kg,
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* __VOLUME__ */
|
||||
#endif /* __VOLUME__ */
|
||||
|
||||
ccl_device float3 volume_color_transmittance(float3 sigma, float t)
|
||||
{
|
||||
@ -270,7 +270,7 @@ ccl_device_noinline void kernel_volume_shadow(KernelGlobals *kg,
|
||||
kernel_volume_shadow_homogeneous(kg, state, ray, shadow_sd, throughput);
|
||||
}
|
||||
|
||||
#endif /* __VOLUME__ */
|
||||
#endif /* __VOLUME__ */
|
||||
|
||||
/* Equi-angular sampling as in:
|
||||
* "Importance Sampling Techniques for Path Tracing in Participating Media" */
|
||||
@ -1075,7 +1075,7 @@ ccl_device VolumeIntegrateResult kernel_volume_decoupled_scatter(
|
||||
|
||||
return VOLUME_PATH_SCATTERED;
|
||||
}
|
||||
#endif /* __SPLIT_KERNEL */
|
||||
#endif /* __SPLIT_KERNEL */
|
||||
|
||||
/* decide if we need to use decoupled or not */
|
||||
ccl_device bool kernel_volume_use_decoupled(KernelGlobals *kg, bool heterogeneous, bool direct, int sampling_method)
|
||||
@ -1377,6 +1377,6 @@ ccl_device_inline void kernel_volume_clean_stack(KernelGlobals *kg,
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* __VOLUME__ */
|
||||
#endif /* __VOLUME__ */
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
@ -26,7 +26,7 @@ template<typename T> struct TextureInterpolator {
|
||||
u[1] = (( 0.5f * t - 1.0f) * t ) * t + (2.0f/3.0f); \
|
||||
u[2] = (( -0.5f * t + 0.5f) * t + 0.5f) * t + (1.0f/6.0f); \
|
||||
u[3] = (1.0f / 6.0f) * t * t * t; \
|
||||
} (void)0
|
||||
} (void) 0
|
||||
|
||||
static ccl_always_inline float4 read(float4 r)
|
||||
{
|
||||
@ -540,4 +540,4 @@ ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals *kg, int id, float x,
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif // __KERNEL_CPU_IMAGE_H__
|
||||
#endif // __KERNEL_CPU_IMAGE_H__
|
||||
|
@ -97,7 +97,7 @@ void KERNEL_FUNCTION_FULL_NAME(path_trace)(KernelGlobals *kg,
|
||||
{
|
||||
kernel_path_trace(kg, buffer, sample, x, y, offset, stride);
|
||||
}
|
||||
#endif /* KERNEL_STUB */
|
||||
#endif /* KERNEL_STUB */
|
||||
}
|
||||
|
||||
/* Film */
|
||||
@ -120,7 +120,7 @@ void KERNEL_FUNCTION_FULL_NAME(convert_to_byte)(KernelGlobals *kg,
|
||||
x, y,
|
||||
offset,
|
||||
stride);
|
||||
#endif /* KERNEL_STUB */
|
||||
#endif /* KERNEL_STUB */
|
||||
}
|
||||
|
||||
void KERNEL_FUNCTION_FULL_NAME(convert_to_half_float)(KernelGlobals *kg,
|
||||
@ -141,7 +141,7 @@ void KERNEL_FUNCTION_FULL_NAME(convert_to_half_float)(KernelGlobals *kg,
|
||||
x, y,
|
||||
offset,
|
||||
stride);
|
||||
#endif /* KERNEL_STUB */
|
||||
#endif /* KERNEL_STUB */
|
||||
}
|
||||
|
||||
/* Shader Evaluate */
|
||||
@ -176,7 +176,7 @@ void KERNEL_FUNCTION_FULL_NAME(shader)(KernelGlobals *kg,
|
||||
else {
|
||||
kernel_background_evaluate(kg, input, output, i);
|
||||
}
|
||||
#endif /* KERNEL_STUB */
|
||||
#endif /* KERNEL_STUB */
|
||||
}
|
||||
|
||||
#else /* __SPLIT_KERNEL__ */
|
||||
@ -208,7 +208,7 @@ void KERNEL_FUNCTION_FULL_NAME(shader)(KernelGlobals *kg,
|
||||
ccl_local type locals; \
|
||||
kernel_##name(kg, &locals); \
|
||||
}
|
||||
#endif /* KERNEL_STUB */
|
||||
#endif /* KERNEL_STUB */
|
||||
|
||||
DEFINE_SPLIT_KERNEL_FUNCTION(path_init)
|
||||
DEFINE_SPLIT_KERNEL_FUNCTION(scene_intersect)
|
||||
|
@ -142,7 +142,7 @@ ccl_device_inline float svm_image_texture_frac(float x, int *ix)
|
||||
u[1] = (( 0.5f * t - 1.0f) * t ) * t + (2.0f/3.0f); \
|
||||
u[2] = (( -0.5f * t + 0.5f) * t + 0.5f) * t + (1.0f/6.0f); \
|
||||
u[3] = (1.0f / 6.0f) * t * t * t; \
|
||||
} (void)0
|
||||
} (void) 0
|
||||
|
||||
ccl_device float4 kernel_tex_image_interp(KernelGlobals *kg, int id, float x, float y)
|
||||
{
|
||||
|
@ -146,4 +146,4 @@ CCLOSURE_PREPARE_STATIC(bsdf_##lower##_prepare, Upper##Closure)
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __OSL_CLOSURES_H__ */
|
||||
#endif /* __OSL_CLOSURES_H__ */
|
||||
|
@ -94,4 +94,4 @@ CCL_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __OSL_GLOBALS_H__ */
|
||||
#endif /* __OSL_GLOBALS_H__ */
|
||||
|
@ -1053,7 +1053,7 @@ bool OSLRenderServices::texture(ustring filename,
|
||||
* other nasty stuff happening.
|
||||
*/
|
||||
string err = ts->geterror();
|
||||
(void)err;
|
||||
(void) err;
|
||||
}
|
||||
|
||||
return status;
|
||||
@ -1132,7 +1132,7 @@ bool OSLRenderServices::texture3d(ustring filename,
|
||||
* other nasty stuff happening.
|
||||
*/
|
||||
string err = ts->geterror();
|
||||
(void)err;
|
||||
(void) err;
|
||||
}
|
||||
|
||||
return status;
|
||||
|
@ -199,4 +199,4 @@ private:
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
#endif /* __OSL_SERVICES_H__ */
|
||||
#endif /* __OSL_SERVICES_H__ */
|
||||
|
@ -193,7 +193,7 @@ void OSLShader::eval_surface(KernelGlobals *kg, ShaderData *sd, PathState *state
|
||||
float data[9];
|
||||
bool found = kg->osl->services->get_attribute(sd, true, OSLRenderServices::u_empty, TypeDesc::TypeVector,
|
||||
OSLRenderServices::u_geom_undisplaced, data);
|
||||
(void)found;
|
||||
(void) found;
|
||||
assert(found);
|
||||
|
||||
memcpy(&sd->P, data, sizeof(float)*3);
|
||||
|
@ -66,4 +66,4 @@ CCL_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __OSL_SHADER_H__ */
|
||||
#endif /* __OSL_SHADER_H__ */
|
||||
|
@ -92,4 +92,4 @@ float wireframe(string edge_type, float line_width) { return wireframe(edge_type
|
||||
float wireframe(string edge_type) { return wireframe(edge_type, 1.0, 1); }
|
||||
float wireframe() { return wireframe("polygons", 1.0, 1); }
|
||||
|
||||
#endif /* CCL_OSLUTIL_H */
|
||||
#endif /* CCL_OSLUTIL_H */
|
||||
|
@ -515,7 +515,7 @@ float smooth_linearstep (float edge0, float edge1, float x_, float eps_) {
|
||||
else if (x >= eps && x <= 1.0-eps) result = x;
|
||||
else if (x >= 1.0+eps) result = 1;
|
||||
else if (x < eps) result = rampup (x+eps, 2.0*eps);
|
||||
else /* if (x < 1.0+eps) */ result = 1.0 - rampup (1.0+eps - x, 2.0*eps);
|
||||
else /* if (x < 1.0+eps) */ result = 1.0 - rampup (1.0+eps - x, 2.0*eps);
|
||||
} else {
|
||||
result = step (edge0, x_);
|
||||
}
|
||||
@ -686,4 +686,4 @@ int getmatrix (string fromspace, output matrix M) {
|
||||
#undef PERCOMP2
|
||||
#undef PERCOMP2F
|
||||
|
||||
#endif /* CCL_STDOSL_H */
|
||||
#endif /* CCL_STDOSL_H */
|
||||
|
@ -78,7 +78,7 @@ ccl_device void kernel_shader_sort(KernelGlobals *kg,
|
||||
}
|
||||
}
|
||||
}
|
||||
# endif /* __KERNEL_OPENCL__ */
|
||||
# endif /* __KERNEL_OPENCL__ */
|
||||
|
||||
/* copy to destination */
|
||||
for(uint i = 0; i < SHADER_SORT_BLOCK_SIZE; i += SHADER_SORT_LOCAL_SIZE) {
|
||||
@ -91,7 +91,7 @@ ccl_device void kernel_shader_sort(KernelGlobals *kg,
|
||||
kernel_split_state.queue_data[outi] = (value == (~0)) ? QUEUE_EMPTY_SLOT : kernel_split_state.queue_data[ini];
|
||||
}
|
||||
}
|
||||
#endif /* __KERNEL_CUDA__ */
|
||||
#endif /* __KERNEL_CUDA__ */
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
@ -24,7 +24,7 @@ CCL_NAMESPACE_BEGIN
|
||||
|
||||
ccl_device_inline uint64_t split_data_buffer_size(KernelGlobals *kg, size_t num_elements)
|
||||
{
|
||||
(void)kg; /* Unused on CPU. */
|
||||
(void) kg; /* Unused on CPU. */
|
||||
|
||||
uint64_t size = 0;
|
||||
#define SPLIT_DATA_ENTRY(type, name, num) + align_up(num_elements * num * sizeof(type), 16)
|
||||
@ -48,7 +48,7 @@ ccl_device_inline void split_data_init(KernelGlobals *kg,
|
||||
ccl_global void *data,
|
||||
ccl_global char *ray_state)
|
||||
{
|
||||
(void)kg; /* Unused on CPU. */
|
||||
(void) kg; /* Unused on CPU. */
|
||||
|
||||
ccl_global char *p = (ccl_global char*)data;
|
||||
|
||||
|
@ -86,14 +86,14 @@ typedef ccl_global struct SplitBranchedState {
|
||||
SPLIT_DATA_ENTRY(ccl_global SubsurfaceIndirectRays, ss_rays, 1)
|
||||
#else
|
||||
# define SPLIT_DATA_SUBSURFACE_ENTRIES
|
||||
#endif /* __SUBSURFACE__ */
|
||||
#endif /* __SUBSURFACE__ */
|
||||
|
||||
#ifdef __VOLUME__
|
||||
# define SPLIT_DATA_VOLUME_ENTRIES \
|
||||
SPLIT_DATA_ENTRY(ccl_global PathState, state_shadow, 1)
|
||||
#else
|
||||
# define SPLIT_DATA_VOLUME_ENTRIES
|
||||
#endif /* __VOLUME__ */
|
||||
#endif /* __VOLUME__ */
|
||||
|
||||
#define SPLIT_DATA_ENTRIES \
|
||||
SPLIT_DATA_ENTRY(ccl_global float3, throughput, 1) \
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user