Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEthan-Hall <Ethan1080>2022-03-23 17:45:32 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-03-23 22:06:12 +0300
commit4e56e738a8f35228873d6e84d9e9f8b0e7a74a59 (patch)
tree1cf9e7c59aa6cd2ad55ba953df0a6ef323527ab0 /intern/cycles/util
parentd67f9820b8f8376084adf5ad964c580c0944027f (diff)
Cycles: optimize CPU texture sampler interpolation
Use templates to optimize the CPU texture sampler to interpolate using float for single component datatypes instead of using float4 for all types. Differential Revision: https://developer.blender.org/D14424
Diffstat (limited to 'intern/cycles/util')
-rw-r--r--intern/cycles/util/types_float4.h1
-rw-r--r--intern/cycles/util/types_float4_impl.h5
2 files changed, 6 insertions, 0 deletions
diff --git a/intern/cycles/util/types_float4.h b/intern/cycles/util/types_float4.h
index 68ba787dac0..0e84dfa3d64 100644
--- a/intern/cycles/util/types_float4.h
+++ b/intern/cycles/util/types_float4.h
@@ -45,6 +45,7 @@ ccl_device_inline float4 make_float4(const int4 &i);
ccl_device_inline void print_float4(const char *label, const float4 &a);
#endif /* __KERNEL_GPU__ */
+ccl_device_inline float4 make_float4(float f);
CCL_NAMESPACE_END
#endif /* __UTIL_TYPES_FLOAT4_H__ */
diff --git a/intern/cycles/util/types_float4_impl.h b/intern/cycles/util/types_float4_impl.h
index de2e7cb7061..aa923eb038d 100644
--- a/intern/cycles/util/types_float4_impl.h
+++ b/intern/cycles/util/types_float4_impl.h
@@ -89,6 +89,11 @@ ccl_device_inline void print_float4(const char *label, const float4 &a)
{
printf("%s: %.8f %.8f %.8f %.8f\n", label, (double)a.x, (double)a.y, (double)a.z, (double)a.w);
}
+#else
+ccl_device_inline float4 make_float4(float f)
+{
+ return make_float4(f, f, f, f);
+}
#endif /* __KERNEL_GPU__ */
CCL_NAMESPACE_END