diff --git a/source/blender/imbuf/opencolorio/intern/libocio/libocio_gpu_shader_binder.cc b/source/blender/imbuf/opencolorio/intern/libocio/libocio_gpu_shader_binder.cc index 11a584a184b..629d084895e 100644 --- a/source/blender/imbuf/opencolorio/intern/libocio/libocio_gpu_shader_binder.cc +++ b/source/blender/imbuf/opencolorio/intern/libocio/libocio_gpu_shader_binder.cc @@ -83,8 +83,19 @@ static bool add_gpu_lut_1D2D(internal::GPUTextures &textures, GPU_R16F; internal::GPULutTexture lut; - lut.texture = GPU_texture_create_2d( - texture_name, width, height, 1, format, GPU_TEXTURE_USAGE_SHADER_READ, values); + /* 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. + * The Blender default config does not use 1D textures, but for example + * studio-config-v3.0.0_aces-v2.0_ocio-v2.4.ocio needs this code. */ + 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, GPU_TEXTURE_USAGE_SHADER_READ, values); + } + else { + lut.texture = GPU_texture_create_2d( + texture_name, width, height, 1, format, GPU_TEXTURE_USAGE_SHADER_READ, values); + } if (lut.texture == nullptr) { return false; }