1*b7893ccfSSadaf Ebrahimi // VK tests 2*b7893ccfSSadaf Ebrahimi // 3*b7893ccfSSadaf Ebrahimi // Copyright (c) 2015-2019 The Khronos Group Inc. 4*b7893ccfSSadaf Ebrahimi // Copyright (c) 2015-2019 Valve Corporation 5*b7893ccfSSadaf Ebrahimi // Copyright (c) 2015-2019 LunarG, Inc. 6*b7893ccfSSadaf Ebrahimi // Copyright (c) 2015-2019 Google, Inc. 7*b7893ccfSSadaf Ebrahimi // 8*b7893ccfSSadaf Ebrahimi // Licensed under the Apache License, Version 2.0 (the "License"); 9*b7893ccfSSadaf Ebrahimi // you may not use this file except in compliance with the License. 10*b7893ccfSSadaf Ebrahimi // You may obtain a copy of the License at 11*b7893ccfSSadaf Ebrahimi // 12*b7893ccfSSadaf Ebrahimi // http://www.apache.org/licenses/LICENSE-2.0 13*b7893ccfSSadaf Ebrahimi // 14*b7893ccfSSadaf Ebrahimi // Unless required by applicable law or agreed to in writing, software 15*b7893ccfSSadaf Ebrahimi // distributed under the License is distributed on an "AS IS" BASIS, 16*b7893ccfSSadaf Ebrahimi // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17*b7893ccfSSadaf Ebrahimi // See the License for the specific language governing permissions and 18*b7893ccfSSadaf Ebrahimi // limitations under the License. 19*b7893ccfSSadaf Ebrahimi 20*b7893ccfSSadaf Ebrahimi #ifndef VKTESTFRAMEWORKANDROID_H 21*b7893ccfSSadaf Ebrahimi #define VKTESTFRAMEWORKANDROID_H 22*b7893ccfSSadaf Ebrahimi 23*b7893ccfSSadaf Ebrahimi #include "spirv-tools/libspirv.h" 24*b7893ccfSSadaf Ebrahimi #include "test_common.h" 25*b7893ccfSSadaf Ebrahimi 26*b7893ccfSSadaf Ebrahimi #if defined(NDEBUG) 27*b7893ccfSSadaf Ebrahimi #define U_ASSERT_ONLY __attribute__((unused)) 28*b7893ccfSSadaf Ebrahimi #else 29*b7893ccfSSadaf Ebrahimi #define U_ASSERT_ONLY 30*b7893ccfSSadaf Ebrahimi #endif 31*b7893ccfSSadaf Ebrahimi 32*b7893ccfSSadaf Ebrahimi // Can be used by tests to record additional details / description of test 33*b7893ccfSSadaf Ebrahimi #define TEST_DESCRIPTION(desc) RecordProperty("description", desc) 34*b7893ccfSSadaf Ebrahimi 35*b7893ccfSSadaf Ebrahimi #define ICD_SPV_MAGIC 0x07230203 36*b7893ccfSSadaf Ebrahimi 37*b7893ccfSSadaf Ebrahimi class VkTestFramework : public ::testing::Test { 38*b7893ccfSSadaf Ebrahimi public: 39*b7893ccfSSadaf Ebrahimi VkTestFramework(); 40*b7893ccfSSadaf Ebrahimi ~VkTestFramework(); 41*b7893ccfSSadaf Ebrahimi 42*b7893ccfSSadaf Ebrahimi static void InitArgs(int *argc, char *argv[]); 43*b7893ccfSSadaf Ebrahimi static void Finish(); 44*b7893ccfSSadaf Ebrahimi 45*b7893ccfSSadaf Ebrahimi VkFormat GetFormat(VkInstance instance, vk_testing::Device *device); 46*b7893ccfSSadaf Ebrahimi bool GLSLtoSPV(const VkShaderStageFlagBits shader_type, const char *pshader, std::vector<unsigned int> &spv, 47*b7893ccfSSadaf Ebrahimi bool debug = false); 48*b7893ccfSSadaf Ebrahimi bool ASMtoSPV(const spv_target_env target_env, const uint32_t options, const char *pasm, std::vector<unsigned int> &spv); 49*b7893ccfSSadaf Ebrahimi static bool m_devsim_layer; 50*b7893ccfSSadaf Ebrahimi static bool m_khronos_layer_disable; 51*b7893ccfSSadaf Ebrahimi static ANativeWindow *window; 52*b7893ccfSSadaf Ebrahimi }; 53*b7893ccfSSadaf Ebrahimi 54*b7893ccfSSadaf Ebrahimi class TestEnvironment : public ::testing::Environment { 55*b7893ccfSSadaf Ebrahimi public: 56*b7893ccfSSadaf Ebrahimi void SetUp(); 57*b7893ccfSSadaf Ebrahimi 58*b7893ccfSSadaf Ebrahimi void TearDown(); 59*b7893ccfSSadaf Ebrahimi }; 60*b7893ccfSSadaf Ebrahimi 61*b7893ccfSSadaf Ebrahimi #endif 62