forked from bartvdbraak/blender
Cycles OSL: handle new getattribute constant folding with renderstate NULL check,
and fix #33654, distance to line segment function is not implemented but compiled anyway, now it should give a compile error.
This commit is contained in:
parent
541f598466
commit
80d22a3f12
@ -634,11 +634,10 @@ bool OSLRenderServices::get_attribute(void *renderstate, bool derivatives, ustri
|
||||
{
|
||||
KernelGlobals *kg = kernel_globals;
|
||||
ShaderData *sd = (ShaderData *)renderstate;
|
||||
int object = sd->object;
|
||||
int tri = sd->prim;
|
||||
int object, tri;
|
||||
|
||||
/* lookup of attribute on another object */
|
||||
if (object_name != u_empty) {
|
||||
if (object_name != u_empty || sd == NULL) {
|
||||
OSLGlobals::ObjectNameMap::iterator it = kg->osl->object_name_map.find(object_name);
|
||||
|
||||
if (it == kg->osl->object_name_map.end())
|
||||
@ -647,8 +646,12 @@ bool OSLRenderServices::get_attribute(void *renderstate, bool derivatives, ustri
|
||||
object = it->second;
|
||||
tri = ~0;
|
||||
}
|
||||
else if (object == ~0) {
|
||||
return get_background_attribute(kg, sd, name, type, derivatives, val);
|
||||
else {
|
||||
object = sd->object;
|
||||
tri = sd->prim;
|
||||
|
||||
if (object == ~0)
|
||||
return get_background_attribute(kg, sd, name, type, derivatives, val);
|
||||
}
|
||||
|
||||
/* find attribute on object */
|
||||
|
@ -161,7 +161,6 @@ vector cross (vector a, vector b) BUILTIN;
|
||||
float dot (vector a, vector b) BUILTIN;
|
||||
float length (vector v) BUILTIN;
|
||||
float distance (point a, point b) BUILTIN;
|
||||
float distance (point a, point b, point q) BUILTIN;
|
||||
normal normalize (normal v) BUILTIN;
|
||||
vector normalize (vector v) BUILTIN;
|
||||
vector faceforward (vector N, vector I, vector Nref) BUILTIN;
|
||||
|
Loading…
Reference in New Issue
Block a user