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:
authorThomas Dinges <blender@dingto.org>2016-04-16 21:48:33 +0300
committerThomas Dinges <blender@dingto.org>2016-04-16 21:49:59 +0300
commit557544f2c452303ff4b4d3af96551841e4d79040 (patch)
tree06e0409ce904eecda37a6784977d652087c34afc /intern/cycles/kernel/svm/svm_image.h
parentb973911feeec1bf487b35245005406fb32018cbf (diff)
Cycles: Refactor Image Texture limits.
Instead of treating Fermi GPU limits as default, and overriding them for other devices, we now nicely set them for each platform. * Due to setting values for all platforms, we don't have to offset the slot id for OpenCL anymore, as the image manager wont add float images for OpenCL now. * Bugfix: TEX_NUM_FLOAT_IMAGES was always 5, even for CPU, so the code in svm_image.h clamped float textures with alpha on CPU after the 5th slot. Reviewers: #cycles, brecht Reviewed By: #cycles, brecht Subscribers: brecht Differential Revision: https://developer.blender.org/D1925
Diffstat (limited to 'intern/cycles/kernel/svm/svm_image.h')
-rw-r--r--intern/cycles/kernel/svm/svm_image.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/intern/cycles/kernel/svm/svm_image.h b/intern/cycles/kernel/svm/svm_image.h
index 8f2b9423b2c..07ab2f28577 100644
--- a/intern/cycles/kernel/svm/svm_image.h
+++ b/intern/cycles/kernel/svm/svm_image.h
@@ -16,6 +16,15 @@
CCL_NAMESPACE_BEGIN
+/* Float textures on various devices. */
+#if defined(__KERNEL_CPU__)
+ #define TEX_NUM_FLOAT_IMAGES TEX_NUM_FLOAT_IMAGES_CPU
+#elif defined(__KERNEL_CUDA__)
+ #define TEX_NUM_FLOAT_IMAGES TEX_NUM_FLOAT_IMAGES_CUDA
+#else
+ #define TEX_NUM_FLOAT_IMAGES TEX_NUM_FLOAT_IMAGES_OPENCL
+#endif
+
#ifdef __KERNEL_OPENCL__
/* For OpenCL all images are packed in a single array, and we do manual lookup
@@ -50,12 +59,6 @@ ccl_device_inline float svm_image_texture_frac(float x, int *ix)
ccl_device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, uint srgb, uint use_alpha)
{
- /* first slots are used by float textures, which are not supported here */
- if(id < TEX_NUM_FLOAT_IMAGES)
- return make_float4(1.0f, 0.0f, 1.0f, 1.0f);
-
- id -= TEX_NUM_FLOAT_IMAGES;
-
uint4 info = kernel_tex_fetch(__tex_image_packed_info, id);
uint width = info.x;
uint height = info.y;