aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/vk/GrVkExtensions.h
blob: a6badcd33ffce2eb3a52098e44a201be5190bd14 (plain)
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
/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrVkExtensions_DEFINED
#define GrVkExtensions_DEFINED

#include "../private/SkTArray.h"
#include "SkString.h"

/**
 * Helper class that eats in an array of extensions strings for instance and device and allows for
 * quicker querying if an extension is present.
 */
class GrVkExtensions {
public:
    GrVkExtensions(uint32_t instanceExtensionCount, const char* const* instanceExtensions,
                   uint32_t deviceExtensionCount, const char* const* deviceExtensions);
    // TODO: Remove once we remove the old fExtensions from GrVkBackendContext
    GrVkExtensions(uint32_t extensionFlags);

    // TODO: Remove once we remove the old fExtensions from GrVkBackendContext
    static void GetExtensionArrayFromFlags(uint32_t extensionFlags,
                                           SkTArray<const char*>* extensions);

    bool hasExtension(const char[]) const;

private:
    SkTArray<SkString>  fExtensionStrings;
};

#endif