CSharpGL.ShaderStorageBuffer.Binding C# (CSharp) Метод

Binding() публичный Метод

Bind this uniform buffer object and a uniform block to the same binding point.
public Binding ( ShaderProgram program, string storageBlockName, uint storageBlockBindingPoint ) : void
program ShaderProgram shader program.
storageBlockName string name of buffer block in shader.
storageBlockBindingPoint uint binding point maintained by OpenGL context.
Результат void
        public void Binding(ShaderProgram program, string storageBlockName, uint storageBlockBindingPoint)
        {
            if (glGetProgramResourceIndex == null) { glGetProgramResourceIndex = OpenGL.GetDelegateFor<OpenGL.glGetProgramResourceIndex>(); }
            if (glBindBufferBase == null) { glBindBufferBase = OpenGL.GetDelegateFor<OpenGL.glBindBufferBase>(); }
            if (glShaderStorageBlockBinding == null) { glShaderStorageBlockBinding = OpenGL.GetDelegateFor<OpenGL.glShaderStorageBlockBinding>(); }

            uint storageBlockIndex = glGetProgramResourceIndex(program.ProgramId, OpenGL.GL_SHADER_STORAGE_BLOCK, storageBlockName);
            glBindBufferBase(OpenGL.GL_SHADER_STORAGE_BUFFER, storageBlockBindingPoint, this.BufferId);
            glShaderStorageBlockBinding(program.ProgramId, storageBlockIndex, storageBlockBindingPoint);
        }