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"
30PXR_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;
194PXR_NAMESPACE_CLOSE_SCOPE
Basic type for a vector of 2 int components.
Basic type for a vector of 3 int components.
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 Resolve()=0
Resolve the buffer so that reads reflect the latest writes.
virtual unsigned int GetWidth() const =0
Get the buffer's width.
virtual void * Map()=0
Map the buffer for reading.
HD_API void Sync(HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) override
Get allocation information from the scene delegate.
virtual unsigned int GetHeight() const =0
Get the buffer's height.
virtual bool IsMapped() const =0
Return whether the buffer is currently mapped by anybody.
HD_API void Finalize(HdRenderParam *renderParam) override
Deallocate before deletion.
virtual void _Deallocate()=0
Deallocate the buffer, freeing any owned resources.
virtual void Unmap()=0
Unmap the buffer. It is no longer safe to read from the buffer.
virtual unsigned int GetDepth() const =0
Get the buffer's depth.
virtual bool IsConverged() const =0
Return whether the buffer is converged (whether the renderer is still adding samples or not).
virtual HdFormat GetFormat() const =0
Get the buffer's per-pixel format.
virtual bool IsMultiSampled() const =0
Get whether the buffer is multisampled.
virtual bool Allocate(GfVec3i const &dimensions, HdFormat format, bool multiSampled)=0
Allocate a buffer.
The HdRenderParam is an opaque (to core Hydra) handle, to an object that is obtained from the render ...
Adapter class providing data exchange with the client scene graph.
A path value used to locate objects in layers or scenegraphs.