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/triangle_intersect.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/triangle_intersect.h')
-rw-r--r-- | intern/cycles/kernel/geom/triangle_intersect.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/intern/cycles/kernel/geom/triangle_intersect.h b/intern/cycles/kernel/geom/triangle_intersect.h index fe531e6868a..0c76de9ccc7 100644 --- a/intern/cycles/kernel/geom/triangle_intersect.h +++ b/intern/cycles/kernel/geom/triangle_intersect.h @@ -23,17 +23,17 @@ ccl_device_inline bool triangle_intersect(KernelGlobals kg, int prim, int prim_addr) { - const uint tri_vindex = kernel_tex_fetch(__tri_vindex, prim).w; - const float3 tri_a = kernel_tex_fetch(__tri_verts, tri_vindex + 0), - tri_b = kernel_tex_fetch(__tri_verts, tri_vindex + 1), - tri_c = kernel_tex_fetch(__tri_verts, tri_vindex + 2); + const uint tri_vindex = kernel_data_fetch(tri_vindex, prim).w; + const float3 tri_a = kernel_data_fetch(tri_verts, tri_vindex + 0), + tri_b = kernel_data_fetch(tri_verts, tri_vindex + 1), + tri_c = kernel_data_fetch(tri_verts, tri_vindex + 2); float t, u, v; if (ray_triangle_intersect(P, dir, tmax, tri_a, tri_b, tri_c, &u, &v, &t)) { #ifdef __VISIBILITY_FLAG__ /* Visibility flag test. we do it here under the assumption * that most triangles are culled by node flags. */ - if (kernel_tex_fetch(__prim_visibility, prim_addr) & visibility) + if (kernel_data_fetch(prim_visibility, prim_addr) & visibility) #endif { isect->object = object; @@ -66,10 +66,10 @@ ccl_device_inline bool triangle_intersect_local(KernelGlobals kg, ccl_private uint *lcg_state, int max_hits) { - const uint tri_vindex = kernel_tex_fetch(__tri_vindex, prim).w; - const float3 tri_a = kernel_tex_fetch(__tri_verts, tri_vindex + 0), - tri_b = kernel_tex_fetch(__tri_verts, tri_vindex + 1), - tri_c = kernel_tex_fetch(__tri_verts, tri_vindex + 2); + const uint tri_vindex = kernel_data_fetch(tri_vindex, prim).w; + const float3 tri_a = kernel_data_fetch(tri_verts, tri_vindex + 0), + tri_b = kernel_data_fetch(tri_verts, tri_vindex + 1), + tri_c = kernel_data_fetch(tri_verts, tri_vindex + 2); float t, u, v; if (!ray_triangle_intersect(P, dir, tmax, tri_a, tri_b, tri_c, &u, &v, &t)) { return false; @@ -139,10 +139,10 @@ ccl_device_inline float3 triangle_point_from_uv(KernelGlobals kg, const float u, const float v) { - const uint tri_vindex = kernel_tex_fetch(__tri_vindex, isect_prim).w; - const packed_float3 tri_a = kernel_tex_fetch(__tri_verts, tri_vindex + 0), - tri_b = kernel_tex_fetch(__tri_verts, tri_vindex + 1), - tri_c = kernel_tex_fetch(__tri_verts, tri_vindex + 2); + const uint tri_vindex = kernel_data_fetch(tri_vindex, isect_prim).w; + const packed_float3 tri_a = kernel_data_fetch(tri_verts, tri_vindex + 0), + tri_b = kernel_data_fetch(tri_verts, tri_vindex + 1), + tri_c = kernel_data_fetch(tri_verts, tri_vindex + 2); float w = 1.0f - u - v; float3 P = u * tri_a + v * tri_b + w * tri_c; |