Fix Cycles Hydra segmentation fault in usdview

Ensure render buffer is allocated when calling WritePixels.

Differential Revision: https://developer.blender.org/D16272
This commit is contained in:
Thomas Lindemeier 2022-10-18 13:44:36 +02:00 committed by Brecht Van Lommel
parent 904cab0418
commit d70ef8dbf1
1 changed files with 2 additions and 1 deletions

View File

@ -55,12 +55,13 @@ bool HdCyclesOutputDriver::update_render_tile(const Tile &tile)
const bool isId = aovBinding.aovName == HdAovTokens->primId ||
aovBinding.aovName == HdAovTokens->elementId ||
aovBinding.aovName == HdAovTokens->instanceId;
renderBuffer->Map();
renderBuffer->WritePixels(pixels.data(),
GfVec2i(tile.offset.x, tile.offset.y),
GfVec2i(tile.size.x, tile.size.y),
channels,
isId);
renderBuffer->Unmap();
}
else {
// Do not warn on missing elementId, which is a standard AOV but is not implememted