Revert "Cycles: Fix image textures were completely broken since recent unlimited textures commit"
This reverts commit 8f4166ee49
.
The fix was not correct for cases when we've got float textures.
This commit is contained in:
parent
06034b147a
commit
1ec59c8e06
|
@ -66,8 +66,7 @@ ccl_device_inline float svm_image_texture_frac(float x, int *ix)
|
|||
|
||||
ccl_device float4 kernel_tex_image_interp(KernelGlobals *kg, int id, float x, float y)
|
||||
{
|
||||
const int texture_id = kernel_tex_index(id);
|
||||
uint4 info = kernel_tex_fetch(__tex_image_packed_info, texture_id*2);
|
||||
uint4 info = kernel_tex_fetch(__tex_image_packed_info, id*2);
|
||||
uint width = info.x;
|
||||
uint height = info.y;
|
||||
uint offset = info.z;
|
||||
|
@ -144,12 +143,11 @@ ccl_device float4 kernel_tex_image_interp(KernelGlobals *kg, int id, float x, fl
|
|||
|
||||
ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals *kg, int id, float x, float y, float z)
|
||||
{
|
||||
const int texture_id = kernel_tex_index(id);
|
||||
uint4 info = kernel_tex_fetch(__tex_image_packed_info, texture_id*2);
|
||||
uint4 info = kernel_tex_fetch(__tex_image_packed_info, id*2);
|
||||
uint width = info.x;
|
||||
uint height = info.y;
|
||||
uint offset = info.z;
|
||||
uint depth = kernel_tex_fetch(__tex_image_packed_info, texture_id*2+1).x;
|
||||
uint depth = kernel_tex_fetch(__tex_image_packed_info, id*2+1).x;
|
||||
|
||||
/* Image Options */
|
||||
uint interpolation = (info.w & (1 << 0)) ? INTERPOLATION_CLOSEST : INTERPOLATION_LINEAR;
|
||||
|
|
|
@ -1049,8 +1049,6 @@ void ImageManager::device_pack_images(Device *device,
|
|||
+ tex_num_images[IMAGE_DATA_TYPE_FLOAT] + tex_num_images[IMAGE_DATA_TYPE_BYTE];
|
||||
uint4 *info = dscene->tex_image_packed_info.resize(info_size*2);
|
||||
|
||||
size_t index = 0;
|
||||
|
||||
/* Byte4 Textures*/
|
||||
type = IMAGE_DATA_TYPE_BYTE4;
|
||||
|
||||
|
@ -1072,8 +1070,9 @@ void ImageManager::device_pack_images(Device *device,
|
|||
|
||||
uint8_t options = pack_image_options(type, slot);
|
||||
|
||||
info[index++] = make_uint4(tex_img.data_width, tex_img.data_height, offset, options);
|
||||
info[index++] = make_uint4(tex_img.data_depth, 0, 0, 0);
|
||||
int index = type_index_to_flattened_slot(slot, type) * 2;
|
||||
info[index] = make_uint4(tex_img.data_width, tex_img.data_height, offset, options);
|
||||
info[index+1] = make_uint4(tex_img.data_depth, 0, 0, 0);
|
||||
|
||||
memcpy(pixels_byte4+offset, (void*)tex_img.data_pointer, tex_img.memory_size());
|
||||
offset += tex_img.size();
|
||||
|
@ -1103,8 +1102,9 @@ void ImageManager::device_pack_images(Device *device,
|
|||
|
||||
uint8_t options = pack_image_options(type, slot);
|
||||
|
||||
info[index++] = make_uint4(tex_img.data_width, tex_img.data_height, offset, options);
|
||||
info[index++] = make_uint4(tex_img.data_depth, 0, 0, 0);
|
||||
int index = type_index_to_flattened_slot(slot, type) * 2;
|
||||
info[index] = make_uint4(tex_img.data_width, tex_img.data_height, offset, options);
|
||||
info[index+1] = make_uint4(tex_img.data_depth, 0, 0, 0);
|
||||
|
||||
memcpy(pixels_float4+offset, (void*)tex_img.data_pointer, tex_img.memory_size());
|
||||
offset += tex_img.size();
|
||||
|
@ -1132,8 +1132,9 @@ void ImageManager::device_pack_images(Device *device,
|
|||
|
||||
uint8_t options = pack_image_options(type, slot);
|
||||
|
||||
info[index++] = make_uint4(tex_img.data_width, tex_img.data_height, offset, options);
|
||||
info[index++] = make_uint4(tex_img.data_depth, 0, 0, 0);
|
||||
int index = type_index_to_flattened_slot(slot, type) * 2;
|
||||
info[index] = make_uint4(tex_img.data_width, tex_img.data_height, offset, options);
|
||||
info[index+1] = make_uint4(tex_img.data_depth, 0, 0, 0);
|
||||
|
||||
memcpy(pixels_byte+offset, (void*)tex_img.data_pointer, tex_img.memory_size());
|
||||
offset += tex_img.size();
|
||||
|
@ -1163,8 +1164,9 @@ void ImageManager::device_pack_images(Device *device,
|
|||
|
||||
uint8_t options = pack_image_options(type, slot);
|
||||
|
||||
info[index++] = make_uint4(tex_img.data_width, tex_img.data_height, offset, options);
|
||||
info[index++] = make_uint4(tex_img.data_depth, 0, 0, 0);
|
||||
int index = type_index_to_flattened_slot(slot, type) * 2;
|
||||
info[index] = make_uint4(tex_img.data_width, tex_img.data_height, offset, options);
|
||||
info[index+1] = make_uint4(tex_img.data_depth, 0, 0, 0);
|
||||
|
||||
memcpy(pixels_float+offset, (void*)tex_img.data_pointer, tex_img.memory_size());
|
||||
offset += tex_img.size();
|
||||
|
|
Loading…
Reference in New Issue