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/base/gf/vec4f.h"
12#include "pxr/imaging/hgi/api.h"
13#include "pxr/imaging/hgi/enums.h"
14#include <memory>
15
16PXR_NAMESPACE_OPEN_SCOPE
17
18class Hgi;
19
20using HgiCmdsUniquePtr = std::unique_ptr<class HgiCmds>;
21
22
29{
30public:
31 HGI_API
32 virtual ~HgiCmds();
33
35 HGI_API
36 bool IsSubmitted() const;
37
38protected:
39 friend class Hgi;
40
41 HGI_API
42 HgiCmds();
43
44 // Submit can be called inside of Hgi::SubmitCmds to commit the
45 // command buffer to the GPU. Returns true if work was committed.
46 // The default implementation returns false.
47 HGI_API
48 virtual bool _Submit(Hgi* hgi, HgiSubmitWaitType wait);
49
50 // Flags the HgiCmds object as 'submitted' to GPU.
51 HGI_API
52 void _SetSubmitted();
53
54 static constexpr GfVec4f s_computeDebugColor
55 = { 0.855, 0.161, 0.11, 1.0 };
56 static constexpr GfVec4f s_graphicsDebugColor
57 = { 0, 0.639, 0.878, 1.0 };
58 static constexpr GfVec4f s_blitDebugColor
59 = { 0.99607843137, 0.87450980392, 0.0, 1.0 };
60 static constexpr GfVec4f s_markerDebugColor
61 = { 0.0, 0.0, 0.0, 0.0 };
62private:
63 HgiCmds & operator=(const HgiCmds&) = delete;
64 HgiCmds(const HgiCmds&) = delete;
65
66 bool _submitted;
67};
68
69
70PXR_NAMESPACE_CLOSE_SCOPE
71
72#endif
Basic type for a vector of 4 float components.
Definition: vec4f.h:46
Graphics commands are recorded in 'cmds' objects which are later submitted to hgi.
Definition: cmds.h:29
HGI_API bool IsSubmitted() const
Returns true if the HgiCmds object has been submitted to GPU.
Hydra Graphics Interface.
Definition: hgi.h:95