[Bf-cycles] Build without OpenImageIO

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Mar 6 23:05:48 CET 2018


Using std::string instead of ustring will lead to a lot more memory
allocations, which can be slow but may be ok in practice for the way Cycles
uses it.

Feel free to submit a patch on developer.blender.org when you think the
code is in a good state.

On Tue, Mar 6, 2018 at 4:47 AM, Guillaume Chéreau <
guillaume.chereau at gmail.com> wrote:

> I just started a branch of Cycles on github for the goxel version.
>
> My first commit allows to use std::string for ustring and a custom
> implementation of TypeDef:
> https://github.com/guillaumechereau/cycles/commit/
> 0f286bc4da5536a19640eb4ede640423e317e733
>
> Regards,
> Guillaume
>
> On Tue, Mar 6, 2018 at 10:05 AM, Guillaume Chéreau
> <guillaume.chereau at gmail.com> wrote:
> > It is actually not difficult to replace oiio ustring with std::string
> > in the code, since the api are almost the same, but the performance
> > are probably not as good with std::string.
> >
> > In util/util_param.h, I can comment out the OpenImageIO/ustring.h
> > include and add those lines:
> >
> > // ustring implementation based on std::string.
> > class ustring : public std::string
> > {
> > public:
> >     ustring() {}
> >     explicit ustring(const char *str) : std::string(str) {}
> >     ustring (const ustring &str) : ustring(str.c_str()) {}
> >     ustring (const std::string &str) : ustring(str.c_str()) {}
> >     const std::string &string() const { return *this; }
> >     operator int(void) const { return !empty(); }
> >     const ustring &operator=(const char *str) { *this = str; return
> *this; }
> > };
> > typedef std::hash<std::string> ustringHash;
> >
> > And the compilation works.
> >
> > Similar treatment can be done for typedesc.
> >
> >
> > Regards,
> > Guillaume
> >
> > --
> > Guillaume
> > guillaume.chereau at gmail.com
> > +886 970422910
>
>
>
> --
> Guillaume
> guillaume.chereau at gmail.com
> +886 970422910
> _______________________________________________
> Bf-cycles mailing list
> Bf-cycles at blender.org
> https://lists.blender.org/mailman/listinfo/bf-cycles
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-cycles/attachments/20180306/8becf3c0/attachment.html>


More information about the Bf-cycles mailing list