Repository navigation
feat(descriptors): resolve bindless array index to texture from the CLI #264
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
Merged
BANANASJIM
merged 9 commits into
BANANASJIM:master
from
K1ngst0m:feat/bindless-descriptor-cli
Jul 1, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
755956a
test(mock): add DescriptorLogicalLocation/DescriptorRange for descrip…
K1ngst0m 8601156
feat(descriptors): correlate used descriptors to binding name, resour…
K1ngst0m 52b4727
feat(descriptors): add 'rdc descriptors' command for per-draw used de…
K1ngst0m f2ffdef
feat(vfs): surface binding name and texture dims in descriptors leaf
K1ngst0m f9160fd
feat(resources): enrich resource/resources with dimensions, format an…
K1ngst0m a8bb7aa
feat(resources): append width/height/format/size columns to 'rdc reso…
K1ngst0m 6d6e680
fix(descriptors): map descriptor locations positionally, not by id()
K1ngst0m a143e8d
fix(descriptors): correlate via reflection index, not bind number
K1ngst0m 61f6c5c
fix(vfs): keep descriptors leaf columns append-only
K1ngst0m File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| """Used-descriptor inspection command.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from typing import Any | ||
|
|
||
| import click | ||
|
|
||
| from rdc.commands._helpers import call, complete_eid | ||
| from rdc.formatters.options import list_output_options, render_list | ||
| from rdc.formatters.tsv import write_tsv | ||
|
|
||
| _STAGE_CHOICES = ["vs", "hs", "ds", "gs", "ps", "cs"] | ||
|
|
||
|
|
||
| @click.command("descriptors") | ||
| @click.argument("eid", required=False, type=int, shell_complete=complete_eid) | ||
| @click.option( | ||
| "--stage", | ||
| "stage_filter", | ||
| type=click.Choice(_STAGE_CHOICES, case_sensitive=False), | ||
| help="Filter by shader stage.", | ||
| ) | ||
| @click.option("--type", "type_filter", help="Filter by descriptor type (case-insensitive).") | ||
| @click.option("--binding", "binding_filter", help="Filter by binding name or number.") | ||
| @list_output_options | ||
| def descriptors_cmd( # noqa: PLR0913 | ||
| eid: int | None, | ||
| stage_filter: str | None, | ||
| type_filter: str | None, | ||
| binding_filter: str | None, | ||
| no_header: bool, | ||
| use_json: bool, | ||
| use_jsonl: bool, | ||
| quiet: bool, | ||
| ) -> None: | ||
| """Show the descriptors a draw actually used, resolved to resources. | ||
|
|
||
| Each array element a shader read is listed with its resolved binding name | ||
| (e.g. g_textures), resource, and texture dimensions -- the per-draw view | ||
| that maps a bindless index to its concrete texture. | ||
| """ | ||
| params: dict[str, Any] = {} | ||
| if eid is not None: | ||
| params["eid"] = eid | ||
| if stage_filter is not None: | ||
| params["stage"] = stage_filter | ||
| if type_filter is not None: | ||
| params["type"] = type_filter | ||
| if binding_filter is not None: | ||
| params["binding"] = binding_filter | ||
|
|
||
| result = call("descriptors", params) | ||
| rows: list[dict[str, Any]] = result.get("descriptors", []) | ||
| row_eid = result.get("eid", "-") | ||
|
|
||
| def _table() -> None: | ||
| tsv_rows = [ | ||
| [ | ||
| row_eid, | ||
| r.get("stage", "-"), | ||
| r.get("binding", "-"), | ||
| r.get("type", "-"), | ||
| r.get("set", "-"), | ||
| r.get("array_element", "-"), | ||
| r.get("resource_id", "-"), | ||
| r.get("resource_name", "-"), | ||
| r.get("format", "-"), | ||
| r.get("width", "-"), | ||
| r.get("height", "-"), | ||
| ] | ||
| for r in rows | ||
| ] | ||
| write_tsv( | ||
| tsv_rows, | ||
| header=[ | ||
| "EID", | ||
| "STAGE", | ||
| "BINDING", | ||
| "TYPE", | ||
| "SET", | ||
| "ARRAY_EL", | ||
| "RESOURCE", | ||
| "RES_NAME", | ||
| "FORMAT", | ||
| "WIDTH", | ||
| "HEIGHT", | ||
| ], | ||
| no_header=no_header, | ||
| ) | ||
|
|
||
| render_list( | ||
| rows, | ||
| use_json=use_json, | ||
| use_jsonl=use_jsonl, | ||
| quiet=quiet, | ||
| quiet_key="resource_id", | ||
| table=_table, | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Preserve
eidin JSON/JSONL output too.The table path includes
row_eid, butrender_list()only seesrows, so--json/--jsonldiscard the resolved event id. If the caller omits the positional EID, machine-readable output no longer tells you which draw these descriptors came from.Suggested fix
result = call("descriptors", params) - rows: list[dict[str, Any]] = result.get("descriptors", []) row_eid = result.get("eid", "-") + rows: list[dict[str, Any]] = [ + {"eid": row_eid, **r} for r in result.get("descriptors", []) + ] ... - row_eid, + r.get("eid", "-"),📝 Committable suggestion
🤖 Prompt for AI Agents