Cleanup: various cleanups in Cycles kernel #120714
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#120714
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "weizhen/blender:cycles-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
mostly about unused parameters and code duplication. See individual commits for details.
6439f33848
to981734fe3e
@ -422,6 +420,13 @@ ccl_device_inline float light_sample_mis_weight_forward_surface(KernelGlobals kg
const uint32_t path_flag,
const ccl_private ShaderData *sd)
{
const bool has_mis = (sd->type & PRIMITIVE_TRIANGLE) && !(path_flag & PATH_RAY_MIS_SKIP) &&
I removed the
# ifdef __HAIR__
case here. It should be fine to check(sd->type & PRIMITIVE_TRIANGLE)
even when__HAIR__
is not defined?Functionality-wise I think it is fine, but it could have a performance impact for feature-optimized Cycles kernels, as it is probably an extra fetch and extra comparison.
@blender-bot build +gpu
@ -346,2 +330,2 @@
bsdf_eval_mul(&bsdf_eval, mis_weight);
}
const float mis_weight = light_sample_mis_weight_nee(kg, ls.pdf, bsdf_pdf);
bsdf_eval_mul(&bsdf_eval, light_eval / ls.pdf * mis_weight);
This seems to change behavior when
direct_light_sampling_type
is set toDIRECT_LIGHT_SAMPLING_FORWARD
and the light shader is not using MIS. Not sure whether I am missing something, or whether it is in fact an expected change. If that is a change and it is expected, then it should be presented as something else than a refactor.Ah, this is my oversight.
In main the logic of
direct_light_sampling_type
is that whichever option you set, it should converge to the same result. So even if you choose forward sampling and the light actually can't be forward sampled, the MIS weight would still be treated as 1.0f. I think this a more meaningful behavior than what I do here, becausedirect_light_sampling_type
is usually used to check whether all three options give the same result.I will revert to the old behavior.
@ -871,10 +866,7 @@ ccl_device_forceinline void integrate_volume_direct_light(
INTEGRATOR_STATE_WRITE(shadow_state, shadow_path, throughput) = throughput_phase;
/* Write Light-group, +1 as light-group is int but we need to encode into a uint8_t. */
INTEGRATOR_STATE_WRITE(
Is great to see this shenanigans about light groups are finally tackled!
Looks good to me!
I did not see quality regression on AMD Metal, and M2 Metal did not have any performance impact either.
30c4ccf3b2
tocbaf9e0eb8
@blender-bot build