// ======================================================================== // // Copyright 2009-2017 Intel Corporation // // // // Licensed under the Apache License, Version 2.0 (the "License"); // // you may not use this file except in compliance with the License. // // You may obtain a copy of the License at // // // // http://www.apache.org/licenses/LICENSE-2.0 // // // // Unless required by applicable law or agreed to in writing, software // // distributed under the License is distributed on an "AS IS" BASIS, // // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // // limitations under the License. // // ======================================================================== // #pragma once namespace embree { /* adjust discret tessellation level for feature-adaptive pre-subdivision */ __forceinline float adjustTessellationLevel(float l, const size_t sublevel) { for (size_t i=0; i= 2); const float inv_low_rate = rcp((float)(low_rate-1)); const unsigned int dy = low_rate - 1; const unsigned int dx = high_rate - 1; int p = 2*dy-dx; unsigned int offset = 0; unsigned int y = 0; float value = 0.0f; for(unsigned int x=0;x