From c1d8ddacaf14c7cd3d287b3e85c8914ddf75780d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 7 Apr 2015 00:11:47 +0500 Subject: [PATCH] Cycles: Avoid doing paranoid checks in filepath of builtin images Originally we thought it's needed in order to distinguish builtin file from filename which starts with '@', but the filepath is actually full path there and it's unlikely to have file system where '@' is a proper root character. Surprisingly this does not give visible speed differences, but it's still nice to get rid of redundant check. --- intern/cycles/kernel/osl/osl_services.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp index 064edb6ead3..f865cfb326e 100644 --- a/intern/cycles/kernel/osl/osl_services.cpp +++ b/intern/cycles/kernel/osl/osl_services.cpp @@ -887,7 +887,7 @@ bool OSLRenderServices::texture(ustring filename, TextureOpt &options, #endif bool status; - if(filename[0] == '@' && filename.find('.') == -1) { + if(filename[0] == '@') { int slot = atoi(filename.c_str() + 1); float4 rgba = kernel_tex_image_interp(slot, s, 1.0f - t); @@ -940,7 +940,7 @@ bool OSLRenderServices::texture3d(ustring filename, TextureOpt &options, ShaderData *sd = (ShaderData *)(sg->renderstate); KernelGlobals *kg = sd->osl_globals; bool status; - if(filename[0] == '@' && filename.find('.') == -1) { + if(filename[0] == '@') { int slot = atoi(filename.c_str() + 1); float4 rgba = kernel_tex_image_interp_3d(slot, P.x, P.y, P.z);