24 #ifndef PXR_IMAGING_PLUGIN_HD_EMBREE_RENDER_BUFFER_H 25 #define PXR_IMAGING_PLUGIN_HD_EMBREE_RENDER_BUFFER_H 28 #include "pxr/imaging/hd/renderBuffer.h" 30 PXR_NAMESPACE_OPEN_SCOPE
35 HdEmbreeRenderBuffer(
SdfPath const&
id);
36 ~HdEmbreeRenderBuffer()
override;
46 HdDirtyBits *dirtyBits)
override;
64 bool multiSampled)
override;
68 unsigned int GetWidth()
const override {
return _width; }
72 unsigned int GetHeight()
const override {
return _height; }
76 unsigned int GetDepth()
const override {
return 1; }
80 HdFormat
GetFormat()
const override {
return _format; }
90 void*
Map()
override {
92 return _buffer.data();
96 void Unmap()
override {
103 return _mappers.load() != 0;
110 return _converged.load();
115 void SetConverged(
bool cv) {
116 _converged.store(cv);
133 void Write(
GfVec3i const& pixel,
size_t numComponents,
float const* value);
142 void Write(
GfVec3i const& pixel,
size_t numComponents,
int const* value);
150 void Clear(
size_t numComponents,
float const* value);
158 void Clear(
size_t numComponents,
int const* value);
162 static size_t _GetBufferSize(
GfVec2i const& dims, HdFormat format);
167 static HdFormat _GetSampleFormat(HdFormat format);
175 unsigned int _height;
182 std::vector<uint8_t> _buffer;
184 std::vector<uint8_t> _sampleBuffer;
186 std::vector<uint8_t> _sampleCount;
189 std::atomic<int> _mappers;
191 std::atomic<bool> _converged;
194 PXR_NAMESPACE_CLOSE_SCOPE
196 #endif // PXR_IMAGING_PLUGIN_HD_EMBREE_RENDER_BUFFER_H Basic type for a vector of 2 int components.
virtual void Unmap()=0
Unmap the buffer. It is no longer safe to read from the buffer.
virtual bool IsMapped() const =0
Return whether the buffer is currently mapped by anybody.
The HdRenderParam is an opaque (to core Hydra) handle, to an object that is obtained from the render ...
virtual unsigned int GetWidth() const =0
Get the buffer's width.
HD_API void Finalize(HdRenderParam *renderParam) override
Deallocate before deletion.
virtual void _Deallocate()=0
Deallocate the buffer, freeing any owned resources.
Adapter class providing data exchange with the client scene graph.
virtual HdFormat GetFormat() const =0
Get the buffer's per-pixel format.
Basic type for a vector of 3 int components.
A path value used to locate objects in layers or scenegraphs.
HD_API void Sync(HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) override
Get allocation information from the scene delegate.
virtual bool IsConverged() const =0
Return whether the buffer is converged (whether the renderer is still adding samples or not).
virtual unsigned int GetHeight() const =0
Get the buffer's height.
virtual unsigned int GetDepth() const =0
Get the buffer's depth.
A render buffer is a handle to a data resource that can be rendered into, such as a 2d image for a dr...
virtual void * Map()=0
Map the buffer for reading.
virtual bool Allocate(GfVec3i const &dimensions, HdFormat format, bool multiSampled)=0
Allocate a buffer.
virtual bool IsMultiSampled() const =0
Get whether the buffer is multisampled.
virtual void Resolve()=0
Resolve the buffer so that reads reflect the latest writes.