Loading...
Searching...
No Matches
device.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_HGIGL_DEVICE_H
8#define PXR_IMAGING_HGIGL_DEVICE_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hgi/graphicsCmdsDesc.h"
12#include "pxr/imaging/hgiGL/api.h"
13#include "pxr/imaging/hgiGL/contextArena.h"
14#include "pxr/imaging/hgiGL/hgi.h"
15
16#include <fstream>
17#include <ostream>
18
19PXR_NAMESPACE_OPEN_SCOPE
20
21class HgiGraphicsCmdDesc;
22
29class HgiGLDevice final {
30public:
31 HGIGL_API
33
34 HGIGL_API
36
38 HGIGL_API
39 void SubmitOps(HgiGLOpsVector const& ops);
40
44 HGIGL_API
45 void SetCurrentArena(HgiGLContextArenaHandle const& arenaHandle);
46
47 HGIGL_API
48 HgiGLContextArena* GetCurrentArena() const;
49
51 HGIGL_API
53 HgiGraphicsCmdsDesc const& desc,
54 bool resolved = false);
55
57 HGIGL_API
59
60private:
61 HgiGLContextArena const * _GetArena() const;
62 HgiGLContextArena * _GetArena();
63
64 HgiGLDevice & operator=(const HgiGLDevice&) = delete;
65 HgiGLDevice(const HgiGLDevice&) = delete;
66
67 friend std::ofstream& operator<<(
68 std::ofstream& out,
69 const HgiGLDevice& dev);
70
71 // The default arena is used in the absence of a user provided arena.
72 HgiGLContextArena _defaultArena;
73 HgiGLContextArena *_activeArena;
74};
75
76
77PXR_NAMESPACE_CLOSE_SCOPE
78
79#endif
Represents an arena for the HgiGL instance to manage container object resources that are tied to the ...
OpenGL implementation of GPU device.
Definition device.h:29
HGIGL_API void SubmitOps(HgiGLOpsVector const &ops)
Execute the provided functions / ops. This will emit the GL calls.
HGIGL_API void GarbageCollect()
Garbage collect resources in the active arena.
HGIGL_API uint32_t AcquireFramebuffer(HgiGraphicsCmdsDesc const &desc, bool resolved=false)
Returns a framebuffer object id that is managed by the active arena.
HGIGL_API void SetCurrentArena(HgiGLContextArenaHandle const &arenaHandle)
Sets the active arena to use when submitting commands.
Handle that contains a hgi object and unique id.
Definition handle.h:33
Describes the properties to begin a HgiGraphicsCmds.