Nanfeng

Notes on software development, code, and curious ideas

Fixing “Sampler Binding cc_spriteTexture Is Not Bounded”

  • Cocos Creator: 3.7.2
  • Xcode: 16.2
  • Error: Sampler binding cc_spriteTexture at set 2 binding 11 is not bounded
  • Symptom: corrupted or incorrect shader output

The shader rendered corrupted output or failed to produce the expected effect, while Xcode repeatedly logged:

1
2
3
/Applications/Cocos/Creator/3.7.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm: line 906
10:22:13 [ERROR]: Sampler binding cc_spriteTexture at set 2 binding 11 is not bounded.
10:22:13 [ERROR]: [ERROR] file

Solution

Open the effect file and change the sampler from binding = 11 to binding = 12.

Original binding

Corrected binding

See the related Cocos forum discussion for additional context.

+