Fix #139769: ACES 2.0 configuration fails with shader errors
This code was initially only for OpenColorIO 2.3, and then later removed in the refactor. But it appears to still be needed for 2.4 and configs like this. Pull Request: https://projects.blender.org/blender/blender/pulls/140824
This commit is contained in:
committed by
Sergey Sharybin
parent
c8ba4415c9
commit
a7bcea76d7
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user