aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkUniformBuffer.h
blob: a894aec0a60d3860cd4e1d5f388c69db0af10ba4 (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
36
37
38
39
40
41
42
43
44
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/

#ifndef GrVkUniformBuffer_DEFINED
#define GrVkUniformBuffer_DEFINED

#include "GrVkBuffer.h"

class GrVkGpu;

class GrVkUniformBuffer : public GrVkBuffer {

public:
    static GrVkUniformBuffer* Create(GrVkGpu* gpu, size_t size, bool dynamic);

    void* map(const GrVkGpu* gpu) {
        return this->vkMap(gpu);
    }
    void unmap(const GrVkGpu* gpu) {
        this->vkUnmap(gpu);
    }
    bool updateData(const GrVkGpu* gpu, const void* src, size_t srcSizeInBytes) {
        return this->vkUpdateData(gpu, src, srcSizeInBytes);
    }
    void release(const GrVkGpu* gpu) {
        this->vkRelease(gpu);
    }
    void abandon() {
        this->vkAbandon();
    }

private:
    GrVkUniformBuffer(const GrVkBuffer::Desc& desc, const GrVkBuffer::Resource* resource)
        : INHERITED(desc, resource) {
    };

    typedef GrVkBuffer INHERITED;
};

#endif