15db71995Sopenharmony_ci/*
25db71995Sopenharmony_ci * Copyright (c) 2021 The Khronos Group Inc.
35db71995Sopenharmony_ci * Copyright (c) 2021 Valve Corporation
45db71995Sopenharmony_ci * Copyright (c) 2021 LunarG, Inc.
55db71995Sopenharmony_ci *
65db71995Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a copy
75db71995Sopenharmony_ci * of this software and/or associated documentation files (the "Materials"), to
85db71995Sopenharmony_ci * deal in the Materials without restriction, including without limitation the
95db71995Sopenharmony_ci * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
105db71995Sopenharmony_ci * sell copies of the Materials, and to permit persons to whom the Materials are
115db71995Sopenharmony_ci * furnished to do so, subject to the following conditions:
125db71995Sopenharmony_ci *
135db71995Sopenharmony_ci * The above copyright notice(s) and this permission notice shall be included in
145db71995Sopenharmony_ci * all copies or substantial portions of the Materials.
155db71995Sopenharmony_ci *
165db71995Sopenharmony_ci * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
175db71995Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
185db71995Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
195db71995Sopenharmony_ci *
205db71995Sopenharmony_ci * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
215db71995Sopenharmony_ci * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
225db71995Sopenharmony_ci * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE
235db71995Sopenharmony_ci * USE OR OTHER DEALINGS IN THE MATERIALS.
245db71995Sopenharmony_ci *
255db71995Sopenharmony_ci * Author: Charles Giessen <charles@lunarg.com>
265db71995Sopenharmony_ci */
275db71995Sopenharmony_ci
285db71995Sopenharmony_ci#pragma once
295db71995Sopenharmony_ci
305db71995Sopenharmony_ci#include "test_util.h"
315db71995Sopenharmony_ci
325db71995Sopenharmony_cistruct LayerDefinition {
335db71995Sopenharmony_ci    BUILDER_VALUE(LayerDefinition, std::string, layerName, {})
345db71995Sopenharmony_ci    BUILDER_VALUE(LayerDefinition, uint32_t, specVersion, VK_API_VERSION_1_0)
355db71995Sopenharmony_ci    BUILDER_VALUE(LayerDefinition, uint32_t, implementationVersion, VK_API_VERSION_1_0)
365db71995Sopenharmony_ci    BUILDER_VALUE(LayerDefinition, std::string, description, {})
375db71995Sopenharmony_ci    BUILDER_VECTOR(LayerDefinition, Extension, extensions, extension)
385db71995Sopenharmony_ci
395db71995Sopenharmony_ci    VkLayerProperties get() const noexcept {
405db71995Sopenharmony_ci        VkLayerProperties props{};
415db71995Sopenharmony_ci        copy_string_to_char_array(layerName, &props.layerName[0], VK_MAX_EXTENSION_NAME_SIZE);
425db71995Sopenharmony_ci        props.specVersion = specVersion;
435db71995Sopenharmony_ci        props.implementationVersion = implementationVersion;
445db71995Sopenharmony_ci        copy_string_to_char_array(description, &props.description[0], VK_MAX_DESCRIPTION_SIZE);
455db71995Sopenharmony_ci        return props;
465db71995Sopenharmony_ci    }
475db71995Sopenharmony_ci};
48