Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/kernels/cpu/kernel_cpu_image.h
| Show All 12 Lines | |||||
| * See the License for the specific language governing permissions and | * See the License for the specific language governing permissions and | ||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| #ifndef __KERNEL_CPU_IMAGE_H__ | #ifndef __KERNEL_CPU_IMAGE_H__ | ||||
| #define __KERNEL_CPU_IMAGE_H__ | #define __KERNEL_CPU_IMAGE_H__ | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| /* Make template functions private so symbols don't conflict between kernels with different | |||||
| * instruction sets. */ | |||||
| namespace { | |||||
brecht: Add a comment like:
```
/* Make template functions private so symbols don't conflict between… | |||||
| template<typename T> struct TextureInterpolator { | template<typename T> struct TextureInterpolator { | ||||
| #define SET_CUBIC_SPLINE_WEIGHTS(u, t) \ | #define SET_CUBIC_SPLINE_WEIGHTS(u, t) \ | ||||
| { \ | { \ | ||||
| u[0] = (((-1.0f / 6.0f) * t + 0.5f) * t - 0.5f) * t + (1.0f / 6.0f); \ | u[0] = (((-1.0f / 6.0f) * t + 0.5f) * t - 0.5f) * t + (1.0f / 6.0f); \ | ||||
| u[1] = ((0.5f * t - 1.0f) * t) * t + (2.0f / 3.0f); \ | u[1] = ((0.5f * t - 1.0f) * t) * t + (2.0f / 3.0f); \ | ||||
| u[2] = ((-0.5f * t + 0.5f) * t + 0.5f) * t + (1.0f / 6.0f); \ | u[2] = ((-0.5f * t + 0.5f) * t + 0.5f) * t + (1.0f / 6.0f); \ | ||||
| u[3] = (1.0f / 6.0f) * t * t * t; \ | u[3] = (1.0f / 6.0f) * t * t * t; \ | ||||
| } \ | } \ | ||||
| ▲ Show 20 Lines • Show All 488 Lines • ▼ Show 20 Lines | case IMAGE_DATA_TYPE_FLOAT4: | ||||
| return TextureInterpolator<float4>::interp_3d(info, x, y, z, interp); | return TextureInterpolator<float4>::interp_3d(info, x, y, z, interp); | ||||
| default: | default: | ||||
| assert(0); | assert(0); | ||||
| return make_float4( | return make_float4( | ||||
| TEX_IMAGE_MISSING_R, TEX_IMAGE_MISSING_G, TEX_IMAGE_MISSING_B, TEX_IMAGE_MISSING_A); | TEX_IMAGE_MISSING_R, TEX_IMAGE_MISSING_G, TEX_IMAGE_MISSING_B, TEX_IMAGE_MISSING_A); | ||||
| } | } | ||||
| } | } | ||||
| } /* Namespace. */ | |||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
| #endif // __KERNEL_CPU_IMAGE_H__ | #endif // __KERNEL_CPU_IMAGE_H__ | ||||
Add a comment like: