Skip to content

shaders: improve GLSL diagnostics and source attribution - #22

Open
tritao wants to merge 2 commits into
stack/profile-neutral-shadersfrom
stack/shader-diagnostics
Open

shaders: improve GLSL diagnostics and source attribution#22
tritao wants to merge 2 commits into
stack/profile-neutral-shadersfrom
stack/shader-diagnostics

Conversation

@tritao

@tritao tritao commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Improve GLSL failure reporting without changing shader execution semantics.

  • Associate shader compiler diagnostics with source names.
  • Add concise source attribution to compilation and linking failures.
  • Report compilation and linking failures even when the driver returns no useful log.
  • Add focused coverage for diagnostic behavior.
  • Deliberately avoid shader-source rewriting or line-directive injection.

This layer is diagnostic only; profile-neutral GLSL dispatch and shared core GL test support remain owned by PR #65.

Stack

Layer 4/18, based on PR #65.

@tritao tritao changed the title stack/shader diagnostics shaders: improve GLSL diagnostics and source attribution Aug 8, 2026
@tritao
tritao marked this pull request as ready for review August 8, 2026 02:36
@tritao
tritao force-pushed the stack/shader-diagnostics branch from 2de6681 to 1f27e2c Compare August 8, 2026 10:27
@tritao
tritao force-pushed the stack/shader-diagnostics branch from 1f27e2c to 130303e Compare August 8, 2026 11:06
@tritao
tritao force-pushed the stack/shader-diagnostics branch from 130303e to b5eebe2 Compare August 8, 2026 11:41
@tritao
tritao force-pushed the stack/shader-diagnostics branch from b5eebe2 to bd689d5 Compare August 8, 2026 12:06
@tritao
tritao force-pushed the stack/shader-diagnostics branch 2 times, most recently from d4d9d02 to 0523569 Compare August 8, 2026 20:31
@tritao
tritao force-pushed the stack/shader-diagnostics branch from 0523569 to e1be85f Compare August 8, 2026 20:44
@tritao
tritao force-pushed the stack/shader-diagnostics branch from e1be85f to 2a7c09c Compare August 9, 2026 02:02
@tritao
tritao force-pushed the stack/shader-diagnostics branch from 2a7c09c to 05e987e Compare August 9, 2026 02:34
@tritao
tritao force-pushed the stack/shader-diagnostics branch 2 times, most recently from ede4b7a to 28d71e6 Compare August 9, 2026 11:37
@tritao
tritao force-pushed the stack/shader-diagnostics branch from 28d71e6 to 18c0808 Compare August 9, 2026 11:44
@tritao
tritao force-pushed the stack/shader-diagnostics branch from 18c0808 to 302cf92 Compare August 9, 2026 14:55
@tritao
tritao force-pushed the stack/shader-diagnostics branch from cfc1617 to 2a5bdd9 Compare August 17, 2026 15:52
@tritao
tritao force-pushed the stack/shader-diagnostics branch 2 times, most recently from da547f1 to 9242f9e Compare August 18, 2026 09:24
@tritao
tritao force-pushed the stack/shader-diagnostics branch 2 times, most recently from 603f57c to f83d763 Compare August 18, 2026 18:12
@tritao
tritao force-pushed the stack/shader-diagnostics branch from f83d763 to 27c6ee0 Compare August 18, 2026 19:52
@tritao
tritao force-pushed the stack/shader-diagnostics branch from 27c6ee0 to 5fd4a80 Compare August 18, 2026 23:20
@tritao
tritao force-pushed the stack/shader-diagnostics branch from 5fd4a80 to 8441be3 Compare August 19, 2026 01:16
@tritao
tritao force-pushed the stack/shader-diagnostics branch from 8441be3 to ea463d7 Compare August 19, 2026 01:34
@tritao
tritao force-pushed the stack/shader-diagnostics branch from ea463d7 to 0971d10 Compare August 19, 2026 02:14
Comment thread testsuite/CMakeLists.txt Outdated
Comment on lines +152 to +155
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/include
${PROJECT_BINARY_DIR}/include
${COIN_TARGET_INCLUDE_DIRECTORIES})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same here, probably redundant

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed by using the shared coin_add_gl_test() helper.

static SbString
soshaderobject_inline_source_preview(const SbString & source)
{
const char * cursor = source.getString();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

working with std::string/std::string_view could be cleaner

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Coin is limited just to C++11 for now, I'd rather not bump it for now just for std::string_view here.

Comment thread src/shaders/SoGLSLShaderProgram.cpp Outdated
result += sourceDescription;
if (result.getLength() > 256) {
result = result.getSubString(0, 252);
result += "...";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

will result be null-terminated here? 252+3=255 so \0 will be on position 256?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

SbString::getSubString() creates an owned, null-terminated string, and appending "..." preserves that termination. I replaced the unexplained indices with named length calculations so it is clear the final description is exactly capped at 256 characters, excluding the terminator.

@tritao
tritao force-pushed the stack/shader-diagnostics branch 2 times, most recently from eec0967 to 5a82619 Compare August 19, 2026 10:28
@tritao

tritao commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

All should be addressed now.

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