Cycles: OpenCL 3d textures
ClosedPublic

Authored by Hristo Gueorguiev (nirved) on Oct 14 2016, 1:36 PM.

Diff Detail

Repository
rB Blender
Hristo Gueorguiev (nirved) retitled this revision from to Cycles: OpenCL 3d textures.Oct 14 2016, 1:36 PM
Hristo Gueorguiev (nirved) updated this object.
Hristo Gueorguiev (nirved) set the repository for this revision to rB Blender.

Haven't tested the patch but code looks ok to me. Nice work! Have you tested this with both Mega and Split OpenCL kernel?

Tested only Split kernel, Mega should work, kernel_image_opencl.h is included. There might be problems with CUDA though.

Edited: misunderstood patch.

OpenCL split kernel doesn't support volume rendering yet.

Fixed kernel_image_3d_interp calls for OpenCL.

Brecht Van Lommel (brecht) requested changes to this revision.EditedOct 20 2016, 11:29 PM

Seems generally fine except for one problem.

intern/cycles/device/device_memory.h
113–116 ↗(On Diff #7643)

I'm afraid this will not work for CUDA currently. For certain cards we still store all data as textures, and there is no builtin uint8 texture type (it's also a bit confusing with uint8_t but that's different).

The solution for that right now is to use a uint4 texture with double the size and adjust the indexing accordingly. We do that for other textures too.

I have plans to refactor this so we can also use an array of structs to store this kind of data, but until that is done we can't break CUDA on these older cards.

This revision now requires changes to proceed.Oct 20 2016, 11:29 PM

Switched back to uint4. Also fixed a bug - missing offset.

This revision is now accepted and ready to land.Oct 22 2016, 11:49 PM
This revision was automatically updated to reflect the committed changes.