* Rename "texture" to "data array". This has not used textures for a long time, there are just global memory arrays now. (On old CUDA GPUs there was a cache for textures but not global memory, so we used to put all data in textures.) * For CUDA and HIP, put globals in KernelParams struct like other devices. * Drop __ prefix for data array names, no possibility for naming conflict now that these are in a struct.
37 lines
914 B
C
37 lines
914 B
C
/* SPDX-License-Identifier: Apache-2.0
|
|
* Copyright 2021-2022 Blender Foundation */
|
|
|
|
/* Constant Globals */
|
|
|
|
#include "kernel/types.h"
|
|
#include "kernel/util/profiling.h"
|
|
|
|
#include "kernel/integrator/state.h"
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
typedef struct KernelParamsMetal {
|
|
|
|
#define KERNEL_DATA_ARRAY(type, name) ccl_global const type *name;
|
|
#include "kernel/data_arrays.h"
|
|
#undef KERNEL_DATA_ARRAY
|
|
|
|
const IntegratorStateGPU integrator_state;
|
|
const KernelData data;
|
|
|
|
} KernelParamsMetal;
|
|
|
|
typedef struct KernelGlobalsGPU {
|
|
int unused[1];
|
|
} KernelGlobalsGPU;
|
|
|
|
typedef ccl_global const KernelGlobalsGPU *ccl_restrict KernelGlobals;
|
|
|
|
/* Abstraction macros */
|
|
#define kernel_data launch_params_metal.data
|
|
#define kernel_data_fetch(name, index) launch_params_metal.name[index]
|
|
#define kernel_data_array(name) launch_params_metal.name
|
|
#define kernel_integrator_state launch_params_metal.integrator_state
|
|
|
|
CCL_NAMESPACE_END
|