Files
test2/intern/cycles/kernel/osl/compat.h
Brecht Van Lommel 11bca76f96 Cycles: update OSL to work with version 1.13.2
While keeping compatibility with older versions.

Ref #110708

Pull Request: https://projects.blender.org/blender/blender/pulls/110980
2023-08-10 20:01:09 +02:00

31 lines
567 B
C

/* SPDX-FileCopyrightText: 2011-2023 Blender Foundation
*
* SPDX-License-Identifier: Apache-2.0 */
#pragma once
#include <OSL/oslconfig.h>
CCL_NAMESPACE_BEGIN
#if OSL_LIBRARY_VERSION_CODE >= 11302
typedef OSL::ustringhash OSLUStringHash;
typedef OSL::ustringrep OSLUStringRep;
static inline OSL::ustring to_ustring(OSLUStringHash h)
{
return OSL::ustring::from_hash(h.hash());
}
#else
typedef OSL::ustring OSLUStringHash;
typedef OSL::ustring OSLUStringRep;
static inline OSL::ustring to_ustring(OSLUStringHash h)
{
return h;
}
#endif
CCL_NAMESPACE_END