There's more...

This is a straightforward example of the use of local shared memory. It is only slightly complicated by the fact that we need to deal with the extra row/column of pixels. In general, however, local shared data can be used for any type of communication between invocations within a work group. In this case, the data is not used for communication, but is instead used to increase efficiency by decreasing the global number of reads from the image.

Note that there are (sometimes stringent) limits on the size of shared memory. We can use GL_MAX_COMPUTE_SHARED_MEMORY_SIZE (via glGetInteger*) to query the maximum size available on the current hardware. The minimum required by the OpenGL specification is 32 KB.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.186.201