ping.

On 2024-03-24 12:31 a.m., Brad Smith wrote:
Backport a patch to allow Blender 3.3 to build with OpenColorIO 2.3.


Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/blender/Makefile,v
retrieving revision 1.121
diff -u -p -u -p -r1.121 Makefile
--- Makefile    23 Mar 2024 13:34:46 -0000      1.121
+++ Makefile    24 Mar 2024 04:23:31 -0000
@@ -8,7 +8,7 @@ DPB_PROPERTIES = parallel
  COMMENT =     3D creation software
DISTNAME = blender-3.3.16
-
+REVISION =     0
  CATEGORIES =  graphics
HOMEPAGE = https://www.blender.org/
Index: patches/patch-intern_opencolorio_ocio_impl_glsl_cc
===================================================================
RCS file: patches/patch-intern_opencolorio_ocio_impl_glsl_cc
diff -N patches/patch-intern_opencolorio_ocio_impl_glsl_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-intern_opencolorio_ocio_impl_glsl_cc  24 Mar 2024 04:23:31 
-0000
@@ -0,0 +1,41 @@
+Build: support OpenColorIO 2.3
+Ref #113157
+https://projects.blender.org/blender/blender/pulls/113163
+
+Index: intern/opencolorio/ocio_impl_glsl.cc
+--- intern/opencolorio/ocio_impl_glsl.cc.orig
++++ intern/opencolorio/ocio_impl_glsl.cc
+@@ -319,8 +319,15 @@ static bool addGPULut1D2D(OCIO_GPUTextures &textures,
+   unsigned int height = 0;
+   GpuShaderCreator::TextureType channel = 
GpuShaderCreator::TEXTURE_RGB_CHANNEL;
+   Interpolation interpolation = INTERP_LINEAR;
++#if OCIO_VERSION_HEX >= 0x02030000
++  /* Always use 2D textures in OpenColorIO 2.3, simpler and same performance. 
*/
++  GpuShaderDesc::TextureDimensions dimensions = GpuShaderDesc::TEXTURE_2D;
+   shader_desc->getTexture(
++      index, texture_name, sampler_name, width, height, channel, dimensions, 
interpolation);
++#else
++  shader_desc->getTexture(
+       index, texture_name, sampler_name, width, height, channel, 
interpolation);
++#endif
+
+   const float *values;
+   shader_desc->getTextureValues(index, values);
+@@ -333,13 +340,16 @@ static bool addGPULut1D2D(OCIO_GPUTextures &textures,
+                                                                               
    GPU_R16F;
+
+   OCIO_GPULutTexture lut;
++#if OCIO_VERSION_HEX < 0x02030000
+   /* There does not appear to be an explicit way to check if a texture is 1D 
or 2D.
+    * It depends on more than height. So check instead by looking at the 
source. */
+   std::string sampler1D_name = std::string("sampler1D ") + sampler_name;
+   if (strstr(shader_desc->getShaderText(), sampler1D_name.c_str()) != 
nullptr) {
+     lut.texture = GPU_texture_create_1d(texture_name, width, 1, format, 
values);
+   }
+-  else {
++  else
++#endif
++  {
+     lut.texture = GPU_texture_create_2d(texture_name, width, height, 1, 
format, values);
+   }
+   if (lut.texture == nullptr) {

Reply via email to