diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-06-17 18:16:37 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-06-20 13:30:48 +0300 |
commit | ff1883307f12a8b734bfcf87b01743dc73afae75 (patch) | |
tree | 95fbecc1e681e89f6a5d030cb5f5f96879dc7fa7 /intern/cycles/kernel/geom/attribute.h | |
parent | b73a52302edcd99f086fc26fc62a8ed4db29d562 (diff) |
Cleanup: renaming and consistency for kernel data
* 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.
Diffstat (limited to 'intern/cycles/kernel/geom/attribute.h')
-rw-r--r-- | intern/cycles/kernel/geom/attribute.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/intern/cycles/kernel/geom/attribute.h b/intern/cycles/kernel/geom/attribute.h index 774b25a76ff..31a9e39d528 100644 --- a/intern/cycles/kernel/geom/attribute.h +++ b/intern/cycles/kernel/geom/attribute.h @@ -18,7 +18,7 @@ CCL_NAMESPACE_BEGIN ccl_device_inline uint subd_triangle_patch(KernelGlobals kg, ccl_private const ShaderData *sd) { - return (sd->prim != PRIM_NONE) ? kernel_tex_fetch(__tri_patch, sd->prim) : ~0; + return (sd->prim != PRIM_NONE) ? kernel_data_fetch(tri_patch, sd->prim) : ~0; } ccl_device_inline uint attribute_primitive_type(KernelGlobals kg, ccl_private const ShaderData *sd) @@ -42,7 +42,7 @@ ccl_device_inline AttributeDescriptor attribute_not_found() ccl_device_inline uint object_attribute_map_offset(KernelGlobals kg, int object) { - return kernel_tex_fetch(__objects, object).attribute_map_offset; + return kernel_data_fetch(objects, object).attribute_map_offset; } ccl_device_inline AttributeDescriptor find_attribute(KernelGlobals kg, @@ -56,7 +56,7 @@ ccl_device_inline AttributeDescriptor find_attribute(KernelGlobals kg, /* for SVM, find attribute by unique id */ uint attr_offset = object_attribute_map_offset(kg, sd->object); attr_offset += attribute_primitive_type(kg, sd); - AttributeMap attr_map = kernel_tex_fetch(__attributes_map, attr_offset); + AttributeMap attr_map = kernel_data_fetch(attributes_map, attr_offset); while (attr_map.id != id) { if (UNLIKELY(attr_map.id == ATTR_STD_NONE)) { @@ -71,7 +71,7 @@ ccl_device_inline AttributeDescriptor find_attribute(KernelGlobals kg, else { attr_offset += ATTR_PRIM_TYPES; } - attr_map = kernel_tex_fetch(__attributes_map, attr_offset); + attr_map = kernel_data_fetch(attributes_map, attr_offset); } AttributeDescriptor desc; @@ -99,9 +99,9 @@ ccl_device Transform primitive_attribute_matrix(KernelGlobals kg, { Transform tfm; - tfm.x = kernel_tex_fetch(__attributes_float4, desc.offset + 0); - tfm.y = kernel_tex_fetch(__attributes_float4, desc.offset + 1); - tfm.z = kernel_tex_fetch(__attributes_float4, desc.offset + 2); + tfm.x = kernel_data_fetch(attributes_float4, desc.offset + 0); + tfm.y = kernel_data_fetch(attributes_float4, desc.offset + 1); + tfm.z = kernel_data_fetch(attributes_float4, desc.offset + 2); return tfm; } |