Cycles: fix crash rendering textured objects in OpenCL

Issue was caused by changed order of texture slots -- float textures
have got lower slots indices than byte textures. OpenCL was still assuming
byte textures goes before float.
This commit is contained in:
Sergey Sharybin
2012-11-05 08:05:24 +00:00
parent 759ea40787
commit 540c9d4208
3 changed files with 10 additions and 1 deletions

View File

@@ -52,6 +52,12 @@ __device_inline float svm_image_texture_frac(float x, int *ix)
__device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, uint srgb)
{
/* 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;