ARTICLE AD BOX
I have this function:
bool TmrwRenderImpl::copyTexture( std::optional<std::pair<std::unique_ptr<tmrw::opengl::TmrwPassRenderer>, std::unique_ptr<tmrw::opengl::TmrwPassRenderer>>>& pass_copier, const opengl::TmrwTexture& src_texture, const opengl::TmrwTexture& dst_texture, bool flip) { tmrw::opengl::TmrwPassRenderer* renderer = flip ? pass_copier->second.get() : pass_copier->first.get(); std::string uniform_texture = "src_texture"; //std::span<const std::string&> named_uniform_values = { uniform_texture }; return renderer->Render({ std::cref(src_texture) }, { std::cref(dst_texture) })); //, named_uniform_values)); }Here renderer->Render should accepc std::span object references, I tried to declare it in many ways:
1.
virtual bool Render(std::span<std::reference_wrapper<const TmrwTexture>> src_texture, std::span<std::reference_wrapper<const TmrwTexture>> dst_texture); // , std::span<const std::string> named_uniform_values) = 0; virtual absl::Status Render(std::span<const TmrwTexture> src_texture, std::span<const TmrwTexture> dst_texture); // , std::span<const std::string> named_uniform_values) = 0; virtual absl::Status Render(const std::span<const TmrwTexture>& src_texture, const std::span<const TmrwTexture>& dst_texture); // , std::span<const std::string> named_uniform_values) = 0;Unfortunately nothing works. ChatGPT and DeepSeek also couldn't help. They suggest non-compilable variants.
Please suggest how to declare input spans in Render function to make it compilable please.
