Hash :
f9709279
Author :
Date :
2024-09-20T16:02:56
CL/Vulkan: Add support for printf builtin processing The support for printf builtin in clspv enabled through the SPIR-V non-semantic clspv reflection instructions - PrintfInfo and PrintfBufferStorageBuffer [1]. The printf buffer is setup with a separate descriptor layout and the pipeline layout is updated accordingly. Also, printf is enabled as default option now for clspv. [1]: https://github.com/KhronosGroup/SPIRV-Registry/blob/master/nonsemantic/NonSemantic.ClspvReflection.html Bug: angleproject:369724757 Change-Id: I20b245eb0fea69941bd1aeb42534f8b729ec17e8 Signed-off-by: Gowtham Tammana <g.tammana@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5893958 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
//
// Copyright 2024 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
//
// clspv_utils:
// Utilities to map clspv interface variables to OpenCL and Vulkan mappings.
//
#ifndef LIBANGLE_RENDERER_VULKAN_CLSPV_UTILS_H_
#define LIBANGLE_RENDERER_VULKAN_CLSPV_UTILS_H_
#include <string>
#include <vector>
#include <libANGLE/renderer/vulkan/CLDeviceVk.h>
namespace rx
{
struct ClspvPrintfBufferStorage
{
uint32_t descriptorSet = 0;
uint32_t binding = 0;
uint32_t pcOffset = 0;
uint32_t size = 0;
};
struct ClspvPrintfInfo
{
uint32_t id = 0;
std::string formatSpecifier;
std::vector<uint32_t> argSizes;
};
angle::Result ClspvProcessPrintfBuffer(unsigned char *buffer,
const size_t bufferSize,
const angle::HashMap<uint32_t, ClspvPrintfInfo> *infoMap);
// Populate a list of options that can be supported by clspv based on the features supported by the
// vulkan renderer.
std::string ClspvGetCompilerOptions(const CLDeviceVk *device);
} // namespace rx
#endif // LIBANGLE_RENDERER_VULKAN_CLSPV_UTILS_H_