Skip to content

Conversation

@hzqst hzqst changed the title SetInlineConstantsGL support. SetInlineConstants support for OpenGL Jan 9, 2026
hzqst added a commit to hzqst/DiligentCore that referenced this pull request Jan 9, 2026
…Failed to link program 0 for pipeline state 'Render State Cache Test': error: buffer block with binding `0' has mismatching definitions

See DiligentGraphics#753
@hzqst hzqst marked this pull request as ready for review January 9, 2026 15:05
@hzqst hzqst requested a review from TheMostDiligent as a code owner January 9, 2026 15:05
hzqst added a commit to hzqst/DiligentCore that referenced this pull request Jan 9, 2026
…Failed to link program 0 for pipeline state 'Render State Cache Test': error: buffer block with binding `0' has mismatching definitions

See DiligentGraphics#753
Comment on lines 454 to 459
if (!Options.separate_shader_objects)
{
// We do not emit binding qualifiers when separate_shader_objects disable.
// Let OpenGL driver do the binding qualifiers allocation.
Options.version = 410;
Options.enable_420pack_extension = false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed for inline constants?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

How to reproduce this issue?
I commented this out, but all tests still pass with both separable and non-separable programs.

Copy link
Contributor

Choose a reason for hiding this comment

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

NVM, stale build files. Yes, it reproduces without this fix

Copy link
Contributor

Choose a reason for hiding this comment

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

But why does this only fail with non-separable programs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe it was because there was no kind of VS-PS combination in test shaders that:
VS with references to cbufferA+cbufferB,
PS with references to only cbufferA.
until we introduced InlineConstantsTests.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you create a unit test that reproduces this issue? The fix should be merged to main as it is not related to inline constants - can you submit a PR?

Copy link
Contributor Author

@hzqst hzqst Jan 11, 2026

Choose a reason for hiding this comment

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

The new unittest should be in ArchiveTest or ?

Copy link
Contributor

Choose a reason for hiding this comment

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

ArchiveTest, or RenderStateCacheTest.
Maybe RenderStateCacheTest is better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in #754

@TheMostDiligent
Copy link
Contributor

Funny that it took a month to implement inline constants in Vulkan, and a day to implement them in GL

@hzqst
Copy link
Contributor Author

hzqst commented Jan 10, 2026

@TheMostDiligent We have similar issue with Cross-Signature Commit in vulkan impl too, the GL impl has been fixed in f747b23

All reviews above have been fixed, except for the separate_shader_objects one.

@hzqst hzqst requested a review from TheMostDiligent January 10, 2026 03:49
TheMostDiligent pushed a commit to hzqst/DiligentCore that referenced this pull request Jan 10, 2026
…Failed to link program 0 for pipeline state 'Render State Cache Test': error: buffer block with binding `0' has mismatching definitions

See DiligentGraphics#753
@TheMostDiligent TheMostDiligent force-pushed the inline_constants_gl branch 2 times, most recently from f6d3f6a to 2f82b00 Compare January 10, 2026 23:22
@TheMostDiligent TheMostDiligent merged commit 820adc3 into DiligentGraphics:inline_constants Jan 12, 2026
35 checks passed
@hzqst hzqst deleted the inline_constants_gl branch January 12, 2026 02:07
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