HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
oitBufferAccessor.h
Go to the documentation of this file.
1 //
2 // Copyright 2019 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_HDX_OIT_BUFFER_ACCESSOR_H
8 #define PXR_IMAGING_HDX_OIT_BUFFER_ACCESSOR_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/imaging/hdx/api.h"
13 
14 #include "pxr/imaging/hd/task.h"
15 
16 #include <memory>
17 
19 
20 class Hgi;
21 
23  std::shared_ptr<class HdBufferArrayRange>;
24 
26  std::shared_ptr<class HdStRenderPassShader>;
27 
28 /// Class for OIT render tasks to access the OIT buffers.
30 public:
31  static bool IsOitEnabled();
32 
33  HDX_API
35 
36  /// Called during Prepare to indicate that OIT buffers are needed.
37  HDX_API
38  void RequestOitBuffers();
39 
40  /// Called during Excecute before writing to OIT buffers.
41  HDX_API
43 
44  /// Called during Execute to add necessary OIT buffer shader bindings.
45  ///
46  /// Returns false if the OIT buffers were not allocated.
47  HDX_API
49 
50 private:
51  HdBufferArrayRangeSharedPtr const &_GetBar(const TfToken &);
52 
53  HdTaskContext * const _ctx;
54 };
55 
57 
58 #endif
HDX_API HdxOitBufferAccessor(HdTaskContext *ctx)
HDX_API bool AddOitBufferBindings(const HdStRenderPassShaderSharedPtr &)
#define HDX_API
Definition: api.h:23
HDX_API void InitializeOitBuffersIfNecessary(Hgi *hgi)
Called during Excecute before writing to OIT buffers.
Definition: token.h:70
Class for OIT render tasks to access the OIT buffers.
HDX_API void RequestOitBuffers()
Called during Prepare to indicate that OIT buffers are needed.
std::unordered_map< TfToken, VtValue, TfToken::HashFunctor > HdTaskContext
Definition: renderIndex.h:61
std::shared_ptr< class HdStRenderPassShader > HdStRenderPassShaderSharedPtr
Definition: hgi.h:93
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
static bool IsOitEnabled()
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
std::shared_ptr< HdBufferArrayRange > HdBufferArrayRangeSharedPtr
Definition: bufferArray.h:27