[mlir][dxsa] Add root dxsa.module#155
Open
tagolog wants to merge 1 commit into
Open
Conversation
asavonic
reviewed
Jun 1, 2026
Wraps the program into a module with optional attributes program type and shader version.
When the binary has no header both attributes are omitted.
Example:
dxsa.module pixel_shader 5 0 {
dxsa.dcl_global_flags <refactoringAllowed>
}
dxsa.module {
dxsa.dcl_global_flags <refactoringAllowed>
}
Signed-off-by: Vladimir Shiryaev <tagolog@users.noreply.github.com>
82eb011 to
6b59659
Compare
asavonic
approved these changes
Jun 2, 2026
| if (DECODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(versionToken) != 0) | ||
| return std::optional<ProgramHeader>{}; | ||
|
|
||
| auto rawType = static_cast<uint32_t>( |
Contributor
There was a problem hiding this comment.
This seems concise to me:
uint32_t rawType = DECODE_D3D10_SB_TOKENIZED_PROGRAM_TYPE(versionToken);
|
|
||
| auto versionToken = support::endian::read<uint32_t>( | ||
| buffer.begin() + currentTokenOffset, endianness::little); | ||
| if (DECODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(versionToken) != 0) |
Contributor
There was a problem hiding this comment.
If we expect PROGRAM_TYPE length to always be 0, then it should be an error. If it is not followed by a length token, it is also an error.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Wraps the program into a module with optional attributes program type and shader version. When the binary has no header both attributes are omitted.
Example:
dxsa.module pixel_shader 5 0 {
dxsa.dcl_global_flags
}
dxsa.module {
dxsa.dcl_global_flags
}