xref: /aosp_15_r20/external/deqp/external/vulkancts/vkscserver/vksJson.hpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1*35238bceSAndroid Build Coastguard Worker #ifndef _VKSJSON_HPP
2*35238bceSAndroid Build Coastguard Worker #define _VKSJSON_HPP
3*35238bceSAndroid Build Coastguard Worker 
4*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
5*35238bceSAndroid Build Coastguard Worker  * Vulkan CTS Framework
6*35238bceSAndroid Build Coastguard Worker  * --------------------
7*35238bceSAndroid Build Coastguard Worker  *
8*35238bceSAndroid Build Coastguard Worker  * Copyright (c) 2021 The Khronos Group Inc.
9*35238bceSAndroid Build Coastguard Worker  *
10*35238bceSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
11*35238bceSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
12*35238bceSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
13*35238bceSAndroid Build Coastguard Worker  *
14*35238bceSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
15*35238bceSAndroid Build Coastguard Worker  *
16*35238bceSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
17*35238bceSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
18*35238bceSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19*35238bceSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
20*35238bceSAndroid Build Coastguard Worker  * limitations under the License.
21*35238bceSAndroid Build Coastguard Worker  *
22*35238bceSAndroid Build Coastguard Worker  *-------------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker 
24*35238bceSAndroid Build Coastguard Worker #include "vksCommon.hpp"
25*35238bceSAndroid Build Coastguard Worker 
26*35238bceSAndroid Build Coastguard Worker #include "vkPrograms.hpp"
27*35238bceSAndroid Build Coastguard Worker 
28*35238bceSAndroid Build Coastguard Worker #include "vkDefs.hpp"
29*35238bceSAndroid Build Coastguard Worker using namespace vk;
30*35238bceSAndroid Build Coastguard Worker 
31*35238bceSAndroid Build Coastguard Worker namespace Json
32*35238bceSAndroid Build Coastguard Worker {
33*35238bceSAndroid Build Coastguard Worker class CharReader;
34*35238bceSAndroid Build Coastguard Worker }
35*35238bceSAndroid Build Coastguard Worker 
36*35238bceSAndroid Build Coastguard Worker namespace vksc_server
37*35238bceSAndroid Build Coastguard Worker {
38*35238bceSAndroid Build Coastguard Worker 
39*35238bceSAndroid Build Coastguard Worker struct VulkanPipelineStatistics;
40*35238bceSAndroid Build Coastguard Worker 
41*35238bceSAndroid Build Coastguard Worker namespace json
42*35238bceSAndroid Build Coastguard Worker {
43*35238bceSAndroid Build Coastguard Worker 
44*35238bceSAndroid Build Coastguard Worker struct Context
45*35238bceSAndroid Build Coastguard Worker {
46*35238bceSAndroid Build Coastguard Worker     Context();
47*35238bceSAndroid Build Coastguard Worker     ~Context();
48*35238bceSAndroid Build Coastguard Worker     std::unique_ptr<Json::CharReader> reader;
49*35238bceSAndroid Build Coastguard Worker };
50*35238bceSAndroid Build Coastguard Worker 
51*35238bceSAndroid Build Coastguard Worker void runGarbageCollection();
52*35238bceSAndroid Build Coastguard Worker 
53*35238bceSAndroid Build Coastguard Worker string writeJSON_VkGraphicsPipelineCreateInfo(const vk::VkGraphicsPipelineCreateInfo &pCreateInfo);
54*35238bceSAndroid Build Coastguard Worker string writeJSON_VkComputePipelineCreateInfo(const vk::VkComputePipelineCreateInfo &pCreateInfo);
55*35238bceSAndroid Build Coastguard Worker string writeJSON_VkRenderPassCreateInfo(const vk::VkRenderPassCreateInfo &pCreateInfo);
56*35238bceSAndroid Build Coastguard Worker string writeJSON_VkRenderPassCreateInfo2(const vk::VkRenderPassCreateInfo2 &pCreateInfo);
57*35238bceSAndroid Build Coastguard Worker string writeJSON_VkPipelineLayoutCreateInfo(const vk::VkPipelineLayoutCreateInfo &pCreateInfo);
58*35238bceSAndroid Build Coastguard Worker string writeJSON_VkDescriptorSetLayoutCreateInfo(const vk::VkDescriptorSetLayoutCreateInfo &pCreateInfo);
59*35238bceSAndroid Build Coastguard Worker string writeJSON_VkSamplerCreateInfo(const vk::VkSamplerCreateInfo &pCreateInfo);
60*35238bceSAndroid Build Coastguard Worker string writeJSON_VkSamplerYcbcrConversionCreateInfo(const vk::VkSamplerYcbcrConversionCreateInfo &pCreateInfo);
61*35238bceSAndroid Build Coastguard Worker string writeJSON_VkShaderModuleCreateInfo(const vk::VkShaderModuleCreateInfo &smCI);
62*35238bceSAndroid Build Coastguard Worker string writeJSON_VkDeviceObjectReservationCreateInfo(const vk::VkDeviceObjectReservationCreateInfo &dmrCI);
63*35238bceSAndroid Build Coastguard Worker string writeJSON_VkPipelineOfflineCreateInfo(const vk::VkPipelineOfflineCreateInfo &piInfo);
64*35238bceSAndroid Build Coastguard Worker string writeJSON_GraphicsPipeline_vkpccjson(
65*35238bceSAndroid Build Coastguard Worker     const std::string &filePrefix, uint32_t pipelineIndex, const vk::VkPipelineOfflineCreateInfo id,
66*35238bceSAndroid Build Coastguard Worker     const vk::VkGraphicsPipelineCreateInfo &gpCI, const vk::VkPhysicalDeviceFeatures2 &deviceFeatures2,
67*35238bceSAndroid Build Coastguard Worker     const std::vector<std::string> &deviceExtensions,
68*35238bceSAndroid Build Coastguard Worker     const std::map<vk::VkSamplerYcbcrConversion, vk::VkSamplerYcbcrConversionCreateInfo> &samplerYcbcrConversions,
69*35238bceSAndroid Build Coastguard Worker     const std::map<vk::VkSampler, vk::VkSamplerCreateInfo> &samplers,
70*35238bceSAndroid Build Coastguard Worker     const std::map<vk::VkDescriptorSetLayout, vk::VkDescriptorSetLayoutCreateInfo> &descriptorSetLayouts,
71*35238bceSAndroid Build Coastguard Worker     const std::map<vk::VkRenderPass, vk::VkRenderPassCreateInfo> &renderPasses,
72*35238bceSAndroid Build Coastguard Worker     const std::map<vk::VkRenderPass, vk::VkRenderPassCreateInfo2> &renderPasses2,
73*35238bceSAndroid Build Coastguard Worker     const std::map<vk::VkPipelineLayout, vk::VkPipelineLayoutCreateInfo> &pipelineLayouts);
74*35238bceSAndroid Build Coastguard Worker string writeJSON_ComputePipeline_vkpccjson(
75*35238bceSAndroid Build Coastguard Worker     const std::string &filePrefix, uint32_t pipelineIndex, const vk::VkPipelineOfflineCreateInfo id,
76*35238bceSAndroid Build Coastguard Worker     const vk::VkComputePipelineCreateInfo &cpCI, const vk::VkPhysicalDeviceFeatures2 &deviceFeatures2,
77*35238bceSAndroid Build Coastguard Worker     const std::vector<std::string> &deviceExtensions,
78*35238bceSAndroid Build Coastguard Worker     const std::map<vk::VkSamplerYcbcrConversion, vk::VkSamplerYcbcrConversionCreateInfo> &samplerYcbcrConversions,
79*35238bceSAndroid Build Coastguard Worker     const std::map<vk::VkSampler, vk::VkSamplerCreateInfo> &samplers,
80*35238bceSAndroid Build Coastguard Worker     const std::map<vk::VkDescriptorSetLayout, vk::VkDescriptorSetLayoutCreateInfo> &descriptorSetLayouts,
81*35238bceSAndroid Build Coastguard Worker     const std::map<vk::VkPipelineLayout, vk::VkPipelineLayoutCreateInfo> &pipelineLayouts);
82*35238bceSAndroid Build Coastguard Worker string writeJSON_VkPhysicalDeviceFeatures2(const vk::VkPhysicalDeviceFeatures2 &features);
83*35238bceSAndroid Build Coastguard Worker string writeJSON_pNextChain(const void *pNext);
84*35238bceSAndroid Build Coastguard Worker 
85*35238bceSAndroid Build Coastguard Worker void readJSON_VkGraphicsPipelineCreateInfo(Context &context, const string &graphicsPipelineCreateInfo,
86*35238bceSAndroid Build Coastguard Worker                                            vk::VkGraphicsPipelineCreateInfo &gpCI);
87*35238bceSAndroid Build Coastguard Worker void readJSON_VkComputePipelineCreateInfo(Context &context, const string &computePipelineCreateInfo,
88*35238bceSAndroid Build Coastguard Worker                                           vk::VkComputePipelineCreateInfo &cpCI);
89*35238bceSAndroid Build Coastguard Worker void readJSON_VkRenderPassCreateInfo(Context &context, const string &renderPassCreateInfo,
90*35238bceSAndroid Build Coastguard Worker                                      vk::VkRenderPassCreateInfo &rpCI);
91*35238bceSAndroid Build Coastguard Worker void readJSON_VkRenderPassCreateInfo2(Context &context, const string &renderPassCreateInfo,
92*35238bceSAndroid Build Coastguard Worker                                       vk::VkRenderPassCreateInfo2 &rpCI);
93*35238bceSAndroid Build Coastguard Worker void readJSON_VkDescriptorSetLayoutCreateInfo(Context &context, const string &descriptorSetLayoutCreateInfo,
94*35238bceSAndroid Build Coastguard Worker                                               vk::VkDescriptorSetLayoutCreateInfo &dsCI);
95*35238bceSAndroid Build Coastguard Worker void readJSON_VkPipelineLayoutCreateInfo(Context &context, const string &pipelineLayoutCreateInfo,
96*35238bceSAndroid Build Coastguard Worker                                          vk::VkPipelineLayoutCreateInfo &plCI);
97*35238bceSAndroid Build Coastguard Worker void readJSON_VkShaderModuleCreateInfo(Context &context, const string &shaderModuleCreate,
98*35238bceSAndroid Build Coastguard Worker                                        vk::VkShaderModuleCreateInfo &smCI, vector<uint8_t> &spirvShader);
99*35238bceSAndroid Build Coastguard Worker void readJSON_VkDeviceObjectReservationCreateInfo(Context &context, const string &deviceMemoryReservation,
100*35238bceSAndroid Build Coastguard Worker                                                   vk::VkDeviceObjectReservationCreateInfo &dmrCI);
101*35238bceSAndroid Build Coastguard Worker void readJSON_VkPipelineOfflineCreateInfo(Context &context, const string &pipelineIdentifierInfo,
102*35238bceSAndroid Build Coastguard Worker                                           vk::VkPipelineOfflineCreateInfo &piInfo);
103*35238bceSAndroid Build Coastguard Worker void readJSON_VkSamplerCreateInfo(Context &context, const string &samplerCreateInfo, vk::VkSamplerCreateInfo &sCI);
104*35238bceSAndroid Build Coastguard Worker void readJSON_VkSamplerYcbcrConversionCreateInfo(Context &context, const std::string &samplerYcbcrConversionCreateInfo,
105*35238bceSAndroid Build Coastguard Worker                                                  vk::VkSamplerYcbcrConversionCreateInfo &sycCI);
106*35238bceSAndroid Build Coastguard Worker void readJSON_VkPhysicalDeviceFeatures2(Context &context, const std::string &featuresJson,
107*35238bceSAndroid Build Coastguard Worker                                         vk::VkPhysicalDeviceFeatures2 &features);
108*35238bceSAndroid Build Coastguard Worker void *readJSON_pNextChain(Context &context, const std::string &chainJson);
109*35238bceSAndroid Build Coastguard Worker 
110*35238bceSAndroid Build Coastguard Worker } // namespace json
111*35238bceSAndroid Build Coastguard Worker 
112*35238bceSAndroid Build Coastguard Worker } // namespace vksc_server
113*35238bceSAndroid Build Coastguard Worker 
114*35238bceSAndroid Build Coastguard Worker #endif // _VKSJSON_HPP
115