mirror of
https://github.com/blender/blender
synced 2026-11-22 03:45:13 +03:00
This improves the existing scene specialisation mechanism by replacing "kernel_data.kernel_features" with a function constant. It doesn't cause any additional compilation requests, but allows the backend compiler to eliminate more dead code. An additional compiler hint is provided for dead-stripping "volume_stack_enter_exit" which results in slightly faster rendering of non-volumetric scenes. Pull Request: https://projects.blender.org/blender/blender/pulls/142235
20 lines
604 B
C
20 lines
604 B
C
/* SPDX-FileCopyrightText: 2021-2022 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
|
|
|
enum {
|
|
Kernel_DummyConstant,
|
|
#define KERNEL_STRUCT_MEMBER(parent, type, name) KernelData_##parent##_##name,
|
|
#include "kernel/data_template.h"
|
|
|
|
KernelData_kernel_features
|
|
};
|
|
|
|
#ifdef __KERNEL_METAL__
|
|
# define KERNEL_STRUCT_MEMBER(parent, type, name) \
|
|
constant type kernel_data_##parent##_##name \
|
|
[[function_constant(KernelData_##parent##_##name)]];
|
|
# include "kernel/data_template.h"
|
|
|
|
constant int kernel_data_kernel_features [[function_constant(KernelData_kernel_features)]];
|
|
#endif
|