0005_cycles.patch 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. commit c4818aa2fc716446ff3a109b18e63ff4ef79ff4c
  2. Author: CYBERDEViL <cyberdevil@notabug.org>
  3. Date: Sat Dec 16 17:21:32 2023 +0100
  4. cycles: "Cycles: Cleanup, silence strict compiler warning"
  5. Partially applied Blender upstream ref: b763c34e80d3b20f9a7f0a592e479e5fa7ab295f
  6. commit c9f8cf23a076854f5dddae5f72a8182be2468118
  7. Author: CYBERDEViL <cyberdevil@notabug.org>
  8. Date: Sat Dec 16 17:07:44 2023 +0100
  9. cycles: "Fix Cycles build error with OSL 1.12"
  10. Fully applied Blender upstream ref: 340529a8453ca9c2715c545245379e442f6006c8
  11. commit e47121b7cbfdbde9c9eb39b5e1bcf1c54a5e3a29
  12. Author: CYBERDEViL <cyberdevil@notabug.org>
  13. Date: Sat Dec 16 17:05:53 2023 +0100
  14. cycles: "Cycles: Fix bad register cast in sseb"
  15. Fully applied Blender upstream ref: be587d76efff6610f3b6d65cf42f1ee31ec3bdee
  16. diff --git a/blender-2.79b/intern/cycles/blender/blender_camera.cpp b/blender-2.79b/intern/cycles/blender/blender_camera.cpp
  17. index b29711d..0c4a48f 100644
  18. --- a/blender-2.79b/intern/cycles/blender/blender_camera.cpp
  19. +++ b/blender-2.79b/intern/cycles/blender/blender_camera.cpp
  20. @@ -86,7 +86,7 @@ struct BlenderCamera {
  21. static void blender_camera_init(BlenderCamera *bcam,
  22. BL::RenderSettings& b_render)
  23. {
  24. - memset(bcam, 0, sizeof(BlenderCamera));
  25. + memset((void *)bcam, 0, sizeof(BlenderCamera));
  26. bcam->type = CAMERA_PERSPECTIVE;
  27. bcam->zoom = 1.0f;
  28. diff --git a/blender-2.79b/intern/cycles/blender/blender_util.h b/blender-2.79b/intern/cycles/blender/blender_util.h
  29. index 363e19f..f697156 100644
  30. --- a/blender-2.79b/intern/cycles/blender/blender_util.h
  31. +++ b/blender-2.79b/intern/cycles/blender/blender_util.h
  32. @@ -251,7 +251,7 @@ static inline Transform get_transform(const BL::Array<float, 16>& array)
  33. /* we assume both types to be just 16 floats, and transpose because blender
  34. * use column major matrix order while we use row major */
  35. - memcpy(&tfm, &array, sizeof(float)*16);
  36. + memcpy((void *)&tfm, &array, sizeof(float)*16);
  37. tfm = transform_transpose(tfm);
  38. return tfm;
  39. diff --git a/blender-2.79b/intern/cycles/bvh/bvh_params.h b/blender-2.79b/intern/cycles/bvh/bvh_params.h
  40. index 7dd699b..75bf5ab 100644
  41. --- a/blender-2.79b/intern/cycles/bvh/bvh_params.h
  42. +++ b/blender-2.79b/intern/cycles/bvh/bvh_params.h
  43. @@ -156,7 +156,10 @@ public:
  44. BVHReference& operator=(const BVHReference &arg) {
  45. if(&arg != this) {
  46. - memcpy(this, &arg, sizeof(BVHReference));
  47. + /* TODO(sergey): Check if it is still faster to memcpy() with
  48. + * modern compilers.
  49. + */
  50. + memcpy((void *)this, &arg, sizeof(BVHReference));
  51. }
  52. return *this;
  53. }
  54. diff --git a/blender-2.79b/intern/cycles/kernel/closure/alloc.h b/blender-2.79b/intern/cycles/kernel/closure/alloc.h
  55. index e799855..ff1de14 100644
  56. --- a/blender-2.79b/intern/cycles/kernel/closure/alloc.h
  57. +++ b/blender-2.79b/intern/cycles/kernel/closure/alloc.h
  58. @@ -78,7 +78,7 @@ ccl_device_inline ShaderClosure *bsdf_alloc_osl(ShaderData *sd, int size, float3
  59. if(!sc)
  60. return NULL;
  61. - memcpy(sc, data, size);
  62. + memcpy((void *)sc, data, size);
  63. float sample_weight = fabsf(average(weight));
  64. sc->weight = weight;
  65. diff --git a/blender-2.79b/intern/cycles/kernel/osl/osl_services.h b/blender-2.79b/intern/cycles/kernel/osl/osl_services.h
  66. index ec34ca7..29055ea 100644
  67. --- a/blender-2.79b/intern/cycles/kernel/osl/osl_services.h
  68. +++ b/blender-2.79b/intern/cycles/kernel/osl/osl_services.h
  69. @@ -25,8 +25,9 @@
  70. * attributes.
  71. */
  72. -#include <OSL/oslexec.h>
  73. #include <OSL/oslclosure.h>
  74. +#include <OSL/oslexec.h>
  75. +#include <OSL/rendererservices.h>
  76. #ifdef WITH_PTEX
  77. class PtexCache;
  78. diff --git a/blender-2.79b/intern/cycles/kernel/osl/osl_shader.cpp b/blender-2.79b/intern/cycles/kernel/osl/osl_shader.cpp
  79. index 13b19d8..4ad6b74 100644
  80. --- a/blender-2.79b/intern/cycles/kernel/osl/osl_shader.cpp
  81. +++ b/blender-2.79b/intern/cycles/kernel/osl/osl_shader.cpp
  82. @@ -53,7 +53,7 @@ void OSLShader::thread_init(KernelGlobals *kg, KernelGlobals *kernel_globals, OS
  83. OSL::ShadingSystem *ss = kg->osl->ss;
  84. OSLThreadData *tdata = new OSLThreadData();
  85. - memset(&tdata->globals, 0, sizeof(OSL::ShaderGlobals));
  86. + memset((void *)&tdata->globals, 0, sizeof(OSL::ShaderGlobals));
  87. tdata->globals.tracedata = &tdata->tracedata;
  88. tdata->globals.flipHandedness = false;
  89. tdata->osl_thread_info = ss->create_thread_info();
  90. diff --git a/blender-2.79b/intern/cycles/render/svm.cpp b/blender-2.79b/intern/cycles/render/svm.cpp
  91. index 48287d8..0111d75 100644
  92. --- a/blender-2.79b/intern/cycles/render/svm.cpp
  93. +++ b/blender-2.79b/intern/cycles/render/svm.cpp
  94. @@ -721,7 +721,7 @@ void SVMCompiler::compile_type(Shader *shader, ShaderGraph *graph, ShaderType ty
  95. }
  96. /* clear all compiler state */
  97. - memset(&active_stack, 0, sizeof(active_stack));
  98. + memset((void *)&active_stack, 0, sizeof(active_stack));
  99. current_svm_nodes.clear();
  100. foreach(ShaderNode *node_iter, graph->nodes) {
  101. diff --git a/blender-2.79b/intern/cycles/util/util_sseb.h b/blender-2.79b/intern/cycles/util/util_sseb.h
  102. index 6e66970..9ffe391 100644
  103. --- a/blender-2.79b/intern/cycles/util/util_sseb.h
  104. +++ b/blender-2.79b/intern/cycles/util/util_sseb.h
  105. @@ -116,7 +116,7 @@ __forceinline const sseb unpacklo( const sseb& a, const sseb& b ) { return _mm_u
  106. __forceinline const sseb unpackhi( const sseb& a, const sseb& b ) { return _mm_unpackhi_ps(a, b); }
  107. template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const sseb shuffle( const sseb& a ) {
  108. - return _mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0));
  109. + return _mm_castsi128_ps(_mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0)));
  110. }
  111. template<> __forceinline const sseb shuffle<0, 1, 0, 1>( const sseb& a ) {
  112. diff --git a/blender-2.79b/intern/cycles/util/util_vector.h b/blender-2.79b/intern/cycles/util/util_vector.h
  113. index 4add91a..caa6490 100644
  114. --- a/blender-2.79b/intern/cycles/util/util_vector.h
  115. +++ b/blender-2.79b/intern/cycles/util/util_vector.h
  116. @@ -131,7 +131,7 @@ public:
  117. {
  118. if(this != &from) {
  119. resize(from.size());
  120. - memcpy(data_, from.data_, datasize_*sizeof(T));
  121. + memcpy((void*)data_, from.data_, datasize_*sizeof(T));
  122. }
  123. return *this;
  124. @@ -191,7 +191,7 @@ public:
  125. return NULL;
  126. }
  127. else if(data_ != NULL) {
  128. - memcpy(newdata, data_, ((datasize_ < newsize)? datasize_: newsize)*sizeof(T));
  129. + memcpy((void *)newdata, data_, ((datasize_ < newsize)? datasize_: newsize)*sizeof(T));
  130. mem_free(data_, capacity_);
  131. }
  132. data_ = newdata;