7#ifndef PXR_IMAGING_PLUGIN_HD_EMBREE_RENDER_BUFFER_H
8#define PXR_IMAGING_PLUGIN_HD_EMBREE_RENDER_BUFFER_H
11#include "pxr/imaging/hd/renderBuffer.h"
13PXR_NAMESPACE_OPEN_SCOPE
18 HdEmbreeRenderBuffer(
SdfPath const&
id);
19 ~HdEmbreeRenderBuffer()
override;
29 HdDirtyBits *dirtyBits)
override;
47 bool multiSampled)
override;
51 unsigned int GetWidth()
const override {
return _width; }
55 unsigned int GetHeight()
const override {
return _height; }
59 unsigned int GetDepth()
const override {
return 1; }
63 HdFormat
GetFormat()
const override {
return _format; }
73 void*
Map()
override {
75 return _buffer.data();
79 void Unmap()
override {
86 return _mappers.load() != 0;
93 return _converged.load();
98 void SetConverged(
bool cv) {
116 void Write(
GfVec3i const& pixel,
size_t numComponents,
float const* value);
125 void Write(
GfVec3i const& pixel,
size_t numComponents,
int const* value);
133 void Clear(
size_t numComponents,
float const* value);
141 void Clear(
size_t numComponents,
int const* value);
145 static size_t _GetBufferSize(
GfVec2i const& dims, HdFormat format);
150 static HdFormat _GetSampleFormat(HdFormat format);
158 unsigned int _height;
165 std::vector<uint8_t> _buffer;
167 std::vector<uint8_t> _sampleBuffer;
169 std::vector<uint8_t> _sampleCount;
172 std::atomic<int> _mappers;
174 std::atomic<bool> _converged;
177PXR_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.