13 : _renderParam(renderParam)
17void HdCyclesOutputDriver::write_render_tile(
const Tile &
tile)
19 update_render_tile(
tile);
22 for (
const HdRenderPassAovBinding &aovBinding : _renderParam->GetAovBindings()) {
24 renderBuffer->SetConverged(
true);
29bool HdCyclesOutputDriver::update_render_tile(
const Tile &
tile)
31 std::vector<float> pixels;
33 for (
const HdRenderPassAovBinding &aovBinding : _renderParam->GetAovBindings()) {
39 const HdFormat
format = renderBuffer->GetFormat();
40 if (
format == HdFormatInvalid) {
44 const size_t channels = HdGetComponentCount(
format);
47 tile.size.
y == renderBuffer->GetHeight() &&
48 (
format >= HdFormatFloat32 &&
format <= HdFormatFloat32Vec4))
50 float *
const data =
static_cast<float *
>(renderBuffer->Map());
51 TF_VERIFY(
tile.get_pass_pixels(aovBinding.aovName.GetString(), channels, data));
52 renderBuffer->Unmap();
55 pixels.resize(channels *
tile.size.
x *
tile.size.
y);
56 if (
tile.get_pass_pixels(aovBinding.aovName.GetString(), channels, pixels.data())) {
57 const bool isId = aovBinding.aovName == HdAovTokens->primId ||
58 aovBinding.aovName == HdAovTokens->elementId ||
59 aovBinding.aovName == HdAovTokens->instanceId;
61 renderBuffer->WritePixels(pixels.data(),
66 renderBuffer->Unmap();
70 if (aovBinding.aovName != HdAovTokens->elementId) {
71 TF_RUNTIME_ERROR(
"Could not find pass for AOV '%s'", aovBinding.aovName.GetText());
HdCyclesOutputDriver(HdCyclesSession *renderParam)
PXR_NS::HdRenderPassAovBinding GetDisplayAovBinding() const
#define HDCYCLES_NAMESPACE_CLOSE_SCOPE
ccl_global const KernelWorkTile * tile