• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _VKTPROTECTEDMEMIMAGEVALIDATOR_HPP
2 #define _VKTPROTECTEDMEMIMAGEVALIDATOR_HPP
3 /*------------------------------------------------------------------------
4  * Vulkan Conformance Tests
5  * ------------------------
6  *
7  * Copyright (c) 2017 The Khronos Group Inc.
8  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
9  *
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
13  *
14  *      http://www.apache.org/licenses/LICENSE-2.0
15  *
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.
21  *
22  *//*!
23  * \file
24  * \brief Protected Memory image validator helper
25  *//*--------------------------------------------------------------------*/
26 
27 #include "tcuVector.hpp"
28 #include "vkDefs.hpp"
29 #include "vktTestCase.hpp"
30 
31 namespace vkt
32 {
33 namespace ProtectedMem
34 {
35 
36 class ProtectedContext;
37 
38 struct ValidationData {
39 	tcu::Vec4	coords[4];
40 	tcu::Vec4	values[4];
41 };
42 
43 class ImageValidator
44 {
45 public:
ImageValidator(vk::VkFormat imageFormat=vk::VK_FORMAT_R8G8B8A8_UNORM)46 							ImageValidator	(vk::VkFormat imageFormat = vk::VK_FORMAT_R8G8B8A8_UNORM)
47 								: m_imageFormat	(imageFormat)
48 							{}
~ImageValidator()49 							~ImageValidator	() {}
50 	void					initPrograms	(vk::SourceCollections&	programCollection) const;
51 
52 	bool					validateImage	(ProtectedContext&		ctx,
53 											 const ValidationData&	refData,
54 											 const vk::VkImage		image,
55 											 const vk::VkFormat		imageFormat,
56 											 const vk::VkImageLayout imageLayout) const;
57 
58 private:
59 	const vk::VkFormat		m_imageFormat;
60 };
61 
62 } // ProtectedMem
63 } // vkt
64 
65 #endif // _VKTPROTECTEDMEMIMAGEVALIDATOR_HPP
66