Skip to content

Guard volume mapper when shader program is unavailable#3490

Open
nutzlastfan wants to merge 1 commit intoKitware:masterfrom
nutzlastfan:codex/guard-volume-mapper-null-shader
Open

Guard volume mapper when shader program is unavailable#3490
nutzlastfan wants to merge 1 commit intoKitware:masterfrom
nutzlastfan:codex/guard-volume-mapper-null-shader

Conversation

@nutzlastfan
Copy link
Copy Markdown

Summary

  • make OpenGL/VolumeMapper.updateShaders return false when shader program creation or binding returns no program
  • skip mapper shader parameter binding when no program is available
  • stop renderPieceDraw before drawing and deactivate textures when shader setup fails

Context

ShaderCache.readyShaderProgramArray(...) and readyShaderProgram(...) can return null when shader compilation or binding fails.

VolumeMapper currently continues into setMapperShaderParameters, where program.isAttributeUsed(...) can throw because cellBO.getProgram() is null.

This keeps the original shader compile failure as the root error while preventing the follow-up null dereference and avoiding a draw with an invalid shader program.

Test

  • Syntax checked Sources/Rendering/OpenGL/VolumeMapper/index.js as an ES module with Node 18:
    node --input-type=module --check

I did not run the full vtk-js test suite locally.

Copy link
Copy Markdown
Member

@finetjul finetjul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but please reword your commit title to follow semantic-release pattern. you can use Commitizen to create your commit. See CONTRIBUTING.md

@nutzlastfan nutzlastfan force-pushed the codex/guard-volume-mapper-null-shader branch from 3e23100 to f598d30 Compare April 30, 2026 14:17
@nutzlastfan
Copy link
Copy Markdown
Author

Thanks, updated the commit title to follow the semantic-release pattern:

fix(VolumeMapper): guard unavailable shader program

Force-pushed the amended single commit branch at f598d30.

Copy link
Copy Markdown
Member

@finetjul finetjul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants