mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Cycles: Stop using OpenImageIO texture cache for OSL
This will be replaced by the texture cache. Advanced OpenImageIO features will no longer be available, and texture filtering results will be different. But performance will be better and there will be consistency with SVM. OSL specifc image tests were removed as these now match SVM exactly and are tested by WITH_CYCLES_TEST_OSL. Pull Request: https://projects.blender.org/blender/blender/pulls/154913
This commit is contained in:
parent
1aeb57b906
commit
db9060b4d3
187 changed files with 505 additions and 1216 deletions
|
|
@ -23,6 +23,7 @@
|
|||
#include "kernel/bvh/util.h"
|
||||
#include "kernel/globals.h"
|
||||
#include "kernel/integrator/state.h"
|
||||
#include "kernel/integrator/state_util.h"
|
||||
#include "kernel/types.h"
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
|
|
|||
|
|
@ -25,10 +25,9 @@ OSLThreadData::OSLThreadData(OSLGlobals *osl_globals, const int thread_index)
|
|||
|
||||
if (ss) {
|
||||
osl_thread_info = ss->create_thread_info();
|
||||
context = ss->get_context(osl_thread_info);
|
||||
}
|
||||
if (globals->ts) {
|
||||
oiio_thread_info = globals->ts->get_perthread_info();
|
||||
/* Dummy texture thread info, we don't need it. */
|
||||
context = ss->get_context(osl_thread_info,
|
||||
reinterpret_cast<OSL::TextureSystem::Perthread *>(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -49,8 +48,7 @@ OSLThreadData::OSLThreadData(OSLThreadData &&other) noexcept
|
|||
shader_globals(other.shader_globals),
|
||||
tracedata(other.tracedata),
|
||||
osl_thread_info(other.osl_thread_info),
|
||||
context(other.context),
|
||||
oiio_thread_info(other.oiio_thread_info)
|
||||
context(other.context)
|
||||
{
|
||||
shader_globals.tracedata = &tracedata;
|
||||
|
||||
|
|
@ -59,7 +57,6 @@ OSLThreadData::OSLThreadData(OSLThreadData &&other) noexcept
|
|||
other.thread_index = -1;
|
||||
other.context = nullptr;
|
||||
other.osl_thread_info = nullptr;
|
||||
other.oiio_thread_info = nullptr;
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ struct OSLGlobals {
|
|||
OSLGlobals()
|
||||
{
|
||||
ss = nullptr;
|
||||
ts = nullptr;
|
||||
services = nullptr;
|
||||
use_shading = false;
|
||||
use_camera = false;
|
||||
|
|
@ -48,7 +47,6 @@ struct OSLGlobals {
|
|||
|
||||
/* shading system */
|
||||
OSL::ShadingSystem *ss;
|
||||
OSL::TextureSystem *ts;
|
||||
OSLRenderServices *services;
|
||||
|
||||
/* shader states */
|
||||
|
|
@ -91,7 +89,6 @@ struct OSLThreadData {
|
|||
|
||||
OSL::PerThreadInfo *osl_thread_info = nullptr;
|
||||
OSL::ShadingContext *context = nullptr;
|
||||
OIIO::TextureSystem::Perthread *oiio_thread_info = nullptr;
|
||||
|
||||
OSLThreadData(OSLGlobals *globals, const int thread_index);
|
||||
~OSLThreadData();
|
||||
|
|
|
|||
|
|
@ -11,31 +11,14 @@
|
|||
# pragma GCC diagnostic ignored "-Wuninitialized"
|
||||
#endif
|
||||
|
||||
#include "scene/object.h"
|
||||
|
||||
#include "util/colorspace.h"
|
||||
#include "util/log.h"
|
||||
#include "util/string.h"
|
||||
#include "util/types_image.h"
|
||||
|
||||
#include "kernel/device/cpu/image.h"
|
||||
|
||||
#include "kernel/integrator/state.h"
|
||||
#include "kernel/integrator/state_util.h"
|
||||
|
||||
#include "kernel/geom/primitive.h"
|
||||
#include "kernel/geom/shader_data.h"
|
||||
|
||||
#include "kernel/bvh/bvh.h"
|
||||
|
||||
#include "kernel/camera/camera.h"
|
||||
|
||||
#include "kernel/svm/ao.h"
|
||||
#include "kernel/svm/bevel.h"
|
||||
|
||||
#include "kernel/util/ies.h"
|
||||
#include "kernel/util/image_3d.h"
|
||||
|
||||
#include "kernel/osl/globals.h"
|
||||
#include "kernel/osl/services.h"
|
||||
#include "kernel/osl/services_shared.h"
|
||||
|
|
@ -48,17 +31,15 @@ CCL_NAMESPACE_BEGIN
|
|||
|
||||
ImageManager *OSLRenderServices::image_manager = nullptr;
|
||||
|
||||
OSLRenderServices::OSLRenderServices(OSL::TextureSystem *texture_system, const int device_type)
|
||||
: OSL::RendererServices(texture_system), device_type_(device_type)
|
||||
OSLRenderServices::OSLRenderServices(const int device_type)
|
||||
/* Dummy texture system pointer so OSL doesn't create its own. Such an opaque texture system
|
||||
* pointer is supported and normally would be done with the OSL_NO_DEFAULT_TEXTURESYSTEM
|
||||
* build option, but we want to work with OSL builds that don't have it. */
|
||||
: OSL::RendererServices(reinterpret_cast<OSL::TextureSystem *>(1)), device_type_(device_type)
|
||||
{
|
||||
}
|
||||
|
||||
OSLRenderServices::~OSLRenderServices()
|
||||
{
|
||||
if (m_texturesys) {
|
||||
LOG_INFO << "OSL texture system stats:\n" << m_texturesys->getstats();
|
||||
}
|
||||
}
|
||||
OSLRenderServices::~OSLRenderServices() = default;
|
||||
|
||||
int OSLRenderServices::supports(string_view feature) const
|
||||
{
|
||||
|
|
@ -274,96 +255,43 @@ OSL::TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(
|
|||
OSL::TextureSystem::TextureHandle *OSLRenderServices::get_texture_handle(
|
||||
OSL::ustring filename, OSL::ShadingContext * /*context*/, const OSL::TextureOpt * /*options*/)
|
||||
{
|
||||
OSLTextureHandleMap::iterator it = textures.find(filename);
|
||||
/* Note the mutex lock in find_or_insert() is not so bad for performance because
|
||||
* this function only gets called once per texture handle to create it, not for
|
||||
* every texture access. */
|
||||
auto [it, inserted] = textures.find_or_insert(filename,
|
||||
OSLTextureHandle(OSLTextureHandleType::IMAGE));
|
||||
|
||||
if (device_type_ == DEVICE_CPU) {
|
||||
/* For non-OIIO textures, just return a pointer to our own OSLTextureHandle. */
|
||||
if (it != textures.end()) {
|
||||
if (it->second.type != OSLTextureHandle::OIIO) {
|
||||
return (OSL::TextureSystem::TextureHandle *)(&it->second);
|
||||
}
|
||||
}
|
||||
|
||||
/* Get handle from OpenImageIO. */
|
||||
OSL::TextureSystem *ts = m_texturesys;
|
||||
OSL::TextureSystem::TextureHandle *handle = ts->get_texture_handle(to_ustring(filename));
|
||||
if (handle == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Insert new OSLTextureHandle if needed. */
|
||||
if (it == textures.end()) {
|
||||
textures.insert(filename, OSLTextureHandle(OSLTextureHandle::OIIO));
|
||||
it = textures.find(filename);
|
||||
}
|
||||
|
||||
/* Assign OIIO texture handle and return.
|
||||
* OIIO::unordered_map_concurrent always returns a const handle even if the underlying
|
||||
* std::unordered_map supports updating values just fine. */
|
||||
const_cast<OSLTextureHandle &>(it->second).oiio_handle = handle;
|
||||
return (OSL::TextureSystem::TextureHandle *)(&it->second);
|
||||
if (inserted) {
|
||||
/* Add new texture to image manager. */
|
||||
const ImageHandle handle = image_manager->add_image(filename.string(), ImageParams());
|
||||
OSLTextureHandle *texture_handle = const_cast<OSLTextureHandle *>(&it->second);
|
||||
*texture_handle = OSLTextureHandle(handle);
|
||||
}
|
||||
|
||||
/* Construct GPU texture handle for existing textures. */
|
||||
if (it != textures.end()) {
|
||||
switch (it->second.type) {
|
||||
case OSLTextureHandle::OIIO:
|
||||
return nullptr;
|
||||
case OSLTextureHandle::SVM:
|
||||
if (!it->second.handle.empty() && it->second.handle.get_manager() != image_manager) {
|
||||
it.clear();
|
||||
break;
|
||||
}
|
||||
return reinterpret_cast<OSL::TextureSystem::TextureHandle *>(OSL_TEXTURE_HANDLE_TYPE_SVM |
|
||||
it->second.id);
|
||||
case OSLTextureHandle::IES:
|
||||
if (!it->second.handle.empty() && it->second.handle.get_manager() != image_manager) {
|
||||
it.clear();
|
||||
break;
|
||||
}
|
||||
return reinterpret_cast<OSL::TextureSystem::TextureHandle *>(OSL_TEXTURE_HANDLE_TYPE_IES |
|
||||
it->second.id);
|
||||
case OSLTextureHandle::AO:
|
||||
return reinterpret_cast<OSL::TextureSystem::TextureHandle *>(
|
||||
OSL_TEXTURE_HANDLE_TYPE_AO_OR_BEVEL | 1);
|
||||
case OSLTextureHandle::BEVEL:
|
||||
return reinterpret_cast<OSL::TextureSystem::TextureHandle *>(
|
||||
OSL_TEXTURE_HANDLE_TYPE_AO_OR_BEVEL | 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (!image_manager) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Load new textures using SVM image manager. */
|
||||
const ImageHandle handle = image_manager->add_image(filename.string(), ImageParams());
|
||||
if (handle.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!textures.insert(filename, OSLTextureHandle(handle))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return reinterpret_cast<OSL::TextureSystem::TextureHandle *>(OSL_TEXTURE_HANDLE_TYPE_SVM |
|
||||
handle.kernel_id());
|
||||
/* Construct texture handle. We encode this as a packed integer cast to a pointer,
|
||||
* which is also what we use on the GPU. OSL does not dereference these.
|
||||
*
|
||||
* Note that we must keep the OSLTextureHandle in the map alive, as it holds
|
||||
* the ImageHandle that keeps the image loaded in the manager. */
|
||||
return reinterpret_cast<OSL::TextureSystem::TextureHandle *>(
|
||||
OSL_TEXTURE_HANDLE_ENCODE(it->second.type, it->second.id));
|
||||
}
|
||||
|
||||
bool OSLRenderServices::good(OSL::TextureSystem::TextureHandle *texture_handle)
|
||||
{
|
||||
OSLTextureHandle *handle = (OSLTextureHandle *)texture_handle;
|
||||
return OSL_TEXTURE_HANDLE_TYPE(texture_handle) != OSLTextureHandleType::IMAGE ||
|
||||
OSL_TEXTURE_HANDLE_ID(texture_handle) != KERNEL_IMAGE_NONE;
|
||||
}
|
||||
|
||||
if (handle->oiio_handle) {
|
||||
OSL::TextureSystem *ts = m_texturesys;
|
||||
return ts->good(handle->oiio_handle);
|
||||
}
|
||||
return true;
|
||||
bool OSLRenderServices::is_udim(OSL::TextureSystem::TextureHandle *texture_handle)
|
||||
{
|
||||
return OSL_TEXTURE_HANDLE_TYPE(texture_handle) == OSLTextureHandleType::IMAGE &&
|
||||
OSL_TEXTURE_HANDLE_ID(texture_handle) <= -1;
|
||||
}
|
||||
|
||||
bool OSLRenderServices::texture(OSLUStringHash filename,
|
||||
TextureHandle *texture_handle,
|
||||
TexturePerthread *texture_thread_info,
|
||||
TexturePerthread * /*texture_thread_info*/,
|
||||
OSL::TextureOpt &options,
|
||||
OSL::ShaderGlobals *sg,
|
||||
float s,
|
||||
|
|
@ -374,141 +302,38 @@ bool OSLRenderServices::texture(OSLUStringHash filename,
|
|||
const float dtdy,
|
||||
const int nchannels,
|
||||
float *result,
|
||||
float *dresultds,
|
||||
float *dresultdt,
|
||||
float * /*dresultds*/,
|
||||
float * /*dresultdt*/,
|
||||
OSLUStringHash * /*errormessage*/)
|
||||
{
|
||||
OSLTextureHandle *handle = (OSLTextureHandle *)texture_handle;
|
||||
const OSLTextureHandle::Type texture_type = (handle) ? handle->type : OSLTextureHandle::OIIO;
|
||||
if (texture_handle == nullptr) {
|
||||
if (texture_filenames_seen_.insert(filename).second) {
|
||||
LOG_WARNING << "Open Shading Language texture call can not resolve " << filename.c_str()
|
||||
<< ", filename must be a compile-time constant";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ShaderGlobals *globals = reinterpret_cast<ShaderGlobals *>(sg);
|
||||
ShaderData *sd = globals->sd;
|
||||
const ThreadKernelGlobalsCPU *kernel_globals = globals->kg;
|
||||
const IntegratorStateCPU *state = globals->path_state;
|
||||
bool status = false;
|
||||
|
||||
switch (texture_type) {
|
||||
case OSLTextureHandle::BEVEL: {
|
||||
#ifdef __SHADER_RAYTRACE__
|
||||
/* Bevel shader hack. */
|
||||
if (nchannels >= 3 && state != nullptr) {
|
||||
const int num_samples = (int)s;
|
||||
const float radius = t;
|
||||
const float3 N = svm_bevel(kernel_globals, state, sd, radius, num_samples);
|
||||
result[0] = N.x;
|
||||
result[1] = N.y;
|
||||
result[2] = N.z;
|
||||
status = true;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case OSLTextureHandle::AO: {
|
||||
#ifdef __SHADER_RAYTRACE__
|
||||
/* AO shader hack. */
|
||||
if (state != nullptr) {
|
||||
const int num_samples = (int)s;
|
||||
const float radius = t;
|
||||
const float3 N = make_float3(dsdx, dtdx, dsdy);
|
||||
int flags = 0;
|
||||
if ((int)dtdy) {
|
||||
flags |= NODE_AO_INSIDE;
|
||||
}
|
||||
if ((int)options.sblur) {
|
||||
flags |= NODE_AO_ONLY_LOCAL;
|
||||
}
|
||||
if ((int)options.tblur) {
|
||||
flags |= NODE_AO_GLOBAL_RADIUS;
|
||||
}
|
||||
result[0] = svm_ao(kernel_globals, state, sd, N, radius, num_samples, flags);
|
||||
status = true;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case OSLTextureHandle::SVM: {
|
||||
const float4 rgba = kernel_image_interp_with_udim(
|
||||
kernel_globals, sd, handle->id, dual2(make_float2(s, 1.0f - t)));
|
||||
|
||||
result[0] = rgba[0];
|
||||
if (nchannels > 1) {
|
||||
result[1] = rgba[1];
|
||||
}
|
||||
if (nchannels > 2) {
|
||||
result[2] = rgba[2];
|
||||
}
|
||||
if (nchannels > 3) {
|
||||
result[3] = rgba[3];
|
||||
}
|
||||
status = true;
|
||||
break;
|
||||
}
|
||||
case OSLTextureHandle::IES: {
|
||||
/* IES light. */
|
||||
result[0] = kernel_ies_interp(kernel_globals, handle->id, s, t);
|
||||
status = true;
|
||||
break;
|
||||
}
|
||||
case OSLTextureHandle::OIIO: {
|
||||
/* OpenImageIO texture cache. */
|
||||
OSL::TextureSystem *ts = m_texturesys;
|
||||
|
||||
if (handle && handle->oiio_handle) {
|
||||
if (texture_thread_info == nullptr) {
|
||||
texture_thread_info = kernel_globals->osl.oiio_thread_info;
|
||||
}
|
||||
|
||||
status = ts->texture(handle->oiio_handle,
|
||||
texture_thread_info,
|
||||
options,
|
||||
s,
|
||||
t,
|
||||
dsdx,
|
||||
dtdx,
|
||||
dsdy,
|
||||
dtdy,
|
||||
nchannels,
|
||||
result,
|
||||
dresultds,
|
||||
dresultdt);
|
||||
}
|
||||
else {
|
||||
status = ts->texture(to_ustring(filename),
|
||||
options,
|
||||
s,
|
||||
t,
|
||||
dsdx,
|
||||
dtdx,
|
||||
dsdy,
|
||||
dtdy,
|
||||
nchannels,
|
||||
result,
|
||||
dresultds,
|
||||
dresultdt);
|
||||
}
|
||||
|
||||
if (!status) {
|
||||
/* This might be slow, but prevents error messages leak and
|
||||
* other nasty stuff happening. */
|
||||
ts->geterror();
|
||||
}
|
||||
else if (handle && handle->processor) {
|
||||
ColorSpaceManager::to_scene_linear(handle->processor, result, nchannels);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!status) {
|
||||
rgba_to_nchannels(IMAGE_MISSING_RGBA, nchannels, result);
|
||||
}
|
||||
|
||||
return status;
|
||||
return osl_shared_texture(globals->kg,
|
||||
globals,
|
||||
texture_handle,
|
||||
static_cast<void *>(&options),
|
||||
s,
|
||||
t,
|
||||
dsdx,
|
||||
dtdx,
|
||||
dsdy,
|
||||
dtdy,
|
||||
nchannels,
|
||||
result);
|
||||
}
|
||||
|
||||
bool OSLRenderServices::texture3d(OSLUStringHash filename,
|
||||
TextureHandle *texture_handle,
|
||||
TexturePerthread *texture_thread_info,
|
||||
OSL::TextureOpt &options,
|
||||
TexturePerthread * /*texture_thread_info*/,
|
||||
OSL::TextureOpt & /*options*/,
|
||||
OSL::ShaderGlobals *sg,
|
||||
const OSL::Vec3 &P,
|
||||
const OSL::Vec3 &dPdx,
|
||||
|
|
@ -516,181 +341,116 @@ bool OSLRenderServices::texture3d(OSLUStringHash filename,
|
|||
const OSL::Vec3 &dPdz,
|
||||
const int nchannels,
|
||||
float *result,
|
||||
float *dresultds,
|
||||
float *dresultdt,
|
||||
float *dresultdr,
|
||||
float * /*dresultds*/,
|
||||
float * /*dresultdt*/,
|
||||
float * /*dresultdr*/,
|
||||
OSLUStringHash * /*errormessage*/)
|
||||
{
|
||||
OSLTextureHandle *handle = (OSLTextureHandle *)texture_handle;
|
||||
const OSLTextureHandle::Type texture_type = (handle) ? handle->type : OSLTextureHandle::OIIO;
|
||||
if (texture_handle == nullptr) {
|
||||
if (texture_filenames_seen_.insert(filename).second) {
|
||||
LOG_WARNING << "Open Shading Language texture3d call can not resolve " << filename.c_str()
|
||||
<< ", filename must be a constant";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ShaderGlobals *globals = reinterpret_cast<ShaderGlobals *>(sg);
|
||||
const ThreadKernelGlobalsCPU *kernel_globals = globals->kg;
|
||||
bool status = false;
|
||||
|
||||
switch (texture_type) {
|
||||
case OSLTextureHandle::SVM: {
|
||||
/* Packed texture. */
|
||||
const float3 P_float3 = make_float3(P.x, P.y, P.z);
|
||||
float4 rgba = kernel_image_interp_3d(
|
||||
kernel_globals, globals->sd, handle->id, P_float3, INTERPOLATION_NONE, false);
|
||||
|
||||
result[0] = rgba[0];
|
||||
if (nchannels > 1) {
|
||||
result[1] = rgba[1];
|
||||
}
|
||||
if (nchannels > 2) {
|
||||
result[2] = rgba[2];
|
||||
}
|
||||
if (nchannels > 3) {
|
||||
result[3] = rgba[3];
|
||||
}
|
||||
status = true;
|
||||
break;
|
||||
}
|
||||
case OSLTextureHandle::OIIO: {
|
||||
/* OpenImageIO texture cache. */
|
||||
OSL::TextureSystem *ts = m_texturesys;
|
||||
|
||||
if (handle && handle->oiio_handle) {
|
||||
if (texture_thread_info == nullptr) {
|
||||
texture_thread_info = kernel_globals->osl.oiio_thread_info;
|
||||
}
|
||||
|
||||
status = ts->texture3d(handle->oiio_handle,
|
||||
texture_thread_info,
|
||||
options,
|
||||
P,
|
||||
dPdx,
|
||||
dPdy,
|
||||
dPdz,
|
||||
nchannels,
|
||||
result,
|
||||
dresultds,
|
||||
dresultdt,
|
||||
dresultdr);
|
||||
}
|
||||
else {
|
||||
status = ts->texture3d(to_ustring(filename),
|
||||
options,
|
||||
P,
|
||||
dPdx,
|
||||
dPdy,
|
||||
dPdz,
|
||||
nchannels,
|
||||
result,
|
||||
dresultds,
|
||||
dresultdt,
|
||||
dresultdr);
|
||||
}
|
||||
|
||||
if (!status) {
|
||||
/* This might be slow, but prevents error messages leak and
|
||||
* other nasty stuff happening. */
|
||||
ts->geterror();
|
||||
}
|
||||
else if (handle && handle->processor) {
|
||||
ColorSpaceManager::to_scene_linear(handle->processor, result, nchannels);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OSLTextureHandle::IES:
|
||||
case OSLTextureHandle::AO:
|
||||
case OSLTextureHandle::BEVEL: {
|
||||
status = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!status) {
|
||||
rgba_to_nchannels(IMAGE_MISSING_RGBA, nchannels, result);
|
||||
}
|
||||
|
||||
return status;
|
||||
return osl_shared_texture3d(globals->kg,
|
||||
globals,
|
||||
texture_handle,
|
||||
make_float3(P.x, P.y, P.z),
|
||||
make_float3(dPdx.x, dPdx.y, dPdx.z),
|
||||
make_float3(dPdy.x, dPdy.y, dPdy.z),
|
||||
make_float3(dPdz.x, dPdz.y, dPdz.z),
|
||||
nchannels,
|
||||
result);
|
||||
}
|
||||
|
||||
bool OSLRenderServices::environment(OSLUStringHash filename,
|
||||
TextureHandle *texture_handle,
|
||||
TexturePerthread *thread_info,
|
||||
OSL::TextureOpt &options,
|
||||
TexturePerthread * /*thread_info*/,
|
||||
OSL::TextureOpt & /*options*/,
|
||||
OSL::ShaderGlobals *sg,
|
||||
const OSL::Vec3 &R,
|
||||
const OSL::Vec3 &dRdx,
|
||||
const OSL::Vec3 &dRdy,
|
||||
const int nchannels,
|
||||
float *result,
|
||||
float *dresultds,
|
||||
float *dresultdt,
|
||||
float * /*dresultds*/,
|
||||
float * /*dresultdt*/,
|
||||
OSLUStringHash * /*errormessage*/)
|
||||
{
|
||||
OSLTextureHandle *handle = (OSLTextureHandle *)texture_handle;
|
||||
OSL::TextureSystem *ts = m_texturesys;
|
||||
ShaderGlobals *globals = reinterpret_cast<ShaderGlobals *>(sg);
|
||||
bool status = false;
|
||||
|
||||
if (handle && handle->oiio_handle) {
|
||||
if (thread_info == nullptr) {
|
||||
thread_info = globals->kg->osl.oiio_thread_info;
|
||||
if (texture_handle == nullptr) {
|
||||
if (texture_filenames_seen_.insert(filename).second) {
|
||||
LOG_WARNING << "Open Shading Language environment call can not resolve " << filename.c_str()
|
||||
<< ", filename must be a constant string after optimization";
|
||||
}
|
||||
|
||||
status = ts->environment(handle->oiio_handle,
|
||||
thread_info,
|
||||
options,
|
||||
R,
|
||||
dRdx,
|
||||
dRdy,
|
||||
nchannels,
|
||||
result,
|
||||
dresultds,
|
||||
dresultdt);
|
||||
}
|
||||
else {
|
||||
status = ts->environment(
|
||||
to_ustring(filename), options, R, dRdx, dRdy, nchannels, result, dresultds, dresultdt);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!status) {
|
||||
rgba_to_nchannels(IMAGE_MISSING_RGBA, nchannels, result);
|
||||
}
|
||||
else if (handle && handle->processor) {
|
||||
ColorSpaceManager::to_scene_linear(handle->processor, result, nchannels);
|
||||
}
|
||||
ShaderGlobals *globals = reinterpret_cast<ShaderGlobals *>(sg);
|
||||
|
||||
return status;
|
||||
return osl_shared_environment(globals->kg,
|
||||
globals,
|
||||
texture_handle,
|
||||
make_float3(R.x, R.y, R.z),
|
||||
make_float3(dRdx.x, dRdx.y, dRdx.z),
|
||||
make_float3(dRdy.x, dRdy.y, dRdy.z),
|
||||
nchannels,
|
||||
result);
|
||||
}
|
||||
|
||||
bool OSLRenderServices::get_texture_info(OSLUStringHash filename,
|
||||
TextureHandle *texture_handle,
|
||||
TexturePerthread *texture_thread_info,
|
||||
OSL::ShaderGlobals * /*sg*/,
|
||||
const int subimage,
|
||||
TexturePerthread * /*texture_thread_info*/,
|
||||
OSL::ShaderGlobals *sg,
|
||||
const int /*subimage*/,
|
||||
OSLUStringHash dataname,
|
||||
const TypeDesc datatype,
|
||||
void *data,
|
||||
OSLUStringHash * /*errormessage*/)
|
||||
{
|
||||
OSLTextureHandle *handle = (OSLTextureHandle *)texture_handle;
|
||||
OSL::TextureSystem *ts = m_texturesys;
|
||||
|
||||
if (handle) {
|
||||
/* No texture info for other texture types. */
|
||||
if (handle->type != OSLTextureHandle::OIIO) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (handle->oiio_handle) {
|
||||
/* Get texture info from OpenImageIO. */
|
||||
return ts->get_texture_info(handle->oiio_handle,
|
||||
texture_thread_info,
|
||||
subimage,
|
||||
to_ustring(dataname),
|
||||
datatype,
|
||||
data);
|
||||
if (texture_handle == nullptr) {
|
||||
if (texture_filenames_seen_.insert(filename).second) {
|
||||
LOG_WARNING << "Open Shading Language gettextureinfo call can not resolve "
|
||||
<< filename.c_str() << ", filename must be a constant";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Get texture info from OpenImageIO, slower using filename. */
|
||||
return ts->get_texture_info(
|
||||
to_ustring(filename), subimage, to_ustring(dataname), datatype, data);
|
||||
ShaderGlobals *globals = reinterpret_cast<ShaderGlobals *>(sg);
|
||||
const ThreadKernelGlobalsCPU *kg = globals->kg;
|
||||
|
||||
return osl_shared_get_texture_info(
|
||||
kg, texture_handle, make_float2(0.0f, 0.0f), false, dataname, datatype, data);
|
||||
}
|
||||
|
||||
bool OSLRenderServices::get_texture_info(OSLUStringHash filename,
|
||||
TextureHandle *texture_handle,
|
||||
float s,
|
||||
float t,
|
||||
TexturePerthread * /*texture_thread_info*/,
|
||||
OSL::ShaderGlobals *sg,
|
||||
const int /*subimage*/,
|
||||
OSLUStringHash dataname,
|
||||
const TypeDesc datatype,
|
||||
void *data,
|
||||
OSLUStringHash * /*errormessage*/)
|
||||
{
|
||||
if (texture_handle == nullptr) {
|
||||
if (texture_filenames_seen_.insert(filename).second) {
|
||||
LOG_WARNING << "Open Shading Language gettextureinfo call can not resolve "
|
||||
<< filename.c_str() << ", filename must be a constant";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ShaderGlobals *globals = reinterpret_cast<ShaderGlobals *>(sg);
|
||||
const ThreadKernelGlobalsCPU *kg = globals->kg;
|
||||
|
||||
return osl_shared_get_texture_info(
|
||||
kg, texture_handle, make_float2(s, t), true, dataname, datatype, data);
|
||||
}
|
||||
|
||||
int OSLRenderServices::pointcloud_search(OSL::ShaderGlobals * /*sg*/,
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
#include <OpenImageIO/unordered_map_concurrent.h>
|
||||
|
||||
#include "util/concurrent_set.h"
|
||||
|
||||
#include "scene/image.h"
|
||||
|
||||
#include "kernel/osl/compat.h"
|
||||
|
|
@ -46,22 +48,17 @@ struct ThreadKernelGlobalsCPU;
|
|||
* y:svm_image_texture_ids_a, z:tile_b, w:svm_image_texture_ids_b etc. */
|
||||
|
||||
struct OSLTextureHandle {
|
||||
enum Type { OIIO, SVM, IES, BEVEL, AO };
|
||||
OSLTextureHandle(const OSLTextureHandleType type, const int id = -1) : type(type), id(id) {}
|
||||
|
||||
OSLTextureHandle(Type type, const int id = -1) : type(type), id(id) {}
|
||||
OSLTextureHandle(const ImageHandle &handle) : id(handle.kernel_id()), handle(handle) {}
|
||||
|
||||
OSLTextureHandle(const ImageHandle &handle) : type(SVM), id(handle.kernel_id()), handle(handle)
|
||||
{
|
||||
}
|
||||
|
||||
Type type;
|
||||
OSLTextureHandleType type = OSLTextureHandleType::IMAGE;
|
||||
int id = -1;
|
||||
OSL::TextureSystem::TextureHandle *oiio_handle = nullptr;
|
||||
ColorSpaceProcessor *processor = nullptr;
|
||||
ImageHandle handle;
|
||||
};
|
||||
|
||||
using OSLTextureHandleMap = OIIO::unordered_map_concurrent<OSLUStringHash, OSLTextureHandle>;
|
||||
using OSLTextureFilenameMap = concurrent_set<OSLUStringHash>;
|
||||
|
||||
/* OSL Render Services
|
||||
*
|
||||
|
|
@ -69,7 +66,7 @@ using OSLTextureHandleMap = OIIO::unordered_map_concurrent<OSLUStringHash, OSLTe
|
|||
|
||||
class OSLRenderServices : public OSL::RendererServices {
|
||||
public:
|
||||
OSLRenderServices(OSL::TextureSystem *texture_system, const int device_type);
|
||||
OSLRenderServices(const int device_type);
|
||||
~OSLRenderServices() override;
|
||||
|
||||
static void register_closures(OSL::ShadingSystem *ss);
|
||||
|
|
@ -185,6 +182,7 @@ class OSLRenderServices : public OSL::RendererServices {
|
|||
const OSL::TextureOpt *options) override;
|
||||
|
||||
bool good(OSL::TextureSystem::TextureHandle *texture_handle) override;
|
||||
bool is_udim(OSL::TextureSystem::TextureHandle *texture_handle) override;
|
||||
|
||||
bool texture(OSLUStringHash filename,
|
||||
OSL::TextureSystem::TextureHandle *texture_handle,
|
||||
|
|
@ -243,6 +241,18 @@ class OSLRenderServices : public OSL::RendererServices {
|
|||
void *data,
|
||||
OSLUStringHash *errormessage) override;
|
||||
|
||||
bool get_texture_info(OSLUStringHash filename,
|
||||
TextureHandle *texture_handle,
|
||||
float s,
|
||||
float t,
|
||||
TexturePerthread *texture_thread_info,
|
||||
OSL::ShaderGlobals *sg,
|
||||
const int subimage,
|
||||
OSLUStringHash dataname,
|
||||
const TypeDesc datatype,
|
||||
void *data,
|
||||
OSLUStringHash *errormessage) override;
|
||||
|
||||
static bool get_attribute(ShaderGlobals *globals,
|
||||
ShaderData *sd,
|
||||
bool derivatives,
|
||||
|
|
@ -276,6 +286,13 @@ class OSLRenderServices : public OSL::RendererServices {
|
|||
|
||||
private:
|
||||
int device_type_;
|
||||
|
||||
/* We don't support lookup by filename without a handle, which is required anyway
|
||||
* for GPU, and simplifies the implementation on CPU. This keeps track of the
|
||||
* ones we have seen to emit a warning only once. */
|
||||
OSLTextureFilenameMap texture_filenames_seen_;
|
||||
|
||||
thread_mutex textures_mutex;
|
||||
};
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
|
|
|||
|
|
@ -260,6 +260,8 @@ ccl_device_extern bool osl_get_attribute(ccl_private ShaderGlobals *sg,
|
|||
return osl_shared_get_object_standard_attribute(kg, sg, sd, name, type, derivatives, res);
|
||||
}
|
||||
|
||||
/* Renderer services */
|
||||
|
||||
ccl_device_extern bool rend_get_userdata(RSDeviceString name,
|
||||
ccl_private void *data,
|
||||
int data_size,
|
||||
|
|
@ -268,6 +270,8 @@ ccl_device_extern bool rend_get_userdata(RSDeviceString name,
|
|||
{
|
||||
if (type.basetype == TypeDesc::PTR) {
|
||||
kernel_assert(data_size == sizeof(void *));
|
||||
(void)data_size;
|
||||
|
||||
ccl_private void **ptr_data = (ccl_private void **)data;
|
||||
|
||||
if (name.val == DeviceStrings::u_colorsystem) {
|
||||
|
|
@ -287,51 +291,21 @@ ccl_device_extern bool rs_texture(ccl_private ShaderGlobals *sg,
|
|||
RSDeviceString /*filename*/,
|
||||
ccl_private void *texture_handle,
|
||||
ccl_private void * /*texture_thread_info*/,
|
||||
ccl_private OSLTextureOptions * /*opt*/,
|
||||
ccl_private OSLTextureOptions *opt,
|
||||
const float s,
|
||||
const float t,
|
||||
const float /*dsdx*/,
|
||||
const float /*dtdx*/,
|
||||
const float /*dsdy*/,
|
||||
const float /*dtdy*/,
|
||||
const float dsdx,
|
||||
const float dtdx,
|
||||
const float dsdy,
|
||||
const float dtdy,
|
||||
const int nchannels,
|
||||
ccl_private float *result,
|
||||
ccl_private float * /*dresultds*/,
|
||||
ccl_private float * /*dresultdt*/,
|
||||
ccl_private void * /*errormessage*/)
|
||||
{
|
||||
const unsigned int type = OSL_TEXTURE_HANDLE_TYPE(texture_handle);
|
||||
const unsigned int image_texture_id = OSL_TEXTURE_HANDLE_ID(texture_handle);
|
||||
|
||||
switch (type) {
|
||||
case OSL_TEXTURE_HANDLE_TYPE_SVM: {
|
||||
ccl_private ShaderData *sd = sg->sd;
|
||||
const float4 rgba = kernel_image_interp_with_udim(
|
||||
nullptr, sd, image_texture_id, dual2(make_float2(s, 1.0f - t)));
|
||||
if (nchannels > 0) {
|
||||
result[0] = rgba.x;
|
||||
}
|
||||
if (nchannels > 1) {
|
||||
result[1] = rgba.y;
|
||||
}
|
||||
if (nchannels > 2) {
|
||||
result[2] = rgba.z;
|
||||
}
|
||||
if (nchannels > 3) {
|
||||
result[3] = rgba.w;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
case OSL_TEXTURE_HANDLE_TYPE_IES: {
|
||||
if (nchannels > 0) {
|
||||
result[0] = kernel_ies_interp(nullptr, image_texture_id, s, t);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return osl_shared_texture(
|
||||
nullptr, sg, texture_handle, opt, s, t, dsdx, dtdx, dsdy, dtdy, nchannels, result);
|
||||
}
|
||||
|
||||
ccl_device_extern bool rs_texture3d(ccl_private ShaderGlobals *sg,
|
||||
|
|
@ -340,9 +314,9 @@ ccl_device_extern bool rs_texture3d(ccl_private ShaderGlobals *sg,
|
|||
ccl_private void * /*texture_thread_info*/,
|
||||
ccl_private OSLTextureOptions * /*opt*/,
|
||||
const ccl_private float3 *P,
|
||||
const ccl_private float3 * /*dPdx*/,
|
||||
const ccl_private float3 * /*dPdy*/,
|
||||
const ccl_private float3 * /*dPdz*/,
|
||||
const ccl_private float3 *dPdx,
|
||||
const ccl_private float3 *dPdy,
|
||||
const ccl_private float3 *dPdz,
|
||||
const int nchannels,
|
||||
ccl_private float *result,
|
||||
ccl_private float * /*dresultds*/,
|
||||
|
|
@ -350,77 +324,55 @@ ccl_device_extern bool rs_texture3d(ccl_private ShaderGlobals *sg,
|
|||
ccl_private float * /*dresultdr*/,
|
||||
ccl_private void * /*errormessage*/)
|
||||
{
|
||||
const unsigned int type = OSL_TEXTURE_HANDLE_TYPE(texture_handle);
|
||||
const unsigned int image_texture_id = OSL_TEXTURE_HANDLE_ID(texture_handle);
|
||||
|
||||
switch (type) {
|
||||
case OSL_TEXTURE_HANDLE_TYPE_SVM: {
|
||||
const float4 rgba = kernel_image_interp_3d(
|
||||
nullptr, sg->sd, image_texture_id, *P, INTERPOLATION_NONE, false);
|
||||
if (nchannels > 0) {
|
||||
result[0] = rgba.x;
|
||||
}
|
||||
if (nchannels > 1) {
|
||||
result[1] = rgba.y;
|
||||
}
|
||||
if (nchannels > 2) {
|
||||
result[2] = rgba.z;
|
||||
}
|
||||
if (nchannels > 3) {
|
||||
result[3] = rgba.w;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return osl_shared_texture3d(
|
||||
nullptr, sg, texture_handle, *P, *dPdx, *dPdy, *dPdz, nchannels, result);
|
||||
}
|
||||
|
||||
ccl_device_extern bool rs_environment(ccl_private ShaderGlobals * /*sg*/,
|
||||
ccl_device_extern bool rs_environment(ccl_private ShaderGlobals *sg,
|
||||
RSDeviceString /*filename*/,
|
||||
ccl_private void * /*texture_handle */,
|
||||
ccl_private void *texture_handle,
|
||||
ccl_private void * /*texture_thread_info*/,
|
||||
ccl_private OSLTextureOptions * /*opt*/,
|
||||
const ccl_private float3 * /*R*/,
|
||||
const ccl_private float3 * /*dRdx*/,
|
||||
const ccl_private float3 * /*dRdy*/,
|
||||
const ccl_private float3 *R,
|
||||
const ccl_private float3 *dRdx,
|
||||
const ccl_private float3 *dRdy,
|
||||
const int nchannels,
|
||||
ccl_private float *result,
|
||||
ccl_private float * /*dresultds*/,
|
||||
ccl_private float * /*dresultdt*/,
|
||||
ccl_private void * /*errormessage*/)
|
||||
{
|
||||
rgba_to_nchannels(IMAGE_MISSING_RGBA, nchannels, result);
|
||||
return false;
|
||||
return osl_shared_environment(nullptr, sg, texture_handle, *R, *dRdx, *dRdy, nchannels, result);
|
||||
}
|
||||
|
||||
ccl_device_extern bool rs_get_texture_info(ccl_private ShaderGlobals * /*sg*/,
|
||||
RSDeviceString /*filename*/,
|
||||
ccl_private void * /*texture_handle*/,
|
||||
ccl_private void *texture_handle,
|
||||
ccl_private void * /*texture_thread_info*/,
|
||||
int /*subimage*/,
|
||||
RSDeviceString /*dataname*/,
|
||||
TypeDesc /* datatype*/,
|
||||
ccl_private void * /*data*/,
|
||||
RSDeviceString dataname,
|
||||
TypeDesc datatype,
|
||||
ccl_private void *data,
|
||||
ccl_private void * /*errormessage*/)
|
||||
{
|
||||
return false;
|
||||
return osl_shared_get_texture_info(
|
||||
nullptr, texture_handle, zero_float2(), false, dataname.val, datatype, data);
|
||||
}
|
||||
|
||||
ccl_device_extern bool rs_get_texture_info_st(ccl_private ShaderGlobals * /*sg*/,
|
||||
RSDeviceString /*filename*/,
|
||||
ccl_private void * /*texture_handle*/,
|
||||
const float /*s*/,
|
||||
const float /*t*/,
|
||||
ccl_private void *texture_handle,
|
||||
const float s,
|
||||
const float t,
|
||||
ccl_private void * /*texture_thread_info*/,
|
||||
int /*subimage*/,
|
||||
RSDeviceString /*dataname*/,
|
||||
TypeDesc /*datatype*/,
|
||||
ccl_private void * /*data*/,
|
||||
RSDeviceString dataname,
|
||||
TypeDesc datatype,
|
||||
ccl_private void *data,
|
||||
ccl_private void * /*errormessage*/)
|
||||
{
|
||||
return false;
|
||||
return osl_shared_get_texture_info(
|
||||
nullptr, texture_handle, make_float2(s, t), true, dataname.val, datatype, data);
|
||||
}
|
||||
|
||||
ccl_device_extern int rs_pointcloud_search(ccl_private ShaderGlobals * /*sg*/,
|
||||
|
|
|
|||
|
|
@ -17,10 +17,20 @@
|
|||
#include "kernel/geom/primitive.h"
|
||||
#include "kernel/geom/triangle.h"
|
||||
|
||||
#include "kernel/image.h"
|
||||
#include "kernel/osl/strings.h"
|
||||
#include "kernel/util/differential.h"
|
||||
#include "kernel/util/ies.h"
|
||||
#include "kernel/util/image_2d.h"
|
||||
#include "kernel/util/image_3d.h"
|
||||
|
||||
#include "util/hash.h"
|
||||
|
||||
#ifndef __KERNEL_GPU__
|
||||
# include "kernel/svm/ao.h"
|
||||
# include "kernel/svm/bevel.h"
|
||||
#endif
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
/* For GPU duplicate part of OpenImageIO TypeDesc as we don't use the headers at compile time. */
|
||||
|
|
@ -574,7 +584,255 @@ ccl_device_forceinline void rgba_to_nchannels(const float4 rgba,
|
|||
}
|
||||
}
|
||||
|
||||
/* Object Attributes */
|
||||
ccl_device bool osl_shared_get_texture_info(KernelGlobals kg,
|
||||
ccl_private void *texture_handle,
|
||||
const float2 uv,
|
||||
const bool use_uv,
|
||||
DeviceString dataname,
|
||||
const TypeDesc datatype,
|
||||
void *data)
|
||||
{
|
||||
const OSLTextureHandleType texture_type = OSL_TEXTURE_HANDLE_TYPE(texture_handle);
|
||||
const int image_texture_or_udim_id = OSL_TEXTURE_HANDLE_ID(texture_handle);
|
||||
|
||||
if (texture_type != OSLTextureHandleType::IMAGE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int image_texture_id = image_texture_or_udim_id;
|
||||
if (use_uv) {
|
||||
float2 local_uv = uv;
|
||||
image_texture_id = kernel_image_udim_map(kg, image_texture_or_udim_id, local_uv);
|
||||
}
|
||||
if (image_texture_id == KERNEL_IMAGE_NONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const ccl_global KernelImageTexture &tex = kernel_data_fetch(image_textures, image_texture_id);
|
||||
if (tex.image_info_id == KERNEL_IMAGE_NONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dataname == DeviceStrings::u_resolution) {
|
||||
if (is_type_int2(datatype)) {
|
||||
int *res = static_cast<int *>(data);
|
||||
res[0] = int(tex.width);
|
||||
res[1] = int(tex.height);
|
||||
return true;
|
||||
}
|
||||
if (is_type_float2(datatype)) {
|
||||
float *res = static_cast<float *>(data);
|
||||
res[0] = float(tex.width);
|
||||
res[1] = float(tex.height);
|
||||
return true;
|
||||
}
|
||||
if (is_type_int3(datatype)) {
|
||||
int *res = static_cast<int *>(data);
|
||||
res[0] = int(tex.width);
|
||||
res[1] = int(tex.height);
|
||||
res[2] = 1;
|
||||
return true;
|
||||
}
|
||||
if (is_type_float3(datatype)) {
|
||||
float *res = static_cast<float *>(data);
|
||||
res[0] = float(tex.width);
|
||||
res[1] = float(tex.height);
|
||||
res[2] = 1.0f;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (dataname == DeviceStrings::u_channels) {
|
||||
if (datatype == TypeInt) {
|
||||
const int image_info_id = tex.image_info_id;
|
||||
const ccl_global KernelImageInfo &info = kernel_data_fetch(image_info, image_info_id);
|
||||
int channels = 4;
|
||||
switch (info.data_type) {
|
||||
case IMAGE_DATA_TYPE_FLOAT4:
|
||||
case IMAGE_DATA_TYPE_BYTE4:
|
||||
case IMAGE_DATA_TYPE_HALF4:
|
||||
case IMAGE_DATA_TYPE_USHORT4:
|
||||
case IMAGE_DATA_TYPE_NANOVDB_FLOAT4:
|
||||
channels = 4;
|
||||
break;
|
||||
case IMAGE_DATA_TYPE_NANOVDB_FLOAT3:
|
||||
channels = 3;
|
||||
break;
|
||||
case IMAGE_DATA_TYPE_FLOAT:
|
||||
case IMAGE_DATA_TYPE_BYTE:
|
||||
case IMAGE_DATA_TYPE_HALF:
|
||||
case IMAGE_DATA_TYPE_USHORT:
|
||||
case IMAGE_DATA_TYPE_NANOVDB_FLOAT:
|
||||
case IMAGE_DATA_TYPE_NANOVDB_FPN:
|
||||
case IMAGE_DATA_TYPE_NANOVDB_FP16:
|
||||
channels = 1;
|
||||
break;
|
||||
case IMAGE_DATA_TYPE_NANOVDB_EMPTY:
|
||||
channels = 0;
|
||||
break;
|
||||
}
|
||||
*static_cast<int *>(data) = channels;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (dataname == DeviceStrings::u_exists) {
|
||||
if (datatype == TypeInt) {
|
||||
*static_cast<int *>(data) = 1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
ccl_device bool osl_shared_texture(KernelGlobals kg,
|
||||
ccl_private ShaderGlobals *sg,
|
||||
ccl_private void *texture_handle,
|
||||
ccl_private void *opt_void,
|
||||
float s,
|
||||
float t,
|
||||
float dsdx,
|
||||
float dtdx,
|
||||
float dsdy,
|
||||
float dtdy,
|
||||
int nchannels,
|
||||
float *result)
|
||||
{
|
||||
const OSLTextureHandleType type = OSL_TEXTURE_HANDLE_TYPE(texture_handle);
|
||||
const int image_texture_or_udim_id = OSL_TEXTURE_HANDLE_ID(texture_handle);
|
||||
|
||||
ccl_private ShaderData *sd = sg->sd;
|
||||
bool status = false;
|
||||
|
||||
switch (type) {
|
||||
case OSLTextureHandleType::IMAGE: {
|
||||
const dual2 uv({s, t}, {dsdx, -dtdx}, {dsdy, -dtdy});
|
||||
|
||||
const float4 rgba = kernel_image_interp_with_udim(kg, sd, image_texture_or_udim_id, uv);
|
||||
rgba_to_nchannels(rgba, nchannels, result);
|
||||
|
||||
status = true;
|
||||
break;
|
||||
}
|
||||
case OSLTextureHandleType::IES: {
|
||||
if (nchannels > 0) {
|
||||
result[0] = kernel_ies_interp(kg, image_texture_or_udim_id, s, t);
|
||||
}
|
||||
status = true;
|
||||
break;
|
||||
}
|
||||
case OSLTextureHandleType::BEVEL: {
|
||||
#ifndef __KERNEL_GPU__
|
||||
/* Bevel shader hack. */
|
||||
ConstIntegratorState state = sg->path_state;
|
||||
if (nchannels >= 3 && state != nullptr) {
|
||||
const int num_samples = int(s);
|
||||
const float radius = t;
|
||||
const float3 N = svm_bevel(kg, state, sd, radius, num_samples);
|
||||
result[0] = N.x;
|
||||
result[1] = N.y;
|
||||
result[2] = N.z;
|
||||
status = true;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case OSLTextureHandleType::AO: {
|
||||
#ifndef __KERNEL_GPU__
|
||||
/* AO shader hack. */
|
||||
ConstIntegratorState state = sg->path_state;
|
||||
const OSL::TextureOpt *options = static_cast<const OSL::TextureOpt *>(opt_void);
|
||||
if (state != nullptr) {
|
||||
const int num_samples = int(s);
|
||||
const float radius = t;
|
||||
const float3 N = make_float3(dsdx, dtdx, dsdy);
|
||||
int flags = 0;
|
||||
if (int(dtdy)) {
|
||||
flags |= NODE_AO_INSIDE;
|
||||
}
|
||||
if (int(options->sblur)) {
|
||||
flags |= NODE_AO_ONLY_LOCAL;
|
||||
}
|
||||
if (int(options->tblur)) {
|
||||
flags |= NODE_AO_GLOBAL_RADIUS;
|
||||
}
|
||||
result[0] = svm_ao(kg, state, sd, N, radius, num_samples, flags);
|
||||
status = true;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!status) {
|
||||
rgba_to_nchannels(IMAGE_MISSING_RGBA, nchannels, result);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
ccl_device bool osl_shared_texture3d(KernelGlobals kg,
|
||||
ccl_private ShaderGlobals *sg,
|
||||
ccl_private void *texture_handle,
|
||||
float3 P,
|
||||
float3 /*dPdx*/,
|
||||
float3 /*dPdy*/,
|
||||
float3 /*dPdz*/,
|
||||
int nchannels,
|
||||
float *result)
|
||||
{
|
||||
const OSLTextureHandleType type = OSL_TEXTURE_HANDLE_TYPE(texture_handle);
|
||||
const int image_texture_id = OSL_TEXTURE_HANDLE_ID(texture_handle);
|
||||
|
||||
bool status = false;
|
||||
|
||||
switch (type) {
|
||||
case OSLTextureHandleType::IMAGE: {
|
||||
const float4 rgba = kernel_image_interp_3d(
|
||||
kg, sg->sd, image_texture_id, P, INTERPOLATION_NONE, false);
|
||||
|
||||
rgba_to_nchannels(rgba, nchannels, result);
|
||||
status = true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!status) {
|
||||
rgba_to_nchannels(IMAGE_MISSING_RGBA, nchannels, result);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
ccl_device bool osl_shared_environment(KernelGlobals kg,
|
||||
ccl_private ShaderGlobals *sg,
|
||||
ccl_private void *texture_handle,
|
||||
float3 R,
|
||||
float3 dRdx,
|
||||
float3 dRdy,
|
||||
int nchannels,
|
||||
float *result)
|
||||
{
|
||||
const OSLTextureHandleType type = OSL_TEXTURE_HANDLE_TYPE(texture_handle);
|
||||
const int image_texture_or_udim_id = OSL_TEXTURE_HANDLE_ID(texture_handle);
|
||||
|
||||
if (type == OSLTextureHandleType::IMAGE) {
|
||||
ccl_private ShaderData *sd = sg->sd;
|
||||
const dual3 R_dual(R, dRdx, dRdy);
|
||||
/* Environment call is always equirectangular. */
|
||||
const dual2 uv(direction_to_equirectangular(R_dual.val));
|
||||
const float4 rgba = kernel_image_interp_with_udim(kg, sd, image_texture_or_udim_id, uv);
|
||||
rgba_to_nchannels(rgba, nchannels, result);
|
||||
return true;
|
||||
}
|
||||
|
||||
rgba_to_nchannels(IMAGE_MISSING_RGBA, nchannels, result);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Object Attribute Retrieval */
|
||||
|
||||
template<typename T>
|
||||
ccl_device_inline bool osl_shared_get_object_attribute_impl(KernelGlobals kg,
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ shader node_environment_texture(
|
|||
|
||||
/* todo: use environment for better texture filtering of equirectangular */
|
||||
Color = (color)texture(
|
||||
filename, p[0], 1.0 - p[1], "wrap", "periodic", "interp", interpolation, "alpha", Alpha);
|
||||
filename, p[0], p[1], "wrap", "periodic", "interp", interpolation, "alpha", Alpha);
|
||||
|
||||
if (ignore_alpha) {
|
||||
Alpha = 1.0;
|
||||
|
|
|
|||
|
|
@ -51,21 +51,11 @@ color image_texture_lookup(string filename,
|
|||
int ignore_alpha,
|
||||
int unassociate_alpha,
|
||||
int is_float,
|
||||
int is_tiled,
|
||||
string interpolation,
|
||||
string extension)
|
||||
{
|
||||
/* Flip the y coordinate, but preserve UDIM tiles. */
|
||||
float flip_v;
|
||||
if (is_tiled) {
|
||||
float v_i = floor(v);
|
||||
flip_v = v_i + (1.0 - (v - v_i));
|
||||
}
|
||||
else {
|
||||
flip_v = 1.0 - v;
|
||||
}
|
||||
color rgb = (color)texture(
|
||||
filename, u, flip_v, "wrap", extension, "interp", interpolation, "alpha", Alpha);
|
||||
filename, u, v, "wrap", extension, "interp", interpolation, "alpha", Alpha);
|
||||
|
||||
if (ignore_alpha) {
|
||||
Alpha = 1.0;
|
||||
|
|
@ -95,7 +85,6 @@ shader node_image_texture(int use_mapping = 0,
|
|||
int compress_as_srgb = 0,
|
||||
int ignore_alpha = 0,
|
||||
int unassociate_alpha = 0,
|
||||
int is_tiled = 0,
|
||||
int is_float = 1,
|
||||
output color Color = 0.0,
|
||||
output float Alpha = 1.0)
|
||||
|
|
@ -114,7 +103,6 @@ shader node_image_texture(int use_mapping = 0,
|
|||
ignore_alpha,
|
||||
unassociate_alpha,
|
||||
is_float,
|
||||
is_tiled,
|
||||
interpolation,
|
||||
extension);
|
||||
}
|
||||
|
|
@ -195,7 +183,6 @@ shader node_image_texture(int use_mapping = 0,
|
|||
ignore_alpha,
|
||||
unassociate_alpha,
|
||||
is_float,
|
||||
0,
|
||||
interpolation,
|
||||
extension);
|
||||
Alpha += weight[0] * tmp_alpha;
|
||||
|
|
@ -210,7 +197,6 @@ shader node_image_texture(int use_mapping = 0,
|
|||
ignore_alpha,
|
||||
unassociate_alpha,
|
||||
is_float,
|
||||
0,
|
||||
interpolation,
|
||||
extension);
|
||||
Alpha += weight[1] * tmp_alpha;
|
||||
|
|
@ -225,7 +211,6 @@ shader node_image_texture(int use_mapping = 0,
|
|||
ignore_alpha,
|
||||
unassociate_alpha,
|
||||
is_float,
|
||||
0,
|
||||
interpolation,
|
||||
extension);
|
||||
Alpha += weight[2] * tmp_alpha;
|
||||
|
|
@ -241,7 +226,6 @@ shader node_image_texture(int use_mapping = 0,
|
|||
ignore_alpha,
|
||||
unassociate_alpha,
|
||||
is_float,
|
||||
0,
|
||||
interpolation,
|
||||
extension);
|
||||
}
|
||||
|
|
@ -255,7 +239,6 @@ shader node_image_texture(int use_mapping = 0,
|
|||
ignore_alpha,
|
||||
unassociate_alpha,
|
||||
is_float,
|
||||
0,
|
||||
interpolation,
|
||||
extension);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ color sky_radiance_nishita(vector dir, float sky_data[11], string filename, stri
|
|||
}
|
||||
/* Undo the non-linear transformation from the sky LUT */
|
||||
float dir_elevation_abs = (dir_elevation < 0.0) ? -dir_elevation : dir_elevation;
|
||||
float y = 1.0 - (sqrt(dir_elevation_abs / M_PI_2) * signx(dir_elevation) * 0.5 + 0.5);
|
||||
float y = sqrt(dir_elevation_abs / M_PI_2) * signx(dir_elevation) * 0.5 + 0.5;
|
||||
color xyz = (color)texture(filename, x, y, "wrap", "clamp", "interp", "linear", "alpha", alpha);
|
||||
color rgb_sky = xyz_to_rgb(xyz[0], xyz[1], xyz[2]);
|
||||
|
||||
|
|
|
|||
|
|
@ -99,6 +99,14 @@ OSL_DEVICE_STRING(u_aperture_size, "cam:aperture_size", 3708482920470008383ull)
|
|||
OSL_DEVICE_STRING(u_aperture_position, "cam:aperture_position", 12926784411960338650ull)
|
||||
OSL_DEVICE_STRING(u_focal_distance, "cam:focal_distance", 7162995161881858159ull)
|
||||
|
||||
OSL_DEVICE_STRING(u_resolution, "resolution", 2307859618413965908ull)
|
||||
OSL_DEVICE_STRING(u_channels, "channels", 12748693449878651001ull)
|
||||
OSL_DEVICE_STRING(u_format, "format", 17018903787179094860ull)
|
||||
OSL_DEVICE_STRING(u_fileformat, "fileformat", 4858431823914058665ull)
|
||||
OSL_DEVICE_STRING(u_colorspace, "colorspace", 8710743381164964946ull)
|
||||
OSL_DEVICE_STRING(u_exists, "exists", 11446133498368803600ull)
|
||||
OSL_DEVICE_STRING(u_averagecolor, "averagecolor", 3004396188475227877ull)
|
||||
|
||||
OSL_DEVICE_STRING(u_distance, "distance", 5661183123366514158ull)
|
||||
OSL_DEVICE_STRING(u_index, "index", 15907549540151602841ull)
|
||||
OSL_DEVICE_STRING(u_trace, "trace", 13264932728578201327ull)
|
||||
|
|
|
|||
|
|
@ -145,13 +145,12 @@ struct OSLNoiseOptions {};
|
|||
|
||||
struct OSLTextureOptions {};
|
||||
|
||||
#define OSL_TEXTURE_HANDLE_TYPE_IES ((uintptr_t)0x2 << 30)
|
||||
#define OSL_TEXTURE_HANDLE_TYPE_SVM ((uintptr_t)0x1 << 30)
|
||||
#define OSL_TEXTURE_HANDLE_TYPE_AO_OR_BEVEL ((uintptr_t)0x3 << 30)
|
||||
/* Note: starting from 1 instead of 0 so that the encoded handle is never a null pointer
|
||||
* the OSL will interpret as an invalid handle. */
|
||||
enum class OSLTextureHandleType : unsigned int { IMAGE = 1, IES = 2, BEVEL = 3, AO = 4 };
|
||||
|
||||
#define OSL_TEXTURE_HANDLE_TYPE(handle) \
|
||||
((unsigned int)((uintptr_t)(handle) & ((uintptr_t)0x3 << 30)))
|
||||
#define OSL_TEXTURE_HANDLE_ID(handle) \
|
||||
((unsigned int)((uintptr_t)(handle) & ((uintptr_t)0x3FFFFFFF)))
|
||||
#define OSL_TEXTURE_HANDLE_ENCODE(type, id) ((uintptr_t(type) << 32) | uintptr_t(uint(id)))
|
||||
#define OSL_TEXTURE_HANDLE_TYPE(handle) OSLTextureHandleType(uintptr_t(handle) >> 32)
|
||||
#define OSL_TEXTURE_HANDLE_ID(handle) int(uint(uintptr_t(handle) & uintptr_t(0xFFFFFFFF)))
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
|
|
|||
|
|
@ -11,14 +11,13 @@
|
|||
#include "scene/stats.h"
|
||||
|
||||
#include "util/colorspace.h"
|
||||
#include "util/image.h"
|
||||
#include "util/image_impl.h"
|
||||
#include "util/log.h"
|
||||
#include "util/progress.h"
|
||||
#include "util/task.h"
|
||||
#include "util/types_image.h"
|
||||
|
||||
#ifdef WITH_OSL
|
||||
# include <OSL/oslexec.h>
|
||||
#endif
|
||||
|
||||
CCL_NAMESPACE_BEGIN
|
||||
|
||||
/* Image Handle */
|
||||
|
|
@ -202,7 +201,6 @@ ImageSingle::~ImageSingle() = default;
|
|||
ImageManager::ImageManager(const DeviceInfo & /*info*/)
|
||||
{
|
||||
need_update_ = true;
|
||||
osl_texture_system = nullptr;
|
||||
animation_frame = 0;
|
||||
}
|
||||
|
||||
|
|
@ -214,11 +212,6 @@ ImageManager::~ImageManager()
|
|||
}
|
||||
}
|
||||
|
||||
void ImageManager::set_osl_texture_system(void *texture_system)
|
||||
{
|
||||
osl_texture_system = texture_system;
|
||||
}
|
||||
|
||||
bool ImageManager::set_animation_frame_update(const int frame)
|
||||
{
|
||||
if (frame != animation_frame) {
|
||||
|
|
@ -355,10 +348,9 @@ ImageSingle *ImageManager::add_image_texture(unique_ptr<ImageLoader> &&loader,
|
|||
/* Add new image. */
|
||||
unique_ptr<ImageSingle> img = make_unique<ImageSingle>();
|
||||
img->type = ImageTexture::SINGLE;
|
||||
img->image_texture_id = image_texture_id;
|
||||
img->params = params;
|
||||
img->loader = std::move(loader);
|
||||
img->need_load = !(osl_texture_system && !img->loader->osl_filepath().empty());
|
||||
img->image_texture_id = (img->need_load) ? image_texture_id : KERNEL_IMAGE_NONE;
|
||||
img->builtin = builtin;
|
||||
|
||||
images.replace(image_texture_id, std::move(img));
|
||||
|
|
@ -470,15 +462,6 @@ void ImageManager::device_free_image(Scene *scene, size_t image_texture_id)
|
|||
return;
|
||||
}
|
||||
|
||||
if (osl_texture_system) {
|
||||
#ifdef WITH_OSL
|
||||
const ustring filepath = img->loader->osl_filepath();
|
||||
if (!filepath.empty()) {
|
||||
((OSL::TextureSystem *)osl_texture_system)->invalidate(filepath);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
const KernelImageTexture &tex = scene->dscene.image_textures[image_texture_id];
|
||||
image_cache.free_image(scene->dscene, tex);
|
||||
img->vdb_memory = nullptr;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class ImageHandle {
|
|||
friend class ImageManager;
|
||||
};
|
||||
|
||||
/* Image Texture
|
||||
/* Image Slot
|
||||
*
|
||||
* Base class for an entry in the image manager, which can either be
|
||||
* a single image or a UDIM. */
|
||||
|
|
@ -167,7 +167,6 @@ class ImageManager {
|
|||
Progress &progress,
|
||||
const set<const ImageSingle *> &images);
|
||||
|
||||
void set_osl_texture_system(void *texture_system);
|
||||
bool set_animation_frame_update(const int frame);
|
||||
|
||||
void collect_statistics(RenderStats *stats, Scene *scene);
|
||||
|
|
@ -191,8 +190,6 @@ class ImageManager {
|
|||
|
||||
ImageCache image_cache;
|
||||
|
||||
void *osl_texture_system;
|
||||
|
||||
ImageSingle *add_image_texture(unique_ptr<ImageLoader> &&loader,
|
||||
const ImageParams ¶ms,
|
||||
const bool builtin);
|
||||
|
|
|
|||
|
|
@ -10,11 +10,6 @@ CCL_NAMESPACE_BEGIN
|
|||
|
||||
ImageLoader::ImageLoader() = default;
|
||||
|
||||
ustring ImageLoader::osl_filepath() const
|
||||
{
|
||||
return ustring();
|
||||
}
|
||||
|
||||
int ImageLoader::get_tile_number() const
|
||||
{
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -57,9 +57,6 @@ class ImageLoader {
|
|||
/* Name for logs and stats. */
|
||||
virtual string name() const = 0;
|
||||
|
||||
/* Optional for OSL texture cache. */
|
||||
virtual ustring osl_filepath() const;
|
||||
|
||||
/* Optional for tiled textures loaded externally. */
|
||||
virtual int get_tile_number() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,11 +35,6 @@ string OIIOImageLoader::name() const
|
|||
return path_filename(filepath.string());
|
||||
}
|
||||
|
||||
ustring OIIOImageLoader::osl_filepath() const
|
||||
{
|
||||
return filepath;
|
||||
}
|
||||
|
||||
bool OIIOImageLoader::equals(const ImageLoader &other) const
|
||||
{
|
||||
const OIIOImageLoader &other_loader = (const OIIOImageLoader &)other;
|
||||
|
|
|
|||
|
|
@ -19,8 +19,6 @@ class OIIOImageLoader : public ImageLoader {
|
|||
|
||||
string name() const override;
|
||||
|
||||
ustring osl_filepath() const override;
|
||||
|
||||
bool equals(const ImageLoader &other) const override;
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ CCL_NAMESPACE_BEGIN
|
|||
|
||||
/* Shared Texture and Shading System */
|
||||
|
||||
std::shared_ptr<OSL::TextureSystem> ts_shared;
|
||||
thread_mutex ts_shared_mutex;
|
||||
|
||||
map<DeviceType, std::shared_ptr<OSL::ShadingSystem>> ss_shared;
|
||||
|
|
@ -51,7 +50,6 @@ OSLManager::OSLManager(Device *device) : device_(device), need_update_(true) {}
|
|||
OSLManager::~OSLManager()
|
||||
{
|
||||
shading_system_free();
|
||||
texture_system_free();
|
||||
}
|
||||
|
||||
void OSLManager::free_memory()
|
||||
|
|
@ -72,14 +70,6 @@ void OSLManager::reset(Scene * /*scene*/)
|
|||
tag_update();
|
||||
}
|
||||
|
||||
OSL::TextureSystem *OSLManager::get_texture_system()
|
||||
{
|
||||
if (!ts) {
|
||||
texture_system_init();
|
||||
}
|
||||
return ts.get();
|
||||
}
|
||||
|
||||
OSL::ShadingSystem *OSLManager::get_shading_system(Device *sub_device)
|
||||
{
|
||||
return ss_map[sub_device->info.type].get();
|
||||
|
|
@ -120,7 +110,7 @@ bool OSLManager::need_update() const
|
|||
return need_update_;
|
||||
}
|
||||
|
||||
void OSLManager::device_update_pre(Device *device, Scene *scene)
|
||||
void OSLManager::device_update_pre(Device * /*device*/, Scene *scene)
|
||||
{
|
||||
if (scene->shader_manager->use_osl() || !scene->camera->script_name.empty()) {
|
||||
shading_system_init(scene->shader_manager->get_scene_linear_interop_id());
|
||||
|
|
@ -134,14 +124,10 @@ void OSLManager::device_update_pre(Device *device, Scene *scene)
|
|||
if (scene->shader_manager->use_osl()) {
|
||||
/* add special builtin texture types */
|
||||
foreach_render_services([](OSLRenderServices *services) {
|
||||
services->textures.insert(OSLUStringHash("@ao"), OSLTextureHandle(OSLTextureHandle::AO));
|
||||
services->textures.insert(OSLUStringHash("@ao"), OSLTextureHandle(OSLTextureHandleType::AO));
|
||||
services->textures.insert(OSLUStringHash("@bevel"),
|
||||
OSLTextureHandle(OSLTextureHandle::BEVEL));
|
||||
OSLTextureHandle(OSLTextureHandleType::BEVEL));
|
||||
});
|
||||
|
||||
if (device->info.type == DEVICE_CPU) {
|
||||
scene->image_manager->set_osl_texture_system((void *)get_texture_system());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -175,7 +161,6 @@ void OSLManager::device_update_post(Device *device,
|
|||
ss->ShaderGroupEnd(*group);
|
||||
|
||||
og->ss = ss;
|
||||
og->ts = get_texture_system();
|
||||
og->services = static_cast<OSLRenderServices *>(ss->renderer());
|
||||
|
||||
og->camera_state = group;
|
||||
|
|
@ -261,7 +246,6 @@ void OSLManager::device_update_post(Device *device,
|
|||
OSL::ShadingSystem *ss = get_shading_system(sub_device);
|
||||
|
||||
og->ss = ss;
|
||||
og->ts = get_texture_system();
|
||||
og->services = static_cast<OSLRenderServices *>(ss->renderer());
|
||||
|
||||
/* load kernels */
|
||||
|
|
@ -282,7 +266,6 @@ void OSLManager::device_free(Device *device, DeviceScene * /*dscene*/, Scene *sc
|
|||
og->use_shading = false;
|
||||
og->use_camera = false;
|
||||
og->ss = nullptr;
|
||||
og->ts = nullptr;
|
||||
og->camera_state.reset();
|
||||
});
|
||||
|
||||
|
|
@ -304,44 +287,6 @@ void OSLManager::device_free(Device *device, DeviceScene * /*dscene*/, Scene *sc
|
|||
});
|
||||
}
|
||||
|
||||
void OSLManager::texture_system_init()
|
||||
{
|
||||
/* create texture system, shared between different renders to reduce memory usage */
|
||||
const thread_scoped_lock lock(ts_shared_mutex);
|
||||
|
||||
if (!ts_shared) {
|
||||
# if OIIO_VERSION_MAJOR >= 3
|
||||
ts_shared = OSL::TextureSystem::create(false);
|
||||
# else
|
||||
ts_shared = std::shared_ptr<OSL::TextureSystem>(
|
||||
OSL::TextureSystem::create(false),
|
||||
[](OSL::TextureSystem *ts) { OSL::TextureSystem::destroy(ts); });
|
||||
# endif
|
||||
|
||||
ts_shared->attribute("automip", 1);
|
||||
ts_shared->attribute("autotile", 64);
|
||||
ts_shared->attribute("gray_to_rgb", 1);
|
||||
|
||||
/* effectively unlimited for now, until we support proper mipmap lookups */
|
||||
ts_shared->attribute("max_memory_MB", 16384);
|
||||
}
|
||||
|
||||
/* make local copy to increase use count */
|
||||
ts = ts_shared;
|
||||
}
|
||||
|
||||
void OSLManager::texture_system_free()
|
||||
{
|
||||
ts.reset();
|
||||
|
||||
/* if ts_shared is the only reference to the underlying texture system,
|
||||
* no users remain, so free it. */
|
||||
const thread_scoped_lock lock(ts_shared_mutex);
|
||||
if (ts_shared.use_count() == 1) {
|
||||
ts_shared.reset();
|
||||
}
|
||||
}
|
||||
|
||||
void OSLManager::shading_system_init(const string &colorspace_interop_id)
|
||||
{
|
||||
/* No need to do anything if we already have shading systems. */
|
||||
|
|
@ -356,8 +301,7 @@ void OSLManager::shading_system_init(const string &colorspace_interop_id)
|
|||
const DeviceType device_type = sub_device->info.type;
|
||||
|
||||
if (!ss_shared[device_type]) {
|
||||
OSLRenderServices *services = util_aligned_new<OSLRenderServices>(get_texture_system(),
|
||||
device_type);
|
||||
OSLRenderServices *services = util_aligned_new<OSLRenderServices>(device_type);
|
||||
# ifdef _WIN32
|
||||
/* Annoying thing, Cycles stores paths in UTF8 code-page, so it can
|
||||
* operate with file paths with any character. This requires to use wide
|
||||
|
|
@ -372,9 +316,13 @@ void OSLManager::shading_system_init(const string &colorspace_interop_id)
|
|||
const string shader_path = path_get("shader");
|
||||
# endif
|
||||
|
||||
/* Dummy texture system pointer so OSL doesn't create its own. Such an opaque texture system
|
||||
* pointer is supported and normally would be done with the OSL_NO_DEFAULT_TEXTURESYSTEM
|
||||
* build option, but we want to work with OSL builds that don't have it. */
|
||||
auto *ts = reinterpret_cast<OSL::TextureSystem *>(1);
|
||||
|
||||
auto ss = std::shared_ptr<OSL::ShadingSystem>(
|
||||
new OSL::ShadingSystem(services, get_texture_system(), &errhandler),
|
||||
[](OSL::ShadingSystem *ss) {
|
||||
new OSL::ShadingSystem(services, ts, &errhandler), [](OSL::ShadingSystem *ss) {
|
||||
util_aligned_delete(static_cast<OSLRenderServices *>(ss->renderer()));
|
||||
delete ss;
|
||||
});
|
||||
|
|
@ -649,7 +597,6 @@ void OSLShaderManager::device_update_specific(Device *device,
|
|||
OSLManager::foreach_osl_device(device, [scene](Device *sub_device, OSLGlobals *og) {
|
||||
OSL::ShadingSystem *ss = scene->osl_manager->get_shading_system(sub_device);
|
||||
og->ss = ss;
|
||||
og->ts = scene->osl_manager->get_texture_system();
|
||||
og->services = static_cast<OSLRenderServices *>(ss->renderer());
|
||||
|
||||
og->use_shading = true;
|
||||
|
|
@ -1547,6 +1494,7 @@ void OSLCompiler::compile(Shader *shader)
|
|||
{
|
||||
if (shader->is_modified()) {
|
||||
ShaderGraph *graph = shader->graph.get();
|
||||
current_graph = graph;
|
||||
|
||||
current_shader = shader;
|
||||
|
||||
|
|
@ -1574,16 +1522,6 @@ void OSLCompiler::compile(Shader *shader)
|
|||
}
|
||||
}
|
||||
|
||||
void OSLCompiler::parameter_texture(const char *name, ustring filename, ustring colorspace)
|
||||
{
|
||||
/* Textured loaded through the OpenImageIO texture cache. For this
|
||||
* case we need to do runtime color space conversion. */
|
||||
OSLTextureHandle handle(OSLTextureHandle::OIIO);
|
||||
handle.processor = ColorSpaceManager::get_processor(colorspace);
|
||||
services->textures.insert(OSLUStringHash(filename), handle);
|
||||
parameter(name, filename);
|
||||
}
|
||||
|
||||
void OSLCompiler::parameter_texture(const char *name, const ImageHandle &handle)
|
||||
{
|
||||
/* Texture loaded through SVM image texture system. We generate a unique
|
||||
|
|
@ -1591,17 +1529,16 @@ void OSLCompiler::parameter_texture(const char *name, const ImageHandle &handle)
|
|||
* to get handle again. Note that this name must be unique between multiple
|
||||
* render sessions as the render services are shared. */
|
||||
const ustring filename(string_printf("@svm%d", texture_shared_unique_id++).c_str());
|
||||
services->textures.insert(OSLUStringHash(filename),
|
||||
OSLTextureHandle(OSLTextureHandle::SVM, handle.kernel_id()));
|
||||
services->textures.insert(OSLUStringHash(filename), OSLTextureHandle(handle));
|
||||
parameter(name, filename);
|
||||
}
|
||||
|
||||
void OSLCompiler::parameter_texture_ies(const char *name, const int svm_image_texture_id)
|
||||
void OSLCompiler::parameter_texture_ies(const char *name, const int svm_slot)
|
||||
{
|
||||
/* IES light textures stored in SVM. */
|
||||
const ustring filename(string_printf("@svm%d", texture_shared_unique_id++).c_str());
|
||||
services->textures.insert(OSLUStringHash(filename),
|
||||
OSLTextureHandle(OSLTextureHandle::IES, svm_image_texture_id));
|
||||
OSLTextureHandle(OSLTextureHandleType::IES, svm_slot));
|
||||
parameter(name, filename);
|
||||
}
|
||||
|
||||
|
|
@ -1654,12 +1591,6 @@ void OSLCompiler::parameter_array(const char * /*name*/, const float /*f*/[], in
|
|||
|
||||
void OSLCompiler::parameter_color_array(const char * /*name*/, const array<float3> & /*f*/) {}
|
||||
|
||||
void OSLCompiler::parameter_texture(const char * /*name*/,
|
||||
ustring /*filename*/,
|
||||
ustring /*colorspace*/)
|
||||
{
|
||||
}
|
||||
|
||||
void OSLCompiler::parameter_texture(const char * /*name*/, const ImageHandle & /*handle*/) {}
|
||||
|
||||
void OSLCompiler::parameter_texture_ies(const char * /*name*/, int /*svm_image_texture_id*/) {}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ CCL_NAMESPACE_BEGIN
|
|||
|
||||
class Device;
|
||||
class DeviceScene;
|
||||
class ImageHandle;
|
||||
class ImageManager;
|
||||
class ImageSingle;
|
||||
class OSLRenderServices;
|
||||
struct OSLGlobals;
|
||||
class Scene;
|
||||
|
|
@ -92,9 +94,6 @@ class OSLManager {
|
|||
|
||||
private:
|
||||
#ifdef WITH_OSL
|
||||
void texture_system_init();
|
||||
void texture_system_free();
|
||||
|
||||
void shading_system_free();
|
||||
|
||||
void foreach_shading_system(const std::function<void(OSL::ShadingSystem *)> &callback);
|
||||
|
|
@ -103,7 +102,6 @@ class OSLManager {
|
|||
Device *device_;
|
||||
map<string, OSLShaderInfo> loaded_shaders;
|
||||
|
||||
std::shared_ptr<OSL::TextureSystem> ts;
|
||||
map<DeviceType, std::shared_ptr<OSL::ShadingSystem>> ss_map;
|
||||
|
||||
bool need_update_;
|
||||
|
|
@ -176,9 +174,8 @@ class OSLCompiler {
|
|||
|
||||
void parameter_attribute(const char *name, ustring s);
|
||||
|
||||
void parameter_texture(const char *name, ustring filename, ustring colorspace);
|
||||
void parameter_texture(const char *name, const ImageHandle &handle);
|
||||
void parameter_texture_ies(const char *name, const int svm_image_texture_id);
|
||||
void parameter_texture_ies(const char *name, const int svm_slot);
|
||||
|
||||
ShaderType output_type()
|
||||
{
|
||||
|
|
@ -188,6 +185,7 @@ class OSLCompiler {
|
|||
bool background;
|
||||
Scene *scene;
|
||||
Progress &progress;
|
||||
ShaderGraph *current_graph = nullptr;
|
||||
|
||||
private:
|
||||
#ifdef WITH_OSL
|
||||
|
|
|
|||
|
|
@ -443,29 +443,20 @@ void ImageTextureNode::compile(OSLCompiler &compiler)
|
|||
tex_mapping.compile(compiler);
|
||||
|
||||
if (handle.empty()) {
|
||||
cull_tiles(compiler.scene, compiler.current_graph);
|
||||
ImageManager *image_manager = compiler.scene->image_manager.get();
|
||||
handle = image_manager->add_image(filename.string(), image_params());
|
||||
handle = image_manager->add_image(filename.string(), image_params(), tiles);
|
||||
}
|
||||
|
||||
const ImageMetaData metadata = handle.metadata(compiler.progress);
|
||||
const bool is_float = metadata.is_float();
|
||||
const bool compress_as_srgb = metadata.is_compressible_as_srgb;
|
||||
const ustring known_colorspace = metadata.colorspace;
|
||||
|
||||
if (handle.kernel_id() == KERNEL_IMAGE_NONE) {
|
||||
compiler.parameter_texture(
|
||||
"filename", filename, compress_as_srgb ? u_colorspace_scene_linear : known_colorspace);
|
||||
}
|
||||
else {
|
||||
compiler.parameter_texture("filename", handle);
|
||||
}
|
||||
compiler.parameter_texture("filename", handle);
|
||||
|
||||
const bool unassociate_alpha = !(ColorSpaceManager::colorspace_is_data(colorspace) ||
|
||||
alpha_type == IMAGE_ALPHA_CHANNEL_PACKED ||
|
||||
alpha_type == IMAGE_ALPHA_IGNORE);
|
||||
const bool is_tiled = (filename.find("<UDIM>") != string::npos ||
|
||||
filename.find("<UVTILE>") != string::npos) ||
|
||||
handle.num_tiles() > 0;
|
||||
|
||||
compiler.parameter(this, "projection");
|
||||
compiler.parameter(this, "projection_blend");
|
||||
|
|
@ -473,7 +464,6 @@ void ImageTextureNode::compile(OSLCompiler &compiler)
|
|||
compiler.parameter("ignore_alpha", alpha_type == IMAGE_ALPHA_IGNORE);
|
||||
compiler.parameter("unassociate_alpha", !alpha_out->links.empty() && unassociate_alpha);
|
||||
compiler.parameter("is_float", is_float);
|
||||
compiler.parameter("is_tiled", is_tiled);
|
||||
compiler.parameter(this, "interpolation");
|
||||
compiler.parameter(this, "extension");
|
||||
|
||||
|
|
@ -607,16 +597,8 @@ void EnvironmentTextureNode::compile(OSLCompiler &compiler)
|
|||
const ImageMetaData metadata = handle.metadata(compiler.progress);
|
||||
const bool is_float = metadata.is_float();
|
||||
const bool compress_as_srgb = metadata.is_compressible_as_srgb;
|
||||
const ustring known_colorspace = metadata.colorspace;
|
||||
|
||||
if (handle.kernel_id() == KERNEL_IMAGE_NONE) {
|
||||
compiler.parameter_texture(
|
||||
"filename", filename, compress_as_srgb ? u_colorspace_scene_linear : known_colorspace);
|
||||
}
|
||||
else {
|
||||
compiler.parameter_texture("filename", handle);
|
||||
}
|
||||
|
||||
compiler.parameter_texture("filename", handle);
|
||||
compiler.parameter(this, "projection");
|
||||
compiler.parameter(this, "interpolation");
|
||||
compiler.parameter("compress_as_srgb", compress_as_srgb);
|
||||
|
|
|
|||
|
|
@ -633,53 +633,6 @@ void ColorSpaceManager::to_scene_linear(ustring colorspace,
|
|||
#endif
|
||||
}
|
||||
|
||||
void ColorSpaceManager::to_scene_linear(ColorSpaceProcessor *processor_,
|
||||
float *pixel,
|
||||
const int channels)
|
||||
{
|
||||
#ifdef WITH_OCIO
|
||||
const OCIO::Processor *processor = (const OCIO::Processor *)processor_;
|
||||
|
||||
if (processor) {
|
||||
const OCIO::ConstCPUProcessorRcPtr device_processor = processor->getDefaultCPUProcessor();
|
||||
if (channels == 1) {
|
||||
float3 rgb = make_float3(pixel[0], pixel[0], pixel[0]);
|
||||
device_processor->applyRGB(&rgb.x);
|
||||
pixel[0] = average(rgb);
|
||||
}
|
||||
if (channels == 3) {
|
||||
device_processor->applyRGB(pixel);
|
||||
}
|
||||
else if (channels == 4) {
|
||||
if (pixel[3] == 1.0f || pixel[3] == 0.0f) {
|
||||
/* Fast path for RGBA. */
|
||||
device_processor->applyRGB(pixel);
|
||||
}
|
||||
else {
|
||||
/* Un-associate and associate alpha since color management should not
|
||||
* be affected by transparency. */
|
||||
const float alpha = pixel[3];
|
||||
const float inv_alpha = 1.0f / alpha;
|
||||
|
||||
pixel[0] *= inv_alpha;
|
||||
pixel[1] *= inv_alpha;
|
||||
pixel[2] *= inv_alpha;
|
||||
|
||||
device_processor->applyRGB(pixel);
|
||||
|
||||
pixel[0] *= alpha;
|
||||
pixel[1] *= alpha;
|
||||
pixel[2] *= alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
(void)processor_;
|
||||
(void)pixel;
|
||||
(void)channels;
|
||||
#endif
|
||||
}
|
||||
|
||||
void ColorSpaceManager::free_memory()
|
||||
{
|
||||
#ifdef WITH_OCIO
|
||||
|
|
|
|||
|
|
@ -50,12 +50,6 @@ class ColorSpaceManager {
|
|||
bool compress_as_srgb,
|
||||
bool ignore_alpha);
|
||||
|
||||
/* Efficiently convert pixels to scene linear colorspace at render time,
|
||||
* for OSL where the image texture cache contains original pixels. The
|
||||
* handle is valid for the lifetime of the application. */
|
||||
static ColorSpaceProcessor *get_processor(ustring colorspace);
|
||||
static void to_scene_linear(ColorSpaceProcessor *processor, float *pixel, const int channels);
|
||||
|
||||
/* Clear memory when the application exits. Invalidates all processors. */
|
||||
static void free_memory();
|
||||
|
||||
|
|
@ -76,6 +70,7 @@ class ColorSpaceManager {
|
|||
static const char *get_scene_linear_interop_id(const bool srgb_encoded = false);
|
||||
|
||||
private:
|
||||
static ColorSpaceProcessor *get_processor(ustring colorspace);
|
||||
static void is_builtin_colorspace(ustring colorspace,
|
||||
bool &is_scene_linear,
|
||||
bool &is_scene_linear_srgb);
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4d4a4905b4b90c204ecc63e2d83df74e459536017bb388644acd3085e867ce7d
|
||||
size 49457
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5a788b072c341b76d6bfbcd3dba3f7a911a4d9c8c1ec6b85b31ed5015171bd2c
|
||||
size 29995
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:63d28429393fdd890bd731f01480068afe2134418f5b311f4e4835720b2805a1
|
||||
size 44935
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b05a87ce0d921659b1435a613e6b332bac0bb4729bf121feb39efe3ba6ca8cdf
|
||||
size 39341
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d3593af3dc702a11008f1b5ae92f088d2a257d4ed8c71254c18bc7e3eaaead6e
|
||||
size 47156
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1f5af5a9c3fad82d7488bf037ad2237885412d9631403bcd4937da03310a0058
|
||||
size 38339
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0970b9436199efccd99072b8e3e949a704bae33329320e015c2b6e7706d285df
|
||||
size 27976
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0bc8b91ca55026ad76ca14c559869664c3ce7378b1e36fecd65f57117b6ee171
|
||||
size 44040
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:014238342d897bce4a965294c5131ec59d8889f87b589d55c247ea5db7e3f439
|
||||
size 25794
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fb9e42aa0ed9a33c09800e9644bdacc17d8756c9dac133d3558c4d58456c95fe
|
||||
size 38434
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5c11068d05a71e12f75a96c8cb103267475a569a25716b491f62e48f022dac1b
|
||||
size 97529
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bb4d704dc26cc0a1a9fb29887f20ac9d6b66af4e3826d427a72fd2ea8bfef970
|
||||
size 96805
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a1bc8aabe5fb9edaca69dcb5053f8a903849c76062580b16db38d7496c0a9478
|
||||
size 97186
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bceb802e28686f89b7c26fce2b804683f011786cbc3888ce5371a6613e0e9f98
|
||||
size 102205
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0f24d35fdea0431946338011d6110045d743ed46881228f53fbf63651a3c04d2
|
||||
size 97408
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7530ca34a52c3d9e5e74758f0a5c1c089def50c3b7374a8e6e0dc69d14f50274
|
||||
size 24298
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:39c029416f17bff82552a6a7691b741680d18ef29f7f95023dda03e2fe35eaba
|
||||
size 28381
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:23eea185fda5a9df17daea50eb54c0941b05f874e08457bfbf8510bdf54477db
|
||||
size 24299
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5dba53f73d96eabd95103d362f22407062847d31dbbb40991c5b0fad3b3c22d1
|
||||
size 24036
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d163ebe011459ce9511d388bdefe62b1aba592ad5f475ecd592a550b9f8c68bb
|
||||
size 24042
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:894e9f647bbdff03e76d0797f14c3d47b5722ace71ee63e4e1adc6fca08b4405
|
||||
size 24298
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e457ffcf4fe054fec83b7e91754ad7b7e5bf6b413fb3071c904c1394e054a359
|
||||
size 28381
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e0d6a120b4cacae0a470b444811e6064847869d8949f559350b3330ccc9346f2
|
||||
size 24299
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d2c2cb117d4e97b13c62e82e3cd2cf5f6587c014c4a9cf130ff4f8d19598a53a
|
||||
size 24036
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d3f20394838a79e845725e28cdbaed21630a8a59c9c124f769c11a955a6bb96f
|
||||
size 24042
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7a7fa9c76594120cee87152d949da69d1b1d67e3c3f78fcdaff3250f00f32374
|
||||
size 24971
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:665765c4220f9f1eecfbd75ffbac6c7aecb373aef478efb7a1ed9446514332ff
|
||||
size 44556
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:19d04a5439785c5b8ec1728462daab7c14c69ab0dd6bcb7c21cf9e2eaa839fc3
|
||||
size 44548
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:86ec05a291a0e75fc553b872714d6bc7682b7b9d8e95642862bd337750d09038
|
||||
size 24013
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:152ecc7e6336bf0bffcc3b428dee8ab9c9fa914aa8639efbb0825aadf7500895
|
||||
size 24508
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a9c97074891896617c480acf328d8db4aa3a103465aa46ff771ed2b69e130f60
|
||||
size 1675
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7464f0010fc6f9733d2f3e62f2b5d3cf17507762b5c376d69a30a67f547b9900
|
||||
size 8590
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7a97ada236825c9fb9e696432c0e8f093698f5316b1c103b23fa1a2c20078875
|
||||
size 10831
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ccc5bac89d99ac4946274a83bb95056bfdfe9bc31b5194ac1d3f7de28029c062
|
||||
size 8475
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:123f200fa366ca409310ac7ae19b2b2ea11fabf85dd9d34fc224f6cdb91d21ba
|
||||
size 10753
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:226127b87e0cbab835e66291c3ab95ec13548405877ee2f9df85d23027f92d8d
|
||||
size 8390
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f3807c57401ad8efe391c71354e2ebc17c06eb1210b91d34e059f3df387e7054
|
||||
size 2363
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2e2c54643a416885c3ffc25c55efcbc37e856e4693f84e75c4a3dc01f48b0f80
|
||||
size 16680
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:84586046587159b7897e251dceec30b642d9a7bc1fc5fe6f57aa2019fc17dd7c
|
||||
size 2361
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:caaf980b88f529a20c363494ae256605ed3efb2fd1a94ebd89946f11748b5d68
|
||||
size 14148
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2d7a79bf29108e22a75ecf86bffa84c3a55d90a727e580cac2d6c31e63af69ac
|
||||
size 2362
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b7144fd93beea6121a247349a48bee0d148f54cca4eadeb318eb195ec949e00a
|
||||
size 14893
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:51b9e1e0812635858d7657f24c470da03b2b906a996e6b1ada4a6a7cdc1ab1ab
|
||||
size 29248
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9e24264f71a54ed96c63761556b74868d9f41b7e32dff793b1e86bf5b8de8daa
|
||||
size 26964
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5ce1c5e74e0fe59a0526df6257e96233429340a1d67141ef8687494711f26c9a
|
||||
size 27969
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:911449dc429f79e4dc62c4790365a9717dd66a4d44f0eeab587308290bbc2cd1
|
||||
size 2363
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0f1bc4c5975f36214a1624b7c825b9c9244a990ddd333d0c8160f1bcfd62720e
|
||||
size 29771
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b05bd80f7dccf34c79225b54f538450026374a0c26aacdb2ed450403ceea1e69
|
||||
size 2361
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2105bf3c396b59c4a1640f0a05f9d8faf5f4e05dab54e1e51648ac5d3c2e01a0
|
||||
size 27530
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:abfb1e16c734d96eb6145946935af55e9a7b05c29a970d68416043e6112c6281
|
||||
size 2362
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c64d1f6ecbcb4fde51944b6184e95ceebe56288206074b30d4f3192917802d01
|
||||
size 28281
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:404ca5e1ce622470b35797f4ed5b3eeb8350e71ba03c1ea31e4afb8254ef7073
|
||||
size 13642
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6b0a34bf9b80924274d24f4268b7085e3846fd02a9ad8165d1483a9c00350a1d
|
||||
size 1037
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ffb71184d58a09f3ebafda8f30e49c1a57806c9fe64a314f3c445e40517dff22
|
||||
size 8186
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3cdf9e3ff45eb5192433c40376f592ff22641b971bba345e5be9661ffe205cae
|
||||
size 10136
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a045a6e12b5e865b74745f6eac32f5bb37883e027613dbd5b35182e5739fdadf
|
||||
size 8008
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:97f6170b9ec7f53c6c2fea4e14187819b29c817df440fd14a9aa24d6bd472060
|
||||
size 9968
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:646975a7dcec6f9854f4b759f7b75c213cc8bdd75957fb33e80f910308b1e519
|
||||
size 8018
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3f0c95f9b9f456112b3f0ea8626292690c646703d4495dac1819dbcbd8c95864
|
||||
size 1203
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5ac992c0dfbecee35707d2ebf6d6734fe7307cd8d239b4ea54b69ec43a2966e7
|
||||
size 9734
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cc391b5c7c2f08d88603042ba44186eeb1464a19f8ec83b373d7002ad66f4118
|
||||
size 1300
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:aaa03ce4b43a821f1b13a0dcecefa953f76f8726be020b1aa7320c20af5cc9e2
|
||||
size 9601
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1010cc3d64d6e1401ff3c6f57d118b4fd3bcb808e6fbfb16e6be62722ed59052
|
||||
size 1202
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:80ffa5036529f2f0064dcc3b167d94dc68f7d44a095913fc5775079c07fc85ad
|
||||
size 9574
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:690e1fe3cbe6495eea62c172195124ea20260adba3cdfefe8b159f5ed11cd53d
|
||||
size 27318
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:69d87434b7e08daf42715a6f1f8f39b6163619d1b90aad993f160a75444596d3
|
||||
size 26965
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:34cdaa87d36d4c4571fb55df8f0484adedae604cd72cf24dd059182e68d8c295
|
||||
size 26912
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6dfe83438009fd437c5726ad484e05be2ee045061726ee55de9792c523991706
|
||||
size 1203
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:267ddb19253a9e7535415cc908f50a1e72e89e765cd45ba145777795594eecd1
|
||||
size 27859
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3ec3974900d86d273d25a2f5c831ed69c863e189cc4d0b36826e6111e6fd5369
|
||||
size 1300
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:96ca688982dcf361d4a11c9115921f0d2547d3f7bb98c6ac47b472937bbe3215
|
||||
size 27467
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3fcc6acf5837901bdff2bd09d03509e8de1ace1a86dcffd5bda9c8a6f5176cd0
|
||||
size 1202
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7d1017b4f6c151815bfa2853e43f2b8eec141a2398b33d234ec9ddbb848b5ef9
|
||||
size 27383
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9b019d1d20dbb2b2c86513419567071cb6eff0ad267c364bf2cfe12be2ad7f1e
|
||||
size 9840
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:37d4808b1e8ae07bd3f2d37096127aad964e2737c3d7d363ff67cb0b34b0cfc1
|
||||
size 77227
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8eb9d868e1e9737c8f153553cebfc65e50c0287eb68b89ff41675ac09721d2a9
|
||||
size 78737
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab1448b9df9eb842afec17bab044bfb28b97dd26b000dd45b0bd205ef61f1f
|
||||
size 77628
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue