kernel_cpu.h 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Copyright 2011-2013 Blender Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* Templated common declaration part of all CPU kernels. */
  17. void KERNEL_FUNCTION_FULL_NAME(path_trace)(
  18. KernelGlobals *kg, float *buffer, int sample, int x, int y, int offset, int stride);
  19. void KERNEL_FUNCTION_FULL_NAME(convert_to_byte)(KernelGlobals *kg,
  20. uchar4 *rgba,
  21. float *buffer,
  22. float sample_scale,
  23. int x,
  24. int y,
  25. int offset,
  26. int stride);
  27. void KERNEL_FUNCTION_FULL_NAME(convert_to_half_float)(KernelGlobals *kg,
  28. uchar4 *rgba,
  29. float *buffer,
  30. float sample_scale,
  31. int x,
  32. int y,
  33. int offset,
  34. int stride);
  35. void KERNEL_FUNCTION_FULL_NAME(shader)(KernelGlobals *kg,
  36. uint4 *input,
  37. float4 *output,
  38. int type,
  39. int filter,
  40. int i,
  41. int offset,
  42. int sample);
  43. /* Split kernels */
  44. void KERNEL_FUNCTION_FULL_NAME(data_init)(KernelGlobals *kg,
  45. ccl_constant KernelData *data,
  46. ccl_global void *split_data_buffer,
  47. int num_elements,
  48. ccl_global char *ray_state,
  49. int start_sample,
  50. int end_sample,
  51. int sx,
  52. int sy,
  53. int sw,
  54. int sh,
  55. int offset,
  56. int stride,
  57. ccl_global int *Queue_index,
  58. int queuesize,
  59. ccl_global char *use_queues_flag,
  60. ccl_global unsigned int *work_pool_wgs,
  61. unsigned int num_samples,
  62. ccl_global float *buffer);
  63. #define DECLARE_SPLIT_KERNEL_FUNCTION(name) \
  64. void KERNEL_FUNCTION_FULL_NAME(name)(KernelGlobals * kg, KernelData * data);
  65. DECLARE_SPLIT_KERNEL_FUNCTION(path_init)
  66. DECLARE_SPLIT_KERNEL_FUNCTION(scene_intersect)
  67. DECLARE_SPLIT_KERNEL_FUNCTION(lamp_emission)
  68. DECLARE_SPLIT_KERNEL_FUNCTION(do_volume)
  69. DECLARE_SPLIT_KERNEL_FUNCTION(queue_enqueue)
  70. DECLARE_SPLIT_KERNEL_FUNCTION(indirect_background)
  71. DECLARE_SPLIT_KERNEL_FUNCTION(shader_setup)
  72. DECLARE_SPLIT_KERNEL_FUNCTION(shader_sort)
  73. DECLARE_SPLIT_KERNEL_FUNCTION(shader_eval)
  74. DECLARE_SPLIT_KERNEL_FUNCTION(holdout_emission_blurring_pathtermination_ao)
  75. DECLARE_SPLIT_KERNEL_FUNCTION(subsurface_scatter)
  76. DECLARE_SPLIT_KERNEL_FUNCTION(direct_lighting)
  77. DECLARE_SPLIT_KERNEL_FUNCTION(shadow_blocked_ao)
  78. DECLARE_SPLIT_KERNEL_FUNCTION(shadow_blocked_dl)
  79. DECLARE_SPLIT_KERNEL_FUNCTION(enqueue_inactive)
  80. DECLARE_SPLIT_KERNEL_FUNCTION(next_iteration_setup)
  81. DECLARE_SPLIT_KERNEL_FUNCTION(indirect_subsurface)
  82. DECLARE_SPLIT_KERNEL_FUNCTION(buffer_update)
  83. #undef KERNEL_ARCH