blender/intern
Michael Jones a0f269f682 Cycles: Kernel address space changes for MSL
This is the first of a sequence of changes to support compiling Cycles kernels as MSL (Metal Shading Language) in preparation for a Metal GPU device implementation.

MSL requires that all pointer types be declared with explicit address space attributes (device, thread, etc...). There is already precedent for this with Cycles' address space macros (ccl_global, ccl_private, etc...), therefore the first step of MSL-enablement is to apply these consistently. Line-for-line this represents the largest change required to enable MSL. Applying this change first will simplify future patches as well as offering the emergent benefit of enhanced descriptiveness.

The vast majority of deltas in this patch fall into one of two cases:

- Ensuring ccl_private is specified for thread-local pointer types
- Ensuring ccl_global is specified for device-wide pointer types

Additionally, the ccl_addr_space qualifier can be removed. Prior to Cycles X, ccl_addr_space was used as a context-dependent address space qualifier, but now it is either redundant (e.g. in struct typedefs), or can be replaced by ccl_global in the case of pointer types. Associated function variants (e.g. lcg_step_float_addrspace) are also redundant.

In cases where address space qualifiers are chained with "const", this patch places the address space qualifier first. The rationale for this is that the choice of address space is likely to have the greater impact on runtime performance and overall architecture.

The final part of this patch is the addition of a metal/compat.h header. This is partially complete and will be extended in future patches, paving the way for the full Metal implementation.

Ref T92212

Reviewed By: brecht

Maniphest Tasks: T92212

Differential Revision: https://developer.blender.org/D12864
2021-10-14 16:14:43 +01:00
..
atomic Add locking fallback atomics implementation 2021-08-26 14:36:59 +02:00
audaspace Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
clog Cleanup: comment blocks, trailing space in comments 2021-06-24 15:59:34 +10:00
cycles Cycles: Kernel address space changes for MSL 2021-10-14 16:14:43 +01:00
dualcon Spelling: Then Versus Than 2020-10-19 08:43:08 -07:00
eigen Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
ffmpeg Fix: VSE search in mpegts files would fail 2021-06-11 14:05:07 +02:00
ghost Revert "GHOST: Unify behavior of offscreen context creation" 2021-10-12 17:54:52 +02:00
glew-mx Cleanup: GPUState: Remove stack from the state manager and rename it 2020-08-18 21:30:10 +02:00
guardedalloc Cleanup: spelling in comments 2021-10-03 12:13:29 +11:00
iksolver Cleanup: Spelling Mistakes 2021-06-22 10:54:50 -07:00
itasc Cleanup: repeated terms in code comments & error messages 2021-06-28 15:46:08 +10:00
libc_compat Build: add more libc compatibility functions for upcoming libraries update 2020-07-09 18:10:05 +02:00
libmv GTest: Use INC/INC_SYS for Libmv/OSD tests 2021-07-23 16:50:13 -06:00
locale Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
mantaflow Cleanup: repeated terms in code comments & error messages 2021-06-28 15:46:08 +10:00
memutil Cleanup: missing leading '*' from comment blocks 2021-07-30 22:20:31 +10:00
mikktspace Cleanup: pass arguments as const 2021-10-04 13:15:15 +11:00
numaapi Add support for RISC-V architecture 2021-07-15 14:22:35 +02:00
opencolorio Cleanup: comment blocks, trailing space in comments 2021-06-24 15:59:34 +10:00
opensubdiv Cleanup: typos in code and comments. 2021-09-25 09:31:00 +02:00
openvdb Cleanup: Remove unused/unecessary OpenVDB C API 2021-08-02 12:26:28 -04:00
quadriflow Cleanup: Simplify logic, follow style guide for integer types 2021-07-30 15:08:43 -04:00
rigidbody Cleanup: reserve C++ comments for disabled code 2021-07-20 15:01:05 +10:00
sky Cleanup: Clang-tidy, readability-non-const-parameter. 2020-11-07 21:52:53 +05:30
utfconv Cleanup: clang-tidy utfconv 2021-09-01 17:13:33 +10:00
CMakeLists.txt Atomic: Cover with unit tests 2020-11-19 17:19:48 +01:00