Loading...
Searching...
No Matches
cmds.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_CMDS_H
8#define PXR_IMAGING_HGI_CMDS_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hgi/api.h"
12#include "pxr/imaging/hgi/enums.h"
13#include <memory>
14
15PXR_NAMESPACE_OPEN_SCOPE
16
17class Hgi;
18
19using HgiCmdsUniquePtr = std::unique_ptr<class HgiCmds>;
20
21
28{
29public:
30 HGI_API
31 virtual ~HgiCmds();
32
34 HGI_API
35 bool IsSubmitted() const;
36
37protected:
38 friend class Hgi;
39
40 HGI_API
41 HgiCmds();
42
43 // Submit can be called inside of Hgi::SubmitCmds to commit the
44 // command buffer to the GPU. Returns true if work was committed.
45 // The default implementation returns false.
46 HGI_API
47 virtual bool _Submit(Hgi* hgi, HgiSubmitWaitType wait);
48
49 // Flags the HgiCmds object as 'submitted' to GPU.
50 HGI_API
51 void _SetSubmitted();
52
53private:
54 HgiCmds & operator=(const HgiCmds&) = delete;
55 HgiCmds(const HgiCmds&) = delete;
56
57 bool _submitted;
58};
59
60
61PXR_NAMESPACE_CLOSE_SCOPE
62
63#endif
Graphics commands are recorded in 'cmds' objects which are later submitted to hgi.
Definition: cmds.h:28
HGI_API bool IsSubmitted() const
Returns true if the HgiCmds object has been submitted to GPU.
Hydra Graphics Interface.
Definition: hgi.h:95