Lines Matching defs:buffer
66 /** Represents buffer instance
67 * Provides basic buffer functionality
77 MoveMapOwner(Buffer* buffer_, glw::GLvoid* data_) : buffer(buffer_), data(data_)
81 Buffer* buffer;
98 MapOwner(Buffer& buffer, glw::GLvoid* data);
142 static void GetNamedParameter(const glw::Functions& gl, glw::GLuint buffer, glw::GLenum pname, glw::GLint* data);
494 /** Initialize buffer instance
503 /* Delete previous buffer instance */
515 /** Initialize buffer instance
524 /* Delete previous buffer instance */
536 /** Release buffer instance
550 /** Binds buffer to its target
560 /** Binds indexed buffer
571 /** Binds range of buffer
584 /** Maps contents of buffer into CPU space
603 /** Unmaps contents of buffer
634 /** Bind buffer to given target
637 * @param id Id of buffer
646 /** Binds indexed buffer
649 * @param id Id of buffer
659 /** Binds buffer range
662 * @param id Id of buffer
675 /** Allocate memory for buffer and sends initial content
690 /** Generate buffer
693 * @param out_id Id of buffer
710 /** Query parameter of named buffer
713 * @param buffer Buffer name
717 void Buffer::GetNamedParameter(const glw::Functions& gl, glw::GLuint buffer, glw::GLenum pname, glw::GLint* data)
719 gl.getNamedBufferParameteriv(buffer, pname, data);
723 /** Query parameter of bound buffer
736 /** Get contents of buffer's region
740 * @param offset Offset in buffer
751 /** Maps buffer content
767 /** Maps buffer content
784 /** Allocate immutable memory for buffer and sends initial content
799 /** Update range of buffer
803 * @param offset Offset in buffer
814 /** Unmaps buffer
828 * @param buffer Mapped buffer
831 Buffer::MapOwner::MapOwner(Buffer& buffer, glw::GLvoid* data) : m_data(data), m_buffer(&buffer)
836 Buffer::MapOwner::MapOwner(const Buffer::MoveMapOwner& moveOwner) : m_data(moveOwner.data), m_buffer(moveOwner.buffer)
852 * Unmaps buffer
1681 * BufferData if buffer already have immutable store;
1687 Buffer buffer(m_context);
1688 buffer.InitStorage(GL_ARRAY_BUFFER, GL_DYNAMIC_STORAGE_BIT, data_size, data);
1693 gl.namedBufferStorage(buffer.m_id, data_size, data, GL_DYNAMIC_STORAGE_BIT);
1699 Buffer::Bind(gl, buffer.m_id, GL_ARRAY_BUFFER);
1715 Buffer buffer(m_context);
1716 gl.createBuffers(1, &buffer.m_id);
1721 gl.namedBufferStorage(buffer.m_id, 0 /* size */, data, GL_DYNAMIC_STORAGE_BIT);
1724 gl.namedBufferStorage(buffer.m_id, -16 /* size */, data, GL_DYNAMIC_STORAGE_BIT);
1729 Buffer::Bind(gl, buffer.m_id, GL_ARRAY_BUFFER);
1749 Buffer buffer(m_context);
1750 gl.createBuffers(1, &buffer.m_id);
1755 gl.namedBufferStorage(buffer.m_id, data_size, data, GL_MAP_PERSISTENT_BIT);
1761 Buffer::Bind(gl, buffer.m_id, GL_ARRAY_BUFFER);
1777 Buffer buffer(m_context);
1778 gl.createBuffers(1, &buffer.m_id);
1783 gl.namedBufferStorage(buffer.m_id, data_size, data, GL_MAP_COHERENT_BIT);
1789 Buffer::Bind(gl, buffer.m_id, GL_ARRAY_BUFFER);
1803 * is included in <access> and not in buffer's storage flags;
1809 Buffer buffer(m_context);
1810 buffer.InitStorage(GL_ARRAY_BUFFER, GL_DYNAMIC_STORAGE_BIT, data_size, data);
1815 gl.mapNamedBufferRange(buffer.m_id, 0 /* offset */, data_size, GL_MAP_READ_BIT);
1820 gl.mapNamedBufferRange(buffer.m_id, 0 /* offset */, data_size, GL_MAP_WRITE_BIT);
1825 gl.mapNamedBufferRange(buffer.m_id, 0 /* offset */, data_size, GL_MAP_PERSISTENT_BIT);
1830 gl.mapNamedBufferRange(buffer.m_id, 0 /* offset */, data_size, GL_MAP_COHERENT_BIT);
1837 Buffer::Bind(gl, buffer.m_id, GL_ARRAY_BUFFER);
1868 * when buffer has immutable store but its flags does not include
1875 Buffer buffer(m_context);
1876 buffer.InitStorage(GL_ARRAY_BUFFER, GL_MAP_READ_BIT | GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT, data_size,
1882 gl.namedBufferSubData(buffer.m_id, 0 /* offset */, data_size, data);
1888 Buffer::Bind(gl, buffer.m_id, GL_ARRAY_BUFFER);
2015 Buffer buffer(m_context);
2017 buffer.InitStorage(GL_ARRAY_BUFFER, flags, data_size, data);
2018 Buffer::Bind(gl, buffer.m_id, GL_ARRAY_BUFFER);
2022 Buffer::GetNamedParameter(gl, buffer.m_id, GL_BUFFER_STORAGE_FLAGS, &queried_flags);
2023 Buffer::GetNamedParameter(gl, buffer.m_id, GL_BUFFER_IMMUTABLE_STORAGE, &queried_immutable);
2024 Buffer::GetNamedParameter(gl, buffer.m_id, GL_BUFFER_SIZE, &queried_size);
2102 Buffer::MapOwner tmp(buffer.MapRange(0 /* offset */, data_size, access));
2106 Buffer::GetNamedParameter(gl, buffer.m_id, GL_BUFFER_ACCESS_FLAGS, &queried_access);
2180 * - prepare 64 bytes immutable buffer filled with value 1; Bind the buffer to
2182 * - prepare 64 bytes immutable buffer filled with value 2; Do not set
2183 * DYNAMIC_STORAGE_BIT for <flags>; Bind the buffer to COPY_WRITE_BUFFER;
2184 * - execute BufferSubData to update COPY_WRITE_BUFFER buffer with 64 bytes
2186 * - inspect contents of buffer to verify it is filled with 2;
2189 * - inspect contents of buffer to verify it is filled with 1;
2251 << "CopyBufferSubData stored invalid contents in write target buffer."
2257 * - delete buffer and create new one; This time <flags> should contain
2258 * DYNAMIC_STORAGE_BIT; Bind the buffer to COPY_WRITE_BUFFER;
2259 * - execute BufferSubData to update COPY_WRITE_BUFFER buffer with 64 bytes
2261 * - inspect contents of buffer to verify it is filled with 3;
2292 << "BufferSubData stored invalid contents in write target buffer."
2316 : TestCase(context, "map_persistent_buffer_sub_data", "Test sub buffer operations against mapped buffer")
2362 /* Prepare buffer */
2363 Buffer buffer(m_context);
2364 buffer.InitStorage(GL_ARRAY_BUFFER,
2367 buffer.Bind();
2370 * - execute tested operation, to update whole buffer with incrementing values
2386 gl.namedBufferSubData(buffer.m_id, 0 /* offset */, data_size, incrementing_data);
2390 gl.namedBufferSubData(buffer.m_id, 0 /* offset */, data_size, incrementing_data);
2404 * - map buffer contents with MapBufferRange; <access> should contain
2408 * - execute tested operation, to update portions of buffer specified below;
2412 const Buffer::MapOwner map(buffer.MapRange(mapped_region_offset, mapped_region_size,
2443 gl.namedBufferSubData(buffer.m_id, offset, size, incrementing_data);
2460 * - unmap buffer;
2461 * - map buffer contents again, this time do not provide MAP_PERSISTENT_BIT;
2468 buffer.MapRange(mapped_region_offset, mapped_region_size, GL_MAP_READ_BIT | GL_MAP_WRITE_BIT));
2494 gl.namedBufferSubData(buffer.m_id, offset, size, incrementing_data);
2531 : TestCase(context, "map_persistent_texture", "Test texture operations against mapped buffer")
2566 /* Prepare buffer */
2567 Buffer buffer(m_context);
2568 buffer.InitStorage(GL_PIXEL_UNPACK_BUFFER, GL_MAP_PERSISTENT_BIT | GL_MAP_READ_BIT | GL_MAP_WRITE_BIT, data_size,
2581 bool result = verifyTestedOperation(operation, buffer, GL_NO_ERROR);
2594 * - map buffer contents with MapBufferRange, <access> should contain
2604 buffer.MapRange(0 /* offset */, data_size, GL_MAP_PERSISTENT_BIT | GL_MAP_READ_BIT | GL_MAP_WRITE_BIT));
2608 bool result = verifyTestedOperation(operation, buffer, GL_NO_ERROR);
2692 * @param buffer Buffer that will be used as GL_PIXEL_UNPACK_BUFFER
2697 bool MapPersistentTextureTest::verifyTestedOperation(TESTED_OPERATION operation, Buffer& buffer,
2730 /* Bind buffer to PIXEL_UNPACK */
2731 Buffer::Bind(gl, buffer.m_id, GL_PIXEL_UNPACK_BUFFER);
2739 0 /* offset to pixel unpack buffer */);
2745 0 /* offset to pixel unpack buffer */);
2753 0 /* offset to pixel unpack buffer */);
2764 GL_UNSIGNED_BYTE, 0 /* offset to pixel unpack buffer */);
2769 GL_UNSIGNED_BYTE, 0 /* offset to pixel unpack buffer */);
2776 /* Unbind buffer */
2799 : TestCase(context, "map_persistent_read_pixels", "Test read pixels operation against mapped buffer")
2829 Buffer buffer(m_context);
2833 buffer.InitStorage(GL_PIXEL_PACK_BUFFER, GL_MAP_PERSISTENT_BIT | GL_MAP_READ_BIT | GL_MAP_WRITE_BIT, data_size,
2847 * - execute ReadPixels to transfer texture contents to buffer, no error should
2850 buffer.Bind();
2853 GLU_EXPECT_NO_ERROR(gl.getError(), "ReadPixels to not mapped PIXEL_PACK buffer");
2857 * - map buffer contents with MapBufferRange, <access> should contain
2859 * - execute ReadPixels to transfer texture contents to buffer, no error should
2862 * - inspect contents of mapped buffer, to verify that latest data transfer was
2864 * - unmap buffer
2871 buffer.MapRange(0 /* offset */, data_size, GL_MAP_PERSISTENT_BIT | GL_MAP_READ_BIT | GL_MAP_WRITE_BIT));
2873 buffer.Bind();
2876 GLU_EXPECT_NO_ERROR(gl.getError(), "ReadPixels to persistently mapped PIXEL_PACK buffer");
2889 << tcu::TestLog::Message << "Wrong contents of persistently mapped PIXEL_PACK buffer after ReadPixels"
2895 * - map buffer contents again, this time do not provide MAP_PERSISTENT_BIT;
2896 * - execute ReadPixels to transfer texture contents to buffer,
2900 Buffer::MapOwner tmp(buffer.MapRange(0 /* offset */, data_size, GL_MAP_READ_BIT | GL_MAP_WRITE_BIT));
2902 buffer.Bind();
2913 "PIXEL_PACK buffer is mapped. Got: "
2937 : TestCase(context, "map_persistent_dispatch", "test dispatch operation against mapped buffer")
2965 "layout (binding = 0, std430) buffer DestinationData {\n"
2969 "layout (binding = 1, std430) buffer SourceData {\n"
3038 * - modify contents of source buffer via mapped memory;
3040 * - inspect contents of destination buffer via mapped memory; It is expected
3041 * that it will contain results based on original content of source buffer;
3044 * - inspect contents of destination buffer via mapped memory; It is expected
3045 * that it will contain results based on modified content of source buffer.
3085 /* Modify source buffer via mapped area */
3125 : TestCase(context, "map_persistent_flush", "Test mapped buffer against flushing")
3140 "layout (binding = 0, std430) buffer DestinationData {\n"
3144 "layout (binding = 1, std430) buffer SourceData {\n"
3213 * - modify contents of source buffer via mapped memory;
3215 * - inspect contents of destination buffer via mapped memory; It is expected
3216 * that it will contain results based on original content of source buffer;
3219 * - inspect contents of destination buffer via mapped memory; It is expected
3220 * that it will contain results based on modified content of source buffer.
3260 /* Modify source buffer via mapped area */
3264 * - apply FlushMappedBufferRange to ensure that modifications of source buffer
3311 : TestCase(context, "map_persistent_draw", "Test draw operation against mapped buffer")
3339 * - define single uniform buffer array "rectangles" with unspecified size;
3523 * - modify "rectangles" buffer via mapped memory with the following two sets
3526 * - modify "atom_color" buffer via mapped memory to value 1;
3534 * - modify "rectangles" buffer via mapped memory with the following two sets
3537 * - modify "atom_color" buffer via mapped memory to value 5;
3618 << tcu::TestLog::Image("Framebuffer", "Framebuffer contents using initial buffer data", img);
3627 << "Contents of ATOMIC_COUNTER buffer are invalid."
3671 << tcu::TestLog::Image("Framebuffer", "Framebuffer contents using updated buffer data", img);
3680 << "Contents of ATOMIC_COUNTER buffer are invalid."
3705 : TestCaseGroup(context, "buffer_storage", "Verifies \"buffer storage\" functionality")