[Bf-blender-cvs] [fa95d2e] soc-2016-cycles_images: Little tweaks for ifdefs.

Thomas Dinges noreply at git.blender.org
Thu May 19 02:59:17 CEST 2016


Commit: fa95d2e9228e08ef3a3913623a90e9ad32dbd0fe
Author: Thomas Dinges
Date:   Thu May 19 02:59:04 2016 +0200
Branches: soc-2016-cycles_images
https://developer.blender.org/rBfa95d2e9228e08ef3a3913623a90e9ad32dbd0fe

Little tweaks for ifdefs.

===================================================================

M	intern/cycles/kernel/kernel_textures.h
M	intern/cycles/kernel/svm/svm_image.h

===================================================================

diff --git a/intern/cycles/kernel/kernel_textures.h b/intern/cycles/kernel/kernel_textures.h
index f2467d5..245d236 100644
--- a/intern/cycles/kernel/kernel_textures.h
+++ b/intern/cycles/kernel/kernel_textures.h
@@ -72,6 +72,8 @@ KERNEL_TEX(float, texture_float, __lookup_table)
 /* sobol */
 KERNEL_TEX(uint, texture_uint, __sobol_directions)
 
+#ifdef __KERNEL_CUDA__
+#  if __CUDA_ARCH__ < 300
 /* full-float image */
 KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float4_000)
 KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float4_001)
@@ -175,9 +177,10 @@ KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_090)
 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_091)
 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_092)
 
+#  else
 /* bindless textures */
-#if defined(__KERNEL_CUDA__) && __CUDA_ARCH__ >= 300
 KERNEL_TEX(uint, texture_uint, __bindless_mapping)
+#  endif
 #endif
 
 /* packed image (opencl) */
diff --git a/intern/cycles/kernel/svm/svm_image.h b/intern/cycles/kernel/svm/svm_image.h
index cf101f0..92d2b36 100644
--- a/intern/cycles/kernel/svm/svm_image.h
+++ b/intern/cycles/kernel/svm/svm_image.h
@@ -155,7 +155,7 @@ ccl_device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y,
 #else
 	float4 r;
 
-#if __CUDA_ARCH__ < 300
+#  if __CUDA_ARCH__ < 300
 	/* not particularly proud of this massive switch, what are the
 	 * alternatives?
 	 * - use a single big 1D texture, and do our own lookup/filtering
@@ -263,7 +263,7 @@ ccl_device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y,
 			kernel_assert(0);
 			return make_float4(0.0f, 0.0f, 0.0f, 0.0f);
 	}
-#else
+#  else
 	CUtexObject tex = kernel_tex_fetch(__bindless_mapping, id);
 	if(id < 2048) /* TODO(dingto): Make this a variable */
 		r = kernel_tex_image_interp_float4(tex, x, y);
@@ -271,7 +271,7 @@ ccl_device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y,
 		float f = kernel_tex_image_interp_float(tex, x, y);
 		r = make_float4(f, f, f, 1.0);
 	}
-#endif
+#  endif
 #endif
 
 #ifdef __KERNEL_SSE2__




More information about the Bf-blender-cvs mailing list