Hash :
7483897c
Author :
Date :
2024-10-01T17:23:37
CL/Vulkan: Add numeric versioning for extensions With extended versioning support, the version number of extensions need to be reported as well. Using the numeric versioning mode for adding supported extensions. Also, fix the version number for cl_khr_icd and cl_khr_extended_versioning extensions. Bug: angleproject:372085147 Change-Id: I7bf3157227f9579c69c351a63a88b92be7f07d71 Signed-off-by: Gowtham Tammana <g.tammana@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5916159 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> 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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
//
// Copyright 2021 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.
//
// CLExtensions.cpp: Implements the struct methods for CLExtension.
#include "libANGLE/renderer/CLExtensions.h"
#include "libANGLE/renderer/cl_types.h"
#include "common/string_utils.h"
namespace rx
{
CLExtensions::CLExtensions() = default;
CLExtensions::~CLExtensions() = default;
CLExtensions::CLExtensions(CLExtensions &&) = default;
CLExtensions &CLExtensions::operator=(CLExtensions &&) = default;
void CLExtensions::initializeExtensions(std::string &&extensionStr)
{
ASSERT(extensions.empty());
extensions.assign(std::move(extensionStr));
if (extensions.empty())
{
return;
}
auto hasExtension = [&](const std::string &extension) {
return angle::ContainsToken(extensions, ' ', extension);
};
khrByteAddressableStore = hasExtension("cl_khr_byte_addressable_store");
khrGlobalInt32BaseAtomics = hasExtension("cl_khr_global_int32_base_atomics");
khrGlobalInt32ExtendedAtomics = hasExtension("cl_khr_global_int32_extended_atomics");
khrLocalInt32BaseAtomics = hasExtension("cl_khr_local_int32_base_atomics");
khrLocalInt32ExtendedAtomics = hasExtension("cl_khr_local_int32_extended_atomics");
khr3D_ImageWrites = hasExtension("cl_khr_3d_image_writes");
khrDepthImages = hasExtension("cl_khr_depth_images");
khrImage2D_FromBuffer = hasExtension("cl_khr_image2d_from_buffer");
khrExtendedVersioning = hasExtension("cl_khr_extended_versioning");
khrFP64 = hasExtension("cl_khr_fp64");
khrICD = hasExtension("cl_khr_icd");
khrInt64BaseAtomics = hasExtension("cl_khr_int64_base_atomics");
khrInt64ExtendedAtomics = hasExtension("cl_khr_int64_extended_atomics");
}
void CLExtensions::initializeVersionedExtensions(const NameVersionVector &versionedExtList)
{
ASSERT(extensionsWithVersion.empty());
ASSERT(extensions.empty());
extensionsWithVersion = std::move(versionedExtList);
std::string extensionString = "";
for (cl_name_version ext : extensionsWithVersion)
{
extensionString += ext.name;
extensionString += " ";
}
return initializeExtensions(std::move(extensionString));
}
} // namespace rx