Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernel_light.h
| Context not available. | |||||
| /* Generic Light */ | /* Generic Light */ | ||||
| ccl_device void light_sample(KernelGlobals *kg, float randt, float randu, float randv, float time, float3 P, LightSample *ls) | ccl_device bool light_select_reached_max_bounces(KernelGlobals *kg, int index, int bounce) | ||||
sergey: Not sure why select? | |||||
| { | |||||
| float4 data4 = kernel_tex_fetch(__light_data, index*LIGHT_SIZE + 4); | |||||
| return (bounce > __float_as_int(data4.x)); | |||||
| } | |||||
| ccl_device void light_sample(KernelGlobals *kg, float randt, float randu, float randv, float time, float3 P, LightSample *ls, int bounce) | |||||
sergeyUnsubmitted Not Done Inline ActionsMove bounce before ls, so this way input parameters are all comes before output one. sergey: Move `bounce` before `ls`, so this way input parameters are all comes before output one. | |||||
| { | { | ||||
| /* sample index */ | /* sample index */ | ||||
| int index = light_distribution_sample(kg, randt); | int index = light_distribution_sample(kg, randt); | ||||
| Context not available. | |||||
| } | } | ||||
| else { | else { | ||||
| int lamp = -prim-1; | int lamp = -prim-1; | ||||
| if(light_select_reached_max_bounces(kg, lamp, bounce)) { | |||||
sergeyUnsubmitted Not Done Inline ActionsUse UNLIKELY? Same applies to the checks below. sergey: Use UNLIKELY? Same applies to the checks below. | |||||
| ls->pdf = 0.0f; | |||||
| return; | |||||
| } | |||||
Not Done Inline ActionsDid you test asm output/performance with using inlined function? sergey: Did you test asm output/performance with using inlined function? | |||||
| lamp_light_sample(kg, lamp, randu, randv, P, ls); | lamp_light_sample(kg, lamp, randu, randv, P, ls); | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
Not sure why select?