1 #ifndef _VKTAPICOMPUTEINSTANCERESULTBUFFER_HPP
2 #define _VKTAPICOMPUTEINSTANCERESULTBUFFER_HPP
3 /*-------------------------------------------------------------------------
4 * Vulkan Conformance Tests
5 * ------------------------
7 * Copyright (c) 2015 The Khronos Group Inc.
8 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
9 * Copyright (c) 2015 Google Inc.
11 * Permission is hereby granted, free of charge, to any person obtaining a
12 * copy of this software and/or associated documentation files (the
13 * "Materials"), to deal in the Materials without restriction, including
14 * without limitation the rights to use, copy, modify, merge, publish,
15 * distribute, sublicense, and/or sell copies of the Materials, and to
16 * permit persons to whom the Materials are furnished to do so, subject to
17 * the following conditions:
19 * The above copyright notice(s) and this permission notice shall be
20 * included in all copies or substantial portions of the Materials.
22 * The Materials are Confidential Information as defined by the
23 * Khronos Membership Agreement until designated non-confidential by
24 * Khronos, at which point this condition clause shall be removed.
26 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
29 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
30 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
31 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
32 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
34 *//*--------------------------------------------------------------------*/
36 #include "tcuDefs.hpp"
37 #include "tcuTestLog.hpp"
38 #include "deUniquePtr.hpp"
40 #include "vkMemUtil.hpp"
41 #include "vkQueryUtil.hpp"
49 class ComputeInstanceResultBuffer
54 DATA_SIZE = sizeof(tcu::Vec4[4])
57 ComputeInstanceResultBuffer (const vk::DeviceInterface &vki,
59 vk::Allocator &allocator);
61 void readResultContentsTo(tcu::Vec4 (* results)[4]) const;
63 inline vk::VkBuffer getBuffer(void) const { return *m_buffer; }
65 inline const void * getResultReadBarrier(void) const { return &m_bufferBarrier; }
68 static vk::Move<vk::VkBuffer> createResultBuffer(const vk::DeviceInterface &vki,
70 vk::Allocator &allocator,
71 de::MovePtr<vk::Allocation>* outAllocation);
73 static vk::VkBufferMemoryBarrier createResultBufferBarrier(vk::VkBuffer buffer);
75 const vk::DeviceInterface & m_vki;
76 const vk::VkDevice m_device;
78 de::MovePtr<vk::Allocation> m_bufferMem;
79 const vk::Unique<vk::VkBuffer> m_buffer;
80 const vk::VkBufferMemoryBarrier m_bufferBarrier;
86 #endif // _VKTAPICOMPUTEINSTANCERESULTBUFFER_HPP