src/slg/engines/pathoclbase/compiletextures.cpp
//------------------------------------------------------------------------------
// Dynamic OpenCL code generation for texture evaluation
//------------------------------------------------------------------------------
Dynamic OpenCL code generation for texture evaluation
Dynamic OpenCL code generation for texture evaluation
static string AddTextureSourceCall(const vector<slg::ocl::Texture> &texs,
		const string &type, const u_int i) {
	stringstream ss;
	const slg::ocl::Texture *tex = &texs[i];
	switch (tex->type) {
		case slg::ocl::CONST_FLOAT:
			ss << "ConstFloatTexture_ConstEvaluate" << type << "(&texs[" << i << "])";
			break;
		case slg::ocl::CONST_FLOAT3:
			ss << "ConstFloat3Texture_ConstEvaluate" << type << "(&texs[" << i << "])";
			break;
		case slg::ocl::IMAGEMAP:
			ss << "ImageMapTexture_ConstEvaluate" << type << "(&texs[" << i << "], hitPoint IMAGEMAPS_PARAM)";
			break;
		case slg::ocl::FRESNELCONST_TEX:
			ss << "FresnelConstTexture_ConstEvaluate" << type << "(&texs[" << i << "])";
			break;
		case slg::ocl::FRESNELCOLOR_TEX:
			ss << "FresnelColorTexture_ConstEvaluate" << type << "(&texs[" << i << "])";
			break;
		case slg::ocl::NORMALMAP_TEX:
			ss << "NormalMapTexture_ConstEvaluate" << type << "(&texs[" << i << "])";
			break;
		default:
			ss << "Texture_Index" << i << "_Evaluate" << type << "(&texs[" << i << "], hitPoint TEXTURES_PARAM)";
			break;
	}
	return ss.str();
}
static string AddTextureSourceCall ( const vector < slg :: ocl :: Texture > & texs , const string & type , const u_int i ) { stringstream ss ; const slg :: ocl :: Texture * tex = & texs [ i ] ; switch ( tex -> type ) { case slg :: ocl :: CONST_FLOAT : ss << " " << type << " " << i << " " ; break ; case slg :: ocl :: CONST_FLOAT3 : ss << " " << type << " " << i << " " ; break ; case slg :: ocl :: IMAGEMAP : ss << " " << type << " " << i << " " ; break ; case slg :: ocl :: FRESNELCONST_TEX : ss << " " << type << " " << i << " " ; break ; case slg :: ocl :: FRESNELCOLOR_TEX : ss << " " << type << " " << i << " " ; break ; case slg :: ocl :: NORMALMAP_TEX : ss << " " << type << " " << i << " " ; break ; default : ss << " " << i << " " << type << " " << i << " " ; break ; } return ss . str ( ) ; }
Dynamic OpenCL code generation for texture evaluation
Dynamic OpenCL code generation for texture evaluation