[Bf-blender-cvs] [c1d8dda] master: Cycles: Avoid doing paranoid checks in filepath of builtin images
Sergey Sharybin
noreply at git.blender.org
Mon Apr 6 21:15:02 CEST 2015
Commit: c1d8ddacaf14c7cd3d287b3e85c8914ddf75780d
Author: Sergey Sharybin
Date: Tue Apr 7 00:11:47 2015 +0500
Branches: master
https://developer.blender.org/rBc1d8ddacaf14c7cd3d287b3e85c8914ddf75780d
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.
===================================================================
M intern/cycles/kernel/osl/osl_services.cpp
===================================================================
diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp
index 064edb6..f865cfb 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);
More information about the Bf-blender-cvs
mailing list