Beispiel #1
0
        public static void SetFeedbackBuffer(int slot, GPUBuffer buf, int offset, int size)
        {
            while (feedbackBufs.Count <= slot)
            {
                feedbackBufs.Add(null);
            }

            feedbackBufs[slot] = new Tuple <GPUBuffer, int, int>(buf, offset, size);
        }
Beispiel #2
0
        public static void SetUniformBuffer(GPUBuffer buf, int bufIndex, int baseOff, int size)
        {
            if (buf.target != BufferTarget.UniformBuffer)
            {
                throw new ArgumentException("Argument must be a uniform buffer!");
            }

            GPUStateMachine.BindBuffer(BufferTarget.UniformBuffer, buf.id, bufIndex, (IntPtr)baseOff, (IntPtr)size);
        }
Beispiel #3
0
        public void SetBufferObject(int index, GPUBuffer buffer, int elementCount, VertexAttribPointerType type)
        {
            GPUStateMachine.BindVertexArray(id);

            GL.EnableVertexAttribArray(index);
            GPUStateMachine.BindBuffer(buffer.target, buffer.id);
            GL.VertexAttribPointer(index, elementCount, type, false, 0, 0);
            GPUStateMachine.UnbindBuffer(buffer.target);

            GPUStateMachine.UnbindVertexArray();
        }
Beispiel #4
0
        public static void SetIndexBuffer(GPUBuffer indices)
        {
            if (indices.target != BufferTarget.ElementArrayBuffer)
            {
                throw new ArgumentException("Argument must be an index buffer!");
            }

            if (curIndices != null && indices.id != curIndices.id)
            {
                GPUStateMachine.UnbindBuffer(BufferTarget.ElementArrayBuffer);
            }
            curIndices = indices;
        }
 public void SetStorage(GPUBuffer storage, SizedInternalFormat internalFormat)
 {
     GPUStateMachine.BindTexture(0, TextureTarget.TextureBuffer, id);
     GL.TexBuffer(TextureBufferTarget.TextureBuffer, internalFormat, storage.id);
     GPUStateMachine.UnbindTexture(0, TextureTarget.TextureBuffer);
 }
Beispiel #6
0
 public static void SetFeedbackBuffer(int slot, GPUBuffer buf)
 {
     SetFeedbackBuffer(slot, buf, 0, buf.size);
 }