Fix sd->type set to PRIMITIVE_TRIANGLE when it should be PRIMITIVE_LAMP #108769

Merged
Weizhen Huang merged 1 commits from weizhen/blender:fix_wrong_primitive_type into main 2023-06-08 18:05:35 +02:00
1 changed files with 7 additions and 4 deletions

View File

@ -155,12 +155,15 @@ ccl_device_inline void shader_setup_from_sample(KernelGlobals kg,
sd->Ng = Ng;
sd->wi = I;
sd->shader = shader;
if (prim != PRIM_NONE)
sd->type = PRIMITIVE_TRIANGLE;
else if (lamp != LAMP_NONE)
if (lamp != LAMP_NONE) {
sd->type = PRIMITIVE_LAMP;
else
}
else if (prim != PRIM_NONE) {
sd->type = PRIMITIVE_TRIANGLE;
}
else {
sd->type = PRIMITIVE_NONE;
}
/* primitive */
sd->object = object;