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 Commits

Author SHA1 Message Date
Weizhen Huang 08d289cb14 Fix `sd->type` set to `PRIMITIVE_TRIANGLE` when it should be `PRIMITIVE_LAMP`
Function #lights_intersect_impl sets `isect->prim` to `lamp`, which is
passed to function #shader_setup_from_sample. There `prim != PRIM_NONE`
is evaluated to `true`, thus setting `sd->type` to `PRIMITIVE_TRIANGLE`
erroneously. This fix checks `lamp != LAMP_NONE` first, as in all other
usages of #shader_setup_from_sample `LAMP_NONE` is passed as the value
of `lamp`.
2023-06-08 16:30:40 +02:00