Skip to content

Vulkan GLSL output can emit duplicate layout(set,binding) for multiple textures (2D/1D + 3D), producing invalid descriptor bindings #2225

@Sedles

Description

@Sedles

When generating GPU shaders using GPU_LANGUAGE_GLSL_VK_4_6, OpenColorIO can emit GLSL where multiple distinct resources share the same layout(set = X, binding = Y) within the same shader stage. This is not a valid Vulkan descriptor binding layout: a (set,binding) pair must uniquely identify a single descriptor binding.

This is observed in pipelines that require both a 3D LUT and 1D/2D LUT(s) (e.g., when a display/view transform chain uses both types of LUT textures).

Affected Versions

OpenColorIO: v2.5.x

Steps to Reproduce

  1. Use an OCIO config + transform chain whose GPU representation requires:

    • at least one 3D LUT texture, and
    • at least one 1D/2D LUT texture (often represented as 2D textures in OCIO GPU output).
  2. Create a shader description for Vulkan GLSL:

auto desc = OCIO::GpuShaderDesc::CreateShaderDesc();
desc->setLanguage(OCIO::GPU_LANGUAGE_GLSL_VK_4_6);
desc->setDescriptorSetIndex(0, 1);
gpuProc->extractGpuShaderInfo(desc);
const char* shaderText = desc->getShaderText();
  1. Inspect shaderText and locate the texture/sampler uniform declarations.

Actual Result

The generated shader may contain duplicate Vulkan binding declarations, e.g.:

layout(set = 0, binding = 1) uniform sampler3D ocio_lut3d_0Sampler;
layout(set = 0, binding = 1) uniform sampler2D ocio_lut1d_1Sampler;

The core issue is multiple uniforms sharing the same (set,binding).

Expected Result

For GPU_LANGUAGE_GLSL_VK_4_6, OCIO should emit Vulkan-valid GLSL where:

  • each (set,binding) pair is unique for a given shader stage
  • 1D/2D and 3D LUT resources do not overlap in binding assignment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions