Page MenuHome

Cycles: add packed_float3 type for storage
ClosedPublic

Authored by Brecht Van Lommel (brecht) on Nov 16 2021, 3:50 PM.

Details

Summary

Introduce a packed_float3 type for smaller storage that is exactly 3
floats, instead of 4. For computation float3 is still used since it can
use SIMD instructions.

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested review of this revision.Nov 16 2021, 3:50 PM
Brecht Van Lommel (brecht) created this revision.
intern/cycles/util/types_float3.h
60

Is CUDA's float3 12 bytes in size / 4 byte aligned (e.g. https://github.com/ROCm-Developer-Tools/HIP/issues/706)? In which case could this be #define packed_float3 float3 on CUDA?

Use float3 for CUDA, give error using float3 for device_memory.

This looks good and I expect it will fit very cleanly with Metal.

This revision is now accepted and ready to land.Nov 16 2021, 9:45 PM