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

Structured module items #63

Merged
merged 1 commit into from
Aug 1, 2019
Merged

Structured module items #63

merged 1 commit into from
Aug 1, 2019

Conversation

kvark
Copy link
Member

@kvark kvark commented Jul 29, 2019

This is another small step towards #5 , taken out of #46
It's based on #62, so only the second commit needs to be reviewed here.
We are now generating a few enums and a few standalone structs for the instructions.

@kvark kvark requested a review from antiagainst July 29, 2019 14:40
@antiagainst
Copy link
Collaborator

This needs a rebase now. :)

@kvark
Copy link
Member Author

kvark commented Jul 30, 2019

Rebased now

Copy link
Collaborator

@antiagainst antiagainst left a comment

Choose a reason for hiding this comment

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

LGTM!

I just have a few comments. Feel free to submit after addressing them.

Please make sure the commit message is edited properly to show the
changes. Thanks!

function_type: spirv::Word,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct FunctionParameter {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we still want to have separate ops for these function components? I think they should be folded into the function SR itself. I mean, FunctionEnd is useful for marking the end of a function in SPIR-V binary, but not useful for SR. Similarly for Label, it should be implicit for BasicBlock SR. Letting each pass processing Function or BasicBlock to worry about FunctionEnd and Label is not helpful.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, we'll need to set up a list of ops that don't need SR autogen generation, and which we are going to be converting to and from DR manually. We'll do it as a follow-up.

///
/// Although it is required by the specification to appear exactly once
/// per module, we keep it optional here to allow flexibility.
pub memory_model: Option<op::MemoryModel>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want to still keep it optional in SR? I think we should mandate it here.


pub struct Module {
/// The module header.
pub header: Option<ModuleHeader>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be mandated?

//pub interface: Vec<spirv::Word>,
}

pub struct BasicBlock {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is the Vector for instructions?

@kvark
Copy link
Member Author

kvark commented Aug 1, 2019

Thanks for the review! All the concerns are addressed now, I believe.

@kvark
Copy link
Member Author

kvark commented Aug 1, 2019

I think the commit message is descriptive enough? If not, let's talk about this some more and figure out good guidelines.

@kvark kvark merged commit beec13b into gfx-rs:master Aug 1, 2019
@kvark kvark deleted the module branch August 1, 2019 20:48
@antiagainst
Copy link
Collaborator

I typically prefer to have a concise onliner for describing what the commit is doing. The onliner shouldn't be too long so it renders nicely on GitHub UI (otherwise we will see ... and broken sentences) and also CLI log dump.

Then have some more detailed explanation following after an empty line. I'd prefer to have the detailed explanation to have proper line breaks so each paragraph is not on a single line. (Otherwise when we do git log, it's quite annoying to have extra long lines, especially we you use tmux or screen and are in a small tab, then the message will just be truncated.)

@antiagainst
Copy link
Collaborator

The content of the message is good (modulo a typo for module but not a big thing)! Thanks! :)

@kvark kvark mentioned this pull request Aug 1, 2019
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