OpenCL equivalent GLSL single variables

What is the equivalent in OpenCL for homogeneous GLSL variables?

Where are the single variables located in the GPU memory in terms of OpenCL? When are they transferred from the host to the GPU?

I understand that the answer may depend on the specific OpenGL implementation, but I wonder if there are any rules or reasonable assumptions about this.

+4
source share
1 answer

In GLSL, uniforms are accessible from each stage of the shader and read-only instance. Thus, it shows the behavior of the corresponding global OpenCl memory. Given the constancy of these values ​​(that you cannot modify them inside shaders), it is, in particular, equal to __ OpenCL memory constant.

More information can be found here: http://www.opengl.org/wiki/Uniform_(GLSL) and here: http://www.khronos.org/registry/cl/sdk/1.2/docs/man/xhtml/ constant.html

__constant memory - . OpenCL- __constant , , . , ( __constant) __constant, .

OpenGL glUniformXX.

, . . OpenGL. UBO : http://www.lighthouse3d.com/tutorials/glsl-core-tutorial/3490-2/

+5

Source: https://habr.com/ru/post/1524681/


All Articles