This PR removes a bunch of dead code following #123551 (removal of AMD and Intel GPU support). It is safe to assume that UMA will be available, so a lot of codepaths that dealt with copying between CPU and GPU are now just clutter.
Pull Request: https://projects.blender.org/blender/blender/pulls/136117
There is code that properly handles panoramic cameras in
`camera_world_to_ndc`, the transform matrices (e.g.
`OSLRenderServices::get_inverse_matrix`) in the `transform("NDC", P)`
call dont do the "full work" here (maybe they should though?).
But we can get to `camera_world_to_ndc` by just getting the "NDC"
attribute, so use that for now.
Pull Request: https://projects.blender.org/blender/blender/pulls/136097
This change fixes the remaining failing tests with SSS when using HIP-RT.
This includes crash when SSS is used on curves, and objects with motion
blur and SSS rendering black.
The root cause for both cases was the fact that traversal was always
assuming regular BVH (built for triangles), while curves and motion
triangles are using custom primitives, which requires specialized BVH
traversal.
This change includes:
- Early output from `scene_intersect_local()` for non-triangle and
non-motion-triangle primitives. This fixes `sss_hair.blend` test,
and also avoids unnecessary BVH traversal when the local intersection
is requested from curve object. The same early-output could be added
to other BVH traversal implementation.
- Use `hiprtGeomCustomTraversalAnyHitCustomStack` for motion triangles
primitives. This fixes motion blur on objects with SSS render black.
Fixes#135856
Co-authored-by: Sahar A. Kashi <sahar.alipourkashi@amd.com>
Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/135943
Profiling on Arc B580 shown that sd->num_closure queries were often
stalling.
Packing it closer to other often accessed elements within ShaderData
(type, flag..) does speedup rendering by ~5% in most scenes.
Pull Request: https://projects.blender.org/blender/blender/pulls/135980
While auto lets the compiler make the right choice for shade_surface
kernel when compiling for Battlemage and Lunar Lake, that's not the case
for Alchemist and Meteor Lake, so now we force this mode.
It was always hard-coded to be 0.
It does not seem to result in any extra tests passing, but they are
probably not sophisticated enough.
Noticed while looking into details for the #135856.
Pull Request: https://projects.blender.org/blender/blender/pulls/135878
* Share vertices between patches instead of using stitch map
* Switch to OpenSubdiv compatible counter-clockwise indexing
* Simplify patch edge reverse direction logic
* Add more comments to splitting and dicing
Pull Request: https://projects.blender.org/blender/blender/pulls/135681
* Add SubdAttributeInterpolation class for linear attribute interpolation.
* Dicing computes ptex UV and face ID for interpolation.
* Simplify mesh storage of subd primitive counts
* Remove kernel code for subd attribute interpolation
* Remove patch table packing and upload
The old optimization adds a fair amount of complexity to the kernel, affecting
performance even when not using the feature. It's also not that useful as it
does not work for UVs that needs special interpolation. With this simpler code
it should be easier to make it feature complete.
Pull Request: https://projects.blender.org/blender/blender/pulls/135681
Make the ray self primitives store and restore reliable for cases when
the intersect_shadow kernel is called multiple times:
- Light object and primitive are stored in dedicated fields in the
state. This adds 2 integers per state.
- The self object and primitive are used from the previous intersection
when the intersect_shadow is called multiple times.
There is more detailed explanation added in the code.
The issue was introduced by the light refactor to be objects in #134846.
Pull Request: https://projects.blender.org/blender/blender/pulls/135573
With auto mode, integrator_intersect_subsurface still ended up being
compiled in large GRF mode on Intel Arc B580, while normal GRF provides
the best performance for this kernel.
When using Alembic procedurals, the Mesh Sequence Cache attempts to
replace the original geometry with a plain old cube. However, it never
frees this new cube geometry. Transfer ownership to the underlying
GeometrySet instead.
Investigating the scenario also showed that the `~AlembicProcedural`
dtor was removing an item from the `nodes` vector while iterating over
it, which triggers debug asserts on at least MSVC. I believe the removal
is unnecessary since this is the dtor and ASAN appears clean now.
Pull Request: https://projects.blender.org/blender/blender/pulls/134085
The default was large GRF mode for all kernels and normal GRF for
intersection kernels.
path_array kernels also benefit from normal GRF, being almost 2x faster
in this mode, as measured on my Arc B580. This translates to a much
smaller 1-3% speedup in overall rendering.
Instead of manually adding them to the list of kernels to compile in
normal GRF mode, I've switched to auto that provides the same result.
The crash has been introduced by the refactor of lights to be
objects in #134846.
We can make such cases easier to catch at compile time in the
future, but for now applying the minimal patch which solves the
problem without going deeper into refactor.
Pull Request: https://projects.blender.org/blender/blender/pulls/135570
Is harmless from functional perspective, but uses more resources and
potentially slower than it should be. Although, probably something
hard to measure in practice, but still better not follow this anti-
pattern.
Pull Request: https://projects.blender.org/blender/blender/pulls/135529