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.
This commit is contained in:
Sergey Sharybin 2015-04-07 00:11:47 +05:00
parent 7c19239bf9
commit c1d8ddacaf

@ -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);