|
Blender V5.0
|
Go to the source code of this file.
Macros | |
| #define | KERNEL_NAME_JOIN(x, y, z) |
| #define | KERNEL_NAME_EVAL(arch, name) |
| #define | KERNEL_FUNCTION_FULL_NAME(name) |
| #define | KERNEL_ARCH cpu |
| #define | KERNEL_ARCH cpu_avx2 |
Functions | |
| KernelGlobalsCPU * | kernel_globals_create () |
| void | kernel_globals_free (KernelGlobalsCPU *kg) |
| void * | kernel_osl_memory (const KernelGlobalsCPU *kg) |
| bool | kernel_osl_use (const KernelGlobalsCPU *kg) |
| void | kernel_const_copy (KernelGlobalsCPU *kg, const char *name, void *host, const size_t size) |
| void | kernel_global_memory_copy (KernelGlobalsCPU *kg, const char *name, void *mem, const size_t size) |
| #define KERNEL_ARCH cpu_avx2 |
Definition at line 35 of file kernel/device/cpu/kernel.h.
| #define KERNEL_ARCH cpu |
Definition at line 35 of file kernel/device/cpu/kernel.h.
| #define KERNEL_FUNCTION_FULL_NAME | ( | name | ) |
Definition at line 17 of file kernel/device/cpu/kernel.h.
Referenced by shader_eval_displace().
| #define KERNEL_NAME_EVAL | ( | arch, | |
| name ) |
Definition at line 16 of file kernel/device/cpu/kernel.h.
Definition at line 15 of file kernel/device/cpu/kernel.h.
| void kernel_const_copy | ( | KernelGlobalsCPU * | kg, |
| const char * | name, | ||
| void * | host, | ||
| const size_t | size ) |
Definition at line 56 of file kernel/device/cpu/kernel.cpp.
References assert, KernelGlobalsCPU::data, and name.
Referenced by CPUDevice::const_copy_to().
| void kernel_global_memory_copy | ( | KernelGlobalsCPU * | kg, |
| const char * | name, | ||
| void * | mem, | ||
| const size_t | size ) |
RGBE format represents an RGB value with 4 bytes.
The original implementation by Greg Ward uses 8 bits for RGB each, plus 8 bits shared exponent. It has the same relative precision as the 0 to 255 range of standard 24-bit image formats, but offers extended intensity range: https://www.graphics.cornell.edu/~bjw/rgbe.html GL_EXT_texture_shared_exponent uses 9 bits for RGB and 5 bits for exponent instead, with smaller range but higher precision: https://registry.khronos.org/OpenGL/extensions/EXT/EXT_texture_shared_exponent.txt
Our implementation is mostly based on GL_EXT_texture_shared_exponent, but uses 8 bits for RGB each, and adds 3 sign bits to represent negative values. The memory layout is as follows:
xxxxxxxx xxxxxxxx xxxxxxxx xxx xxxxx
m(R) m(G) m(B) sgn exp
Each float component is interpreted as sgn exp - bias f = (-1) * 0.m * 2
We choose a bias of 15, so that the largest representable value is RGBE_MAX = 0.11111111 * 2^(31 - 15) = 65280, and the smallest positive representable value is RGBE_MIN = 0.00000001 * 2^(0 - 15) = 1.1920929e-7
Definition at line 66 of file kernel/device/cpu/kernel.cpp.
References assert, name, and size().
Referenced by CPUDevice::global_alloc().
| KernelGlobalsCPU * kernel_globals_create | ( | ) |
| void kernel_globals_free | ( | KernelGlobalsCPU * | kg | ) |
| void * kernel_osl_memory | ( | const KernelGlobalsCPU * | kg | ) |
| bool kernel_osl_use | ( | const KernelGlobalsCPU * | kg | ) |