1 // 2 // Copyright 2024 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. 4 // 5 // clspv_utils: 6 // Utilities to map clspv interface variables to OpenCL and Vulkan mappings. 7 // 8 9 #ifndef LIBANGLE_RENDERER_VULKAN_CLSPV_UTILS_H_ 10 #define LIBANGLE_RENDERER_VULKAN_CLSPV_UTILS_H_ 11 12 #include <string> 13 #include <vector> 14 15 #include <libANGLE/renderer/vulkan/CLDeviceVk.h> 16 17 namespace rx 18 { 19 struct ClspvPrintfBufferStorage 20 { 21 uint32_t descriptorSet = 0; 22 uint32_t binding = 0; 23 uint32_t pcOffset = 0; 24 uint32_t size = 0; 25 }; 26 27 struct ClspvPrintfInfo 28 { 29 uint32_t id = 0; 30 std::string formatSpecifier; 31 std::vector<uint32_t> argSizes; 32 }; 33 34 angle::Result ClspvProcessPrintfBuffer(unsigned char *buffer, 35 const size_t bufferSize, 36 const angle::HashMap<uint32_t, ClspvPrintfInfo> *infoMap); 37 38 // Populate a list of options that can be supported by clspv based on the features supported by the 39 // vulkan renderer. 40 std::string ClspvGetCompilerOptions(const CLDeviceVk *device); 41 42 } // namespace rx 43 44 #endif // LIBANGLE_RENDERER_VULKAN_CLSPV_UTILS_H_ 45