forked from bartvdbraak/blender
Cycles: Make MESA compiler more happy
While this compiler is not officially supported yet, getting it to work is a nice thing because more and more AMD cards will fall under MESA driver. It's also nice to use explicit comparison with NULL, which makes it more clear whether variable is a boolean or pointer. Even Rust enforces this! Patch by Ian Bruce with own modifications.
This commit is contained in:
parent
e8021f5e3b
commit
8794a43b68
@ -62,7 +62,7 @@ ccl_device_inline ShaderClosure *bsdf_alloc(ShaderData *sd, int size, float3 wei
|
|||||||
{
|
{
|
||||||
ShaderClosure *sc = closure_alloc(sd, size, CLOSURE_NONE_ID, weight);
|
ShaderClosure *sc = closure_alloc(sd, size, CLOSURE_NONE_ID, weight);
|
||||||
|
|
||||||
if(!sc)
|
if(sc == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
float sample_weight = fabsf(average(weight));
|
float sample_weight = fabsf(average(weight));
|
||||||
|
@ -266,7 +266,7 @@ ccl_device bool bsdf_microfacet_merge(const ShaderClosure *a, const ShaderClosur
|
|||||||
(bsdf_a->alpha_y == bsdf_b->alpha_y) &&
|
(bsdf_a->alpha_y == bsdf_b->alpha_y) &&
|
||||||
(isequal_float3(bsdf_a->T, bsdf_b->T)) &&
|
(isequal_float3(bsdf_a->T, bsdf_b->T)) &&
|
||||||
(bsdf_a->ior == bsdf_b->ior) &&
|
(bsdf_a->ior == bsdf_b->ior) &&
|
||||||
((!bsdf_a->extra && !bsdf_b->extra) ||
|
((bsdf_a->extra == NULL && bsdf_b->extra == NULL) ||
|
||||||
((bsdf_a->extra && bsdf_b->extra) &&
|
((bsdf_a->extra && bsdf_b->extra) &&
|
||||||
(isequal_float3(bsdf_a->extra->color, bsdf_b->extra->color))));
|
(isequal_float3(bsdf_a->extra->color, bsdf_b->extra->color))));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user