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 * Licensed under the Apache License, Version 2.0 (the "License");
12 * you may not use this file except in compliance with the License.
13 * You may obtain a copy of the License at
15 * http://www.apache.org/licenses/LICENSE-2.0
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
23 *//*--------------------------------------------------------------------*/
25 #include "tcuDefs.hpp"
26 #include "tcuTestLog.hpp"
27 #include "deUniquePtr.hpp"
29 #include "vkMemUtil.hpp"
30 #include "vkQueryUtil.hpp"
38 class ComputeInstanceResultBuffer
43 DATA_SIZE = sizeof(tcu::Vec4[4])
46 ComputeInstanceResultBuffer (const vk::DeviceInterface &vki,
48 vk::Allocator &allocator,
49 float initValue = -1.0f);
51 void readResultContentsTo(tcu::Vec4 (* results)[4]) const;
53 void readResultContentsTo(deUint32* result) const;
55 inline vk::VkBuffer getBuffer(void) const { return *m_buffer; }
57 inline const vk::VkBufferMemoryBarrier* getResultReadBarrier(void) const { return &m_bufferBarrier; }
60 static vk::Move<vk::VkBuffer> createResultBuffer(const vk::DeviceInterface &vki,
62 vk::Allocator &allocator,
63 de::MovePtr<vk::Allocation>* outAllocation,
64 float initValue = -1.0f);
66 static vk::VkBufferMemoryBarrier createResultBufferBarrier(vk::VkBuffer buffer);
68 const vk::DeviceInterface & m_vki;
69 const vk::VkDevice m_device;
71 de::MovePtr<vk::Allocation> m_bufferMem;
72 const vk::Unique<vk::VkBuffer> m_buffer;
73 const vk::VkBufferMemoryBarrier m_bufferBarrier;
79 #endif // _VKTAPICOMPUTEINSTANCERESULTBUFFER_HPP