 #else
             const Scalar *v = voxLine + BPV * vidx;
 #endif
+            // apply transfer function
+#ifdef FLOATDATA
+            const float4 c = tex1Dfetch(tex_tf, *v*255.f);
+#else
+            const float4 c = tex1Dfetch(tex_tf, *v);
+#endif
+#endif
+#endif
             // pointer to destination pixel
             uchar4 *pix = imgLine + iidx;
-            // apply transfer function
-#ifdef FLOATDATA
-            const float4 c = tex1Dfetch(tex_tf, *v*255.f);
-#else
-            const float4 c = tex1Dfetch(tex_tf, *v);
-#endif
-#endif
             uchar4 d = *pix;
 
             // blend

#define FLOATDATA
//#define CONSTLOAD
#define THREADPERVOXEL

const int Repetitions = 1;

#ifdef CONSTLOAD
#undef NOLOAD

            const int vidx = ix - iPosX;
            const int iidx = ix;
#endif
#ifdef CONSTDATA
            const float4 c = tex1Dfetch(tex_tf, ix);
#else
#ifdef SHMCLASS
            const uchar4 v = *(voxel + BPV * vidx);
            const float4 c = make_float4(v.x/255.f, v.y/255.f, v.z/255.f, v.w/255.f);
#else
            // fetch scalar voxel value
#ifdef SHMLOAD
