Hash :
17448956
Author :
Date :
2017-01-05T15:48:26
Vulkan: vertex attributes in client memory. Support vertex data stored in client memory passed to glVertexAttribPointer. Only GL_FLOAT data is supported at this time. Includes a simple test. BUG=angleproject:1683 Change-Id: I3bc0cdefe02b02c046b0e85822019a0f1762235e Reviewed-on: https://chromium-review.googlesource.com/425137 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
//
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// StreamingBuffer:
// Create, map and flush buffers as needed to hold data, returning a handle and offset for each
// chunk.
//
#ifndef LIBANGLE_RENDERER_VULKAN_STREAMING_BUFFER_H_
#define LIBANGLE_RENDERER_VULKAN_STREAMING_BUFFER_H_
#include "libANGLE/renderer/vulkan/vk_utils.h"
namespace rx
{
class StreamingBuffer : public ResourceVk
{
public:
StreamingBuffer(VkBufferUsageFlags usage, size_t minSize);
~StreamingBuffer();
gl::Error allocate(ContextVk *context,
size_t amount,
uint8_t **ptrOut,
VkBuffer *handleOut,
VkDeviceSize *offsetOut);
gl::Error flush(ContextVk *context);
void destroy(VkDevice device);
private:
VkBufferUsageFlags mUsage;
size_t mMinSize;
vk::Buffer mBuffer;
vk::DeviceMemory mMemory;
size_t mNextWriteOffset;
size_t mLastFlushOffset;
size_t mSize;
uint8_t *mMappedMemory;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_VULKAN_STREAMING_BUFFER_H_