How to use imageblock_slice

Is there a working example of imageblock_slice with implicit layout somewhere?

I get a compilation error when i write this:

imageblock_slilce<half4> color_slice = img_blk.slice(frag->color);

Error:

No matching member function for call to 'slice'
candidate template ignored: couldn't infer template argument 'E'
candidate function template not viable: requires 2 arguments, but 1 was provided

Too few template arguments for class template 'imageblock_slice'

It seems the syntax has changed since the Imageblocks presentation https://developer.apple.com/videos/play/tech-talks/603/

I tried supplying the struct type of the image block between <> but it still does not work.

Answered by OctoBHVR in 818811022

After some try and fail:

img_block.slice<half4>(0)

0 because i am reading from color attachment 0;

Accepted Answer

After some try and fail:

img_block.slice<half4>(0)

0 because i am reading from color attachment 0;

How to use imageblock_slice
 
 
Q