forked from blender/blender
Fix review comments 2 #31
@ -62,11 +62,11 @@ void FinalEngine::render(Depsgraph *depsgraph)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
render_task_delegate_->get_renderer_aov_data(pxr::HdAovTokens->color, pixels_.data());
|
render_task_delegate_->get_renderer_aov_data(pxr::HdAovTokens->color, pixels_->data());
|
||||||
update_render_result(render_images_, layer_name_, resolution_[0], resolution_[1]);
|
update_render_result(render_images_, layer_name_, resolution_[0], resolution_[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
render_task_delegate_->get_renderer_aov_data(pxr::HdAovTokens->color, pixels_.data());
|
render_task_delegate_->get_renderer_aov_data(pxr::HdAovTokens->color, pixels_->data());
|
||||||
update_render_result(render_images_, layer_name_, resolution_[0], resolution_[1]);
|
update_render_result(render_images_, layer_name_, resolution_[0], resolution_[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ void FinalEngine::prepare_for_render(Depsgraph *depsgraph)
|
|||||||
render_images_.emplace(
|
render_images_.emplace(
|
||||||
"Combined",
|
"Combined",
|
||||||
std::vector<float>(resolution_[0] * resolution_[1] * 4)); /* 4 - number of channels. */
|
std::vector<float>(resolution_[0] * resolution_[1] * 4)); /* 4 - number of channels. */
|
||||||
pixels_ = render_images_["Combined"];
|
pixels_ = &render_images_["Combined"];
|
||||||
}
|
}
|
||||||
|
|
||||||
void FinalEngineGL::render(Depsgraph *depsgraph)
|
void FinalEngineGL::render(Depsgraph *depsgraph)
|
||||||
@ -191,13 +191,13 @@ void FinalEngineGL::render(Depsgraph *depsgraph)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *data = GPU_texture_read(texture, GPU_DATA_FLOAT, 0);
|
void *data = GPU_texture_read(texture, GPU_DATA_FLOAT, 0);
|
||||||
memcpy(pixels_.data(), data, pixels_.size() * sizeof(float));
|
memcpy(pixels_->data(), data, pixels_->size() * sizeof(float));
|
||||||
MEM_freeN(data);
|
MEM_freeN(data);
|
||||||
update_render_result(render_images_, layer_name_, resolution_[0], resolution_[1]);
|
update_render_result(render_images_, layer_name_, resolution_[0], resolution_[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *data = GPU_texture_read(texture, GPU_DATA_FLOAT, 0);
|
void *data = GPU_texture_read(texture, GPU_DATA_FLOAT, 0);
|
||||||
memcpy(pixels_.data(), data, pixels_.size() * sizeof(float));
|
memcpy(pixels_->data(), data, pixels_->size() * sizeof(float));
|
||||||
MEM_freeN(data);
|
MEM_freeN(data);
|
||||||
update_render_result(render_images_, layer_name_, resolution_[0], resolution_[1]);
|
update_render_result(render_images_, layer_name_, resolution_[0], resolution_[1]);
|
||||||
|
|
||||||
|
|||||||
|
@ -31,7 +31,7 @@ class FinalEngine : public Engine {
|
|||||||
std::string layer_name_;
|
std::string layer_name_;
|
||||||
std::map<std::string, std::vector<float>> render_images_;
|
std::map<std::string, std::vector<float>> render_images_;
|
||||||
pxr::GfVec2i resolution_;
|
pxr::GfVec2i resolution_;
|
||||||
std::vector<float> pixels_;
|
std::vector<float> *pixels_ = nullptr;
|
||||||
Bogdan Nagirniak
commented
move pixels as local variable to render() move pixels as local variable to render()
|
|||||||
};
|
};
|
||||||
|
|
||||||
class FinalEngineGL : public FinalEngine {
|
class FinalEngineGL : public FinalEngine {
|
||||||
|
Loading…
Reference in New Issue
Block a user
Simplify
update_render_result
- no need to provide parameters