Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix combined sampler documentation and warning #6207

Merged
merged 5 commits into from
Jan 29, 2025

Conversation

cheneym2
Copy link
Collaborator

This change updates documentation around support for combined texture/samplers
for SPIR-V. The existing text implied that it was correct to use two register assignments
for explicit binding in the SPIR-V docs, but there is actually no way for Slang to derive
one vkbinding from two registers. The warning was misleading.

Related, there is a set of -fvk-xxx-shift options in slangc that do offer a way to specify
mappings from registers to vk bindings, however, they only work for 1:1 situations, not
the 2:1 mapping that comes up with combined texture samplers.

The warning which comes up when a user specifies "register" but not "vkbinding" nor
-vk-xxx-shift, is now updated to add "-vk-xxx-shift" as a suggestion for fixing the problem,
but only for the case of non-combined texture samplers.

Closes Issue #5938

@cheneym2 cheneym2 force-pushed the cheneym2/samplerbindingdoc branch from 91f5b68 to 07279aa Compare January 29, 2025 00:40
@cheneym2 cheneym2 marked this pull request as ready for review January 29, 2025 00:41
@cheneym2 cheneym2 requested review from a team as code owners January 29, 2025 00:41
@cheneym2 cheneym2 added the pr: non-breaking PRs without breaking changes label Jan 29, 2025
@cheneym2 cheneym2 force-pushed the cheneym2/samplerbindingdoc branch from a289315 to 02676d5 Compare January 29, 2025 01:05
source/slang/slang-diagnostic-defs.h Outdated Show resolved Hide resolved
//DIAGNOSTIC_TEST:SIMPLE:-target glsl -profile ps_4_0 -entry main -no-codegen

// This tests that combined texture sampler objects which have D3D style register assignments, but no vk::binding, show an appropriate
// warning, even in the presence of -fvk-xxx-shift options. Warning should not recommend using -fvk-xxx-shift.
Copy link
Collaborator

Choose a reason for hiding this comment

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

the comment here may need to be updated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, though I'm not sure if my update meets your expectations. What I said in this version of the comment is what I believe to be correct. Hoping it's just a matter of unclear wording.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, never mind, the comment is correct. I misunderstood it.

@cheneym2
Copy link
Collaborator Author

/format

@slangbot
Copy link
Contributor

🌈 Formatted, please merge the changes from this PR

@cheneym2 cheneym2 enabled auto-merge (squash) January 29, 2025 19:16
@cheneym2 cheneym2 merged commit 2ba6458 into shader-slang:master Jan 29, 2025
16 checks passed
@cheneym2 cheneym2 deleted the cheneym2/samplerbindingdoc branch January 29, 2025 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants