Loading...
Searching...
No Matches
buffer.h
1//
2// Copyright 2020 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HGI_GL_BUFFER_H
8#define PXR_IMAGING_HGI_GL_BUFFER_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hgiGL/api.h"
12#include "pxr/imaging/hgi/buffer.h"
13
14
15PXR_NAMESPACE_OPEN_SCOPE
16
21class HgiGLBuffer final : public HgiBuffer
22{
23public:
24 HGIGL_API
25 ~HgiGLBuffer() override;
26
27 HGIGL_API
28 size_t GetByteSizeOfResource() const override;
29
30 HGIGL_API
31 uint64_t GetRawResource() const override;
32
33 HGIGL_API
34 void* GetCPUStagingAddress() override;
35
36 uint32_t GetBufferId() const {return _bufferId;}
37
39 HGIGL_API
41
42protected:
43 friend class HgiGL;
44
45 HGIGL_API
46 HgiGLBuffer(HgiBufferDesc const & desc);
47
48private:
49 HgiGLBuffer() = delete;
50 HgiGLBuffer & operator=(const HgiGLBuffer&) = delete;
51 HgiGLBuffer(const HgiGLBuffer&) = delete;
52
53 uint32_t _bufferId;
54 void* _cpuStaging;
55 uint64_t _bindlessGPUAddress;
56};
57
58
59PXR_NAMESPACE_CLOSE_SCOPE
60
61#endif
Represents a graphics platform independent GPU buffer resource (base class).
Definition: buffer.h:82
Represents an OpenGL GPU buffer resource.
Definition: buffer.h:22
HGIGL_API size_t GetByteSizeOfResource() const override
Returns the byte size of the GPU buffer.
HGIGL_API uint64_t GetRawResource() const override
This function returns the handle to the Hgi backend's gpu resource, cast to a uint64_t.
HGIGL_API void * GetCPUStagingAddress() override
Returns the 'staging area' in which new buffer data is copied before it is flushed to GPU.
HGIGL_API uint64_t GetBindlessGPUAddress()
Returns the bindless gpu address (caller must verify extension support)
OpenGL implementation of the Hydra Graphics Interface.
Definition: hgi.h:55
Describes the properties needed to create a GPU buffer.
Definition: buffer.h:46