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
48 HGIGL_API
50 HgiGraphicsCmdsDesc const& desc,
51 bool resolved = false);
52
54 HGIGL_API
56
57private:
58 HgiGLContextArena const * _GetArena() const;
59 HgiGLContextArena * _GetArena();
60
61 HgiGLDevice & operator=(const HgiGLDevice&) = delete;
62 HgiGLDevice(const HgiGLDevice&) = delete;
63
64 friend std::ofstream& operator<<(
65 std::ofstream& out,
66 const HgiGLDevice& dev);
67
68 // The default arena is used in the absence of a user provided arena.
69 HgiGLContextArena _defaultArena;
70 HgiGLContextArena *_activeArena;
71};
72
73
74PXR_NAMESPACE_CLOSE_SCOPE
75
76#endif
Represents an arena for the HgiGL instance to manage container object resources that are tied to the ...
Definition: contextArena.h:30
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.