1 #ifndef _VKTDRAWBUFFEROBJECTUTIL_HPP
2 #define _VKTDRAWBUFFEROBJECTUTIL_HPP
3 /*------------------------------------------------------------------------
4 * Vulkan Conformance Tests
5 * ------------------------
7 * Copyright (c) 2015 The Khronos Group Inc.
8 * Copyright (c) 2015 Intel Corporation
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
24 * \brief Buffer Object Util
25 *//*--------------------------------------------------------------------*/
27 #include "vkMemUtil.hpp"
28 #include "vkRefUtil.hpp"
30 #include "deSharedPtr.hpp"
41 static de::SharedPtr<Buffer> create (const vk::DeviceInterface& vk, vk::VkDevice device, const vk::VkBufferCreateInfo &createInfo);
43 static de::SharedPtr<Buffer> createAndAlloc (const vk::DeviceInterface& vk,
45 const vk::VkBufferCreateInfo& createInfo,
46 vk::Allocator& allocator,
47 vk::MemoryRequirement allocationMemoryProperties = vk::MemoryRequirement::Any);
49 Buffer (const vk::DeviceInterface &vk, vk::VkDevice device, vk::Move<vk::VkBuffer> object);
51 void bindMemory (de::MovePtr<vk::Allocation> allocation);
53 vk::VkBuffer object (void) const { return *m_object; }
54 vk::Allocation getBoundMemory (void) const { return *m_allocation; }
58 Buffer (const Buffer& other); // Not allowed!
59 Buffer& operator= (const Buffer& other); // Not allowed!
61 de::MovePtr<vk::Allocation> m_allocation;
62 vk::Unique<vk::VkBuffer> m_object;
64 const vk::DeviceInterface& m_vk;
65 vk::VkDevice m_device;
71 #endif // _VKTDRAWBUFFEROBJECTUTIL_HPP