169baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal#ifndef _VKTPROTECTEDMEMIMAGEVALIDATOR_HPP 269baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal#define _VKTPROTECTEDMEMIMAGEVALIDATOR_HPP 369baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal/*------------------------------------------------------------------------ 469baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * Vulkan Conformance Tests 569baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * ------------------------ 669baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * 769baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * Copyright (c) 2017 The Khronos Group Inc. 869baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * Copyright (c) 2017 Samsung Electronics Co., Ltd. 969baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * 1069baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * Licensed under the Apache License, Version 2.0 (the "License"); 1169baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * you may not use this file except in compliance with the License. 1269baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * You may obtain a copy of the License at 1369baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * 1469baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * http://www.apache.org/licenses/LICENSE-2.0 1569baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * 1669baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * Unless required by applicable law or agreed to in writing, software 1769baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * distributed under the License is distributed on an "AS IS" BASIS, 1869baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1969baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * See the License for the specific language governing permissions and 2069baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * limitations under the License. 2169baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * 2269baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal *//*! 2369baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * \file 2469baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal * \brief Protected Memory image validator helper 2569baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal *//*--------------------------------------------------------------------*/ 2669baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal 2769baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal#include "tcuVector.hpp" 2869baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal#include "vkDefs.hpp" 2969baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal#include "vktTestCase.hpp" 3069baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal 3169baa668275930f4e5fa19c29eb3501c1982e0bdPeter Galnamespace vkt 3269baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal{ 3369baa668275930f4e5fa19c29eb3501c1982e0bdPeter Galnamespace ProtectedMem 3469baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal{ 3569baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal 3669baa668275930f4e5fa19c29eb3501c1982e0bdPeter Galclass ProtectedContext; 3769baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal 3869baa668275930f4e5fa19c29eb3501c1982e0bdPeter Galstruct ValidationData { 39530477247e98397ee400d8413e339cf6e86860d5Janos Pantos tcu::Vec4 coords[4]; 40530477247e98397ee400d8413e339cf6e86860d5Janos Pantos tcu::Vec4 values[4]; 4169baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal}; 4269baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal 4369baa668275930f4e5fa19c29eb3501c1982e0bdPeter Galclass ImageValidator 4469baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal{ 4569baa668275930f4e5fa19c29eb3501c1982e0bdPeter Galpublic: 46530477247e98397ee400d8413e339cf6e86860d5Janos Pantos ImageValidator (vk::VkFormat imageFormat = vk::VK_FORMAT_R8G8B8A8_UNORM) 47530477247e98397ee400d8413e339cf6e86860d5Janos Pantos : m_imageFormat (imageFormat) 4869baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal {} 4969baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal ~ImageValidator () {} 5069baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal void initPrograms (vk::SourceCollections& programCollection) const; 5169baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal 5269baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal bool validateImage (ProtectedContext& ctx, 5369baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal const ValidationData& refData, 5469baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal const vk::VkImage image, 5569baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal const vk::VkFormat imageFormat) const; 56530477247e98397ee400d8413e339cf6e86860d5Janos Pantos 57530477247e98397ee400d8413e339cf6e86860d5Janos Pantosprivate: 58530477247e98397ee400d8413e339cf6e86860d5Janos Pantos const vk::VkFormat m_imageFormat; 5969baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal}; 6069baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal 6169baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal} // ProtectedMem 6269baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal} // vkt 6369baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal 6469baa668275930f4e5fa19c29eb3501c1982e0bdPeter Gal#endif // _VKTPROTECTEDMEMIMAGEVALIDATOR_HPP 65