diff options
Diffstat (limited to 'intern/cycles/kernel/geom')
-rw-r--r-- | intern/cycles/kernel/geom/geom_volume.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/intern/cycles/kernel/geom/geom_volume.h b/intern/cycles/kernel/geom/geom_volume.h index ef02c01dec6..2044aafc877 100644 --- a/intern/cycles/kernel/geom/geom_volume.h +++ b/intern/cycles/kernel/geom/geom_volume.h @@ -29,7 +29,7 @@ CCL_NAMESPACE_BEGIN /* Return position normalized to 0..1 in mesh bounds */ -#ifdef __KERNEL_GPU__ +#if defined(__KERNEL_GPU__) && __CUDA_ARCH__ < 300 ccl_device float4 volume_image_texture_3d(int id, float x, float y, float z) { float4 r; @@ -65,7 +65,13 @@ ccl_device float volume_attribute_float(KernelGlobals *kg, const ShaderData *sd, { float3 P = volume_normalized_position(kg, sd, sd->P); #ifdef __KERNEL_GPU__ +# if __CUDA_ARCH__ >= 300 + CUtexObject tex = kernel_tex_fetch(__bindless_mapping, id); + float f = kernel_tex_image_interp_3d_float(tex, P.x, P.y, P.z); + float4 r = make_float4(f, f, f, 1.0); +# else float4 r = volume_image_texture_3d(id, P.x, P.y, P.z); +# endif #else float4 r; if(sd->flag & SD_VOLUME_CUBIC) @@ -84,7 +90,12 @@ ccl_device float3 volume_attribute_float3(KernelGlobals *kg, const ShaderData *s { float3 P = volume_normalized_position(kg, sd, sd->P); #ifdef __KERNEL_GPU__ +# if __CUDA_ARCH__ >= 300 + CUtexObject tex = kernel_tex_fetch(__bindless_mapping, id); + float4 r = kernel_tex_image_interp_3d_float4(tex, P.x, P.y, P.z); +# else float4 r = volume_image_texture_3d(id, P.x, P.y, P.z); +# endif #else float4 r; if(sd->flag & SD_VOLUME_CUBIC) |