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
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user