[Bf-blender-cvs] [a7aaa6a] cycles_split_kernel: Cycles: Fix building with OSL enabled after split kernel changes
Mai Lavelle
noreply at git.blender.org
Wed Nov 2 16:03:53 CET 2016
Commit: a7aaa6ab6c7e904d6e03f31f02ac7936300d1739
Author: Mai Lavelle
Date: Tue Nov 1 15:14:27 2016 +0100
Branches: cycles_split_kernel
https://developer.blender.org/rBa7aaa6ab6c7e904d6e03f31f02ac7936300d1739
Cycles: Fix building with OSL enabled after split kernel changes
Seems I had OSL disabled while working on getting the split kernel to run
on CPU, should be fine now.
===================================================================
M intern/cycles/kernel/osl/background.cpp
M intern/cycles/kernel/osl/bsdf_diffuse_ramp.cpp
M intern/cycles/kernel/osl/bsdf_phong_ramp.cpp
M intern/cycles/kernel/osl/emissive.cpp
M intern/cycles/kernel/osl/osl_bssrdf.cpp
M intern/cycles/kernel/osl/osl_closures.cpp
M intern/cycles/kernel/osl/osl_closures.h
M intern/cycles/kernel/osl/osl_services.cpp
M intern/cycles/kernel/osl/osl_shader.cpp
M intern/cycles/kernel/split/kernel_split_common.h
===================================================================
diff --git a/intern/cycles/kernel/osl/background.cpp b/intern/cycles/kernel/osl/background.cpp
index d835f9b..beb5961 100644
--- a/intern/cycles/kernel/osl/background.cpp
+++ b/intern/cycles/kernel/osl/background.cpp
@@ -51,9 +51,9 @@ using namespace OSL;
///
class GenericBackgroundClosure : public CClosurePrimitive {
public:
- void setup(ShaderData *sd, int /* path_flag */, float3 weight)
+ void setup(KernelGlobals *kg, ShaderData *sd, int /* path_flag */, float3 weight)
{
- closure_alloc(sd, sizeof(ShaderClosure), CLOSURE_BACKGROUND_ID, weight);
+ closure_alloc(kg, sd, sizeof(ShaderClosure), CLOSURE_BACKGROUND_ID, weight);
}
};
@@ -66,9 +66,9 @@ public:
///
class HoldoutClosure : CClosurePrimitive {
public:
- void setup(ShaderData *sd, int /* path_flag */, float3 weight)
+ void setup(KernelGlobals *kg, ShaderData *sd, int /* path_flag */, float3 weight)
{
- closure_alloc(sd, sizeof(ShaderClosure), CLOSURE_HOLDOUT_ID, weight);
+ closure_alloc(kg, sd, sizeof(ShaderClosure), CLOSURE_HOLDOUT_ID, weight);
sd->flag |= SD_HOLDOUT;
}
};
@@ -81,9 +81,9 @@ public:
///
class AmbientOcclusionClosure : public CClosurePrimitive {
public:
- void setup(ShaderData *sd, int /* path_flag */, float3 weight)
+ void setup(KernelGlobals *kg, ShaderData *sd, int /* path_flag */, float3 weight)
{
- closure_alloc(sd, sizeof(ShaderClosure), CLOSURE_AMBIENT_OCCLUSION_ID, weight);
+ closure_alloc(kg, sd, sizeof(ShaderClosure), CLOSURE_AMBIENT_OCCLUSION_ID, weight);
sd->flag |= SD_AO;
}
};
diff --git a/intern/cycles/kernel/osl/bsdf_diffuse_ramp.cpp b/intern/cycles/kernel/osl/bsdf_diffuse_ramp.cpp
index bc26f42..58c993f 100644
--- a/intern/cycles/kernel/osl/bsdf_diffuse_ramp.cpp
+++ b/intern/cycles/kernel/osl/bsdf_diffuse_ramp.cpp
@@ -51,12 +51,12 @@ public:
DiffuseRampBsdf params;
Color3 colors[8];
- void setup(ShaderData *sd, int /* path_flag */, float3 weight)
+ void setup(KernelGlobals *kg, ShaderData *sd, int /* path_flag */, float3 weight)
{
- DiffuseRampBsdf *bsdf = (DiffuseRampBsdf*)bsdf_alloc_osl(sd, sizeof(DiffuseRampBsdf), weight, ¶ms);
+ DiffuseRampBsdf *bsdf = (DiffuseRampBsdf*)bsdf_alloc_osl(kg, sd, sizeof(DiffuseRampBsdf), weight, ¶ms);
if(bsdf) {
- bsdf->colors = (float3*)closure_alloc_extra(sd, sizeof(float3)*8);
+ bsdf->colors = (float3*)closure_alloc_extra(kg, sd, sizeof(float3)*8);
if(bsdf->colors) {
for(int i = 0; i < 8; i++)
diff --git a/intern/cycles/kernel/osl/bsdf_phong_ramp.cpp b/intern/cycles/kernel/osl/bsdf_phong_ramp.cpp
index 14c7644..f33faa6 100644
--- a/intern/cycles/kernel/osl/bsdf_phong_ramp.cpp
+++ b/intern/cycles/kernel/osl/bsdf_phong_ramp.cpp
@@ -50,12 +50,12 @@ public:
PhongRampBsdf params;
Color3 colors[8];
- void setup(ShaderData *sd, int /* path_flag */, float3 weight)
+ void setup(KernelGlobals *kg, ShaderData *sd, int /* path_flag */, float3 weight)
{
- PhongRampBsdf *bsdf = (PhongRampBsdf*)bsdf_alloc_osl(sd, sizeof(PhongRampBsdf), weight, ¶ms);
+ PhongRampBsdf *bsdf = (PhongRampBsdf*)bsdf_alloc_osl(kg, sd, sizeof(PhongRampBsdf), weight, ¶ms);
if(bsdf) {
- bsdf->colors = (float3*)closure_alloc_extra(sd, sizeof(float3)*8);
+ bsdf->colors = (float3*)closure_alloc_extra(kg, sd, sizeof(float3)*8);
if(bsdf->colors) {
for(int i = 0; i < 8; i++)
diff --git a/intern/cycles/kernel/osl/emissive.cpp b/intern/cycles/kernel/osl/emissive.cpp
index 3f13e08..af72518 100644
--- a/intern/cycles/kernel/osl/emissive.cpp
+++ b/intern/cycles/kernel/osl/emissive.cpp
@@ -54,9 +54,9 @@ using namespace OSL;
///
class GenericEmissiveClosure : public CClosurePrimitive {
public:
- void setup(ShaderData *sd, int /* path_flag */, float3 weight)
+ void setup(KernelGlobals *kg, ShaderData *sd, int /* path_flag */, float3 weight)
{
- closure_alloc(sd, sizeof(ShaderClosure), CLOSURE_EMISSION_ID, weight);
+ closure_alloc(kg, sd, sizeof(ShaderClosure), CLOSURE_EMISSION_ID, weight);
sd->flag |= SD_EMISSION;
}
};
diff --git a/intern/cycles/kernel/osl/osl_bssrdf.cpp b/intern/cycles/kernel/osl/osl_bssrdf.cpp
index 3614717e2..78a04d7 100644
--- a/intern/cycles/kernel/osl/osl_bssrdf.cpp
+++ b/intern/cycles/kernel/osl/osl_bssrdf.cpp
@@ -52,7 +52,7 @@ public:
float3 radius;
float3 albedo;
- void alloc(ShaderData *sd, int path_flag, float3 weight, ClosureType type)
+ void alloc(KernelGlobals *kg, ShaderData *sd, int path_flag, float3 weight, ClosureType type)
{
float sample_weight = fabsf(average(weight));
@@ -70,7 +70,7 @@ public:
float texture_blur = params.texture_blur;
/* create one closure per color channel */
- Bssrdf *bssrdf = bssrdf_alloc(sd, make_float3(weight.x, 0.0f, 0.0f));
+ Bssrdf *bssrdf = bssrdf_alloc(kg, sd, make_float3(weight.x, 0.0f, 0.0f));
if(bssrdf) {
bssrdf->sample_weight = sample_weight;
bssrdf->radius = radius.x;
@@ -81,7 +81,7 @@ public:
ccl_fetch(sd, flag) |= bssrdf_setup(bssrdf, (ClosureType)type);
}
- bssrdf = bssrdf_alloc(sd, make_float3(0.0f, weight.y, 0.0f));
+ bssrdf = bssrdf_alloc(kg, sd, make_float3(0.0f, weight.y, 0.0f));
if(bssrdf) {
bssrdf->sample_weight = sample_weight;
bssrdf->radius = radius.y;
@@ -92,7 +92,7 @@ public:
ccl_fetch(sd, flag) |= bssrdf_setup(bssrdf, (ClosureType)type);
}
- bssrdf = bssrdf_alloc(sd, make_float3(0.0f, 0.0f, weight.z));
+ bssrdf = bssrdf_alloc(kg, sd, make_float3(0.0f, 0.0f, weight.z));
if(bssrdf) {
bssrdf->sample_weight = sample_weight;
bssrdf->radius = radius.z;
@@ -110,9 +110,9 @@ public:
class CubicBSSRDFClosure : public CBSSRDFClosure {
public:
- void setup(ShaderData *sd, int path_flag, float3 weight)
+ void setup(KernelGlobals *kg, ShaderData *sd, int path_flag, float3 weight)
{
- alloc(sd, path_flag, weight, CLOSURE_BSSRDF_CUBIC_ID);
+ alloc(kg, sd, path_flag, weight, CLOSURE_BSSRDF_CUBIC_ID);
}
};
@@ -135,9 +135,9 @@ CCLOSURE_PREPARE(closure_bssrdf_cubic_prepare, CubicBSSRDFClosure)
class GaussianBSSRDFClosure : public CBSSRDFClosure {
public:
- void setup(ShaderData *sd, int path_flag, float3 weight)
+ void setup(KernelGlobals *kg, ShaderData *sd, int path_flag, float3 weight)
{
- alloc(sd, path_flag, weight, CLOSURE_BSSRDF_GAUSSIAN_ID);
+ alloc(kg, sd, path_flag, weight, CLOSURE_BSSRDF_GAUSSIAN_ID);
}
};
@@ -159,9 +159,9 @@ CCLOSURE_PREPARE(closure_bssrdf_gaussian_prepare, GaussianBSSRDFClosure)
class BurleyBSSRDFClosure : public CBSSRDFClosure {
public:
- void setup(ShaderData *sd, int path_flag, float3 weight)
+ void setup(KernelGlobals *kg, ShaderData *sd, int path_flag, float3 weight)
{
- alloc(sd, path_flag, weight, CLOSURE_BSSRDF_BURLEY_ID);
+ alloc(kg, sd, path_flag, weight, CLOSURE_BSSRDF_BURLEY_ID);
}
};
diff --git a/intern/cycles/kernel/osl/osl_closures.cpp b/intern/cycles/kernel/osl/osl_closures.cpp
index 94de782..f4a9da2 100644
--- a/intern/cycles/kernel/osl/osl_closures.cpp
+++ b/intern/cycles/kernel/osl/osl_closures.cpp
@@ -42,6 +42,7 @@
#include "kernel_types.h"
#include "kernel_compat_cpu.h"
+#include "split/kernel_split_data.h"
#include "kernel_globals.h"
#include "kernel_montecarlo.h"
#include "kernel_random.h"
@@ -284,14 +285,14 @@ public:
MicrofacetBsdf params;
float3 color;
- MicrofacetBsdf *alloc(ShaderData *sd, int path_flag, float3 weight)
+ MicrofacetBsdf *alloc(KernelGlobals *kg, ShaderData *sd, int path_flag, float3 weight)
{
/* Technically, the MultiGGX Glass closure may also transmit. However,
* since this is set statically and only used for caustic flags, this
* is probably as good as it gets. */
if(!skip(sd, path_flag, LABEL_GLOSSY|LABEL_REFLECT)) {
- MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc_osl(sd, sizeof(MicrofacetBsdf), weight, ¶ms);
- MicrofacetExtra *extra = (MicrofacetExtra*)closure_alloc_extra(sd, sizeof(MicrofacetExtra));
+ MicrofacetBsdf *bsdf = (MicrofacetBsdf*)bsdf_alloc_osl(kg, sd, sizeof(MicrofacetBsdf), weight, ¶ms);
+ MicrofacetExtra *extra = (MicrofacetExtra*)closure_alloc_extra(kg, sd, sizeof(MicrofacetExtra));
if(bsdf && extra) {
bsdf->extra = extra;
bsdf->extra->color = color;
@@ -305,9 +306,9 @@ public:
class MicrofacetMultiGGXClosure : public MicrofacetMultiClosure {
public:
- void setup(ShaderData *sd, int path_flag, float3 weight)
+ void setup(KernelGlobals *kg, ShaderData *sd, int path_flag, float3 weight)
{
- MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight);
+ MicrofacetBsdf *bsdf = alloc(kg, sd, path_flag, weight);
sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_setup(bsdf) : 0;
}
};
@@ -327,9 +328,9 @@ CCLOSURE_PREPARE(closure_bsdf_microfacet_multi_ggx_prepare, MicrofacetMultiGGXCl
class MicrofacetMultiGGXAnisoClosure : public MicrofacetMultiClosure {
public:
- void setup(ShaderData *sd, int path_flag, float3 weight)
+ void setup(KernelGlobals *kg, ShaderData *sd, int path_flag, float3 weight)
{
- MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight);
+ MicrofacetBsdf *bsdf = alloc(kg, sd, path_flag, weight);
sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_aniso_setup(bsdf) : 0;
}
};
@@ -353,9 +354,9 @@ class MicrofacetMultiGGXGlassClosure : public MicrofacetMultiClosure {
public:
MicrofacetMultiGGXGlassClosure() : MicrofacetMultiClosure() {}
- void setup(ShaderData *sd, int path_flag, float3 weight)
+ void setup(KernelGlobals *kg, ShaderData *sd, int path_flag, float3 weight)
{
- MicrofacetBsdf *bsdf = alloc(sd, path_flag, weight);
+ MicrofacetBsdf *bsdf = alloc(kg, sd, path_flag, weight);
sd->flag |= (bsdf) ? bsdf_microfacet_multi_ggx_glass_setup(bsdf) : 0;
}
};
diff --git a/intern/cycles/kernel/osl/osl_closures.h b/intern/cycles/kernel/osl/osl_closures.h
index cd7b337..dd84c89 100644
--- a/intern/cycles/kernel/osl/osl_closures.h
+++ b/intern/cycles/kernel/osl/osl_closures.h
@@ -90,7 +90,7 @@ void name(RendererServices *, int id, void *data) \
class CClosurePrimitive {
public:
- virtual void setup(ShaderData *sd, int path_flag, float3 weight) = 0;
+ virtual void setup(KernelGlobals *kg, ShaderData *sd, int path_flag, float3 weight) = 0;
OSL::ustring label;
};
@@ -109,10 +109,10 @@ public: \
structname params; \
float3 unused; \
\
- void setu
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list