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

ADD: ARL support to vp20compiler #638

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dKoitka
Copy link

@dKoitka dKoitka commented Jun 22, 2023

Can now use address relative indexing with passed in data. Useful for gpu vertex skinning

@dKoitka dKoitka changed the title FIX: ARL support ADD: ARL support to vp20compiler Jun 22, 2023
tools/vp20compiler/main.c Outdated Show resolved Hide resolved
tools/vp20compiler/main.c Outdated Show resolved Hide resolved
@JayFoxRox
Copy link
Member

Please squash your changes; also, we usually try to avoid multi-line commit messages (= we only use a commit title, but no commit description).

Did you try addressing relative with offsets? Stuff like C[A0 + 5]? I'd appreciate some trivial samples in the PR description or references to projects which use these features (for maintainers so they can try the feature + users to learn about them).

@@ -499,7 +504,9 @@ void translate(const char* str)
struct prog_src_register reg = ins.SrcReg[j];
if (reg.File != PROGRAM_UNDEFINED) {
// printf(" - in %d\n", j);
assert(!reg.RelAddr); //TODO: A0 rel
if(reg.RelAddr) {
vsh_set_field(vsh_ins, FLD_A0X, 1);
Copy link
Member

@JayFoxRox JayFoxRox Jun 23, 2023

Choose a reason for hiding this comment

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

Shouldn't this only work for PROGRAM_ENV_PARAM and be forbidden otherwise?

Also, to what source-reg does it apply? - shouldn't j be checked?
(Same goes for FLD_CONST or FLD_V which already existed - do we already prevent code from using it in multiple src registers?)

@JayFoxRox
Copy link
Member

Would be cool if someone could finish this (or do minor cleanup and merge as-is, then create issues from review feedback).

@dKoitka
Copy link
Author

dKoitka commented Oct 22, 2023

Hey @JayFoxRox I'll jump on when I have some time, got distracted and forgot about updating this. I'll reply to some comments

@JayFoxRox
Copy link
Member

That also works for me 👍 I was mostly trying to address the XboxDev maintainers.

This feature would be good to have, even if the implementation has minor issues (..which might not even exist, as I was simply asking about whether these cases are handled).

I consider this an issue with the XboxDev review process: It shouldn't delay 99.9%-done work for months.
We could squash-merge this as-is probably (and create issues from the remaining feedback).
Minor changes to the commit structure (which can't be fixed after merge) can be done by maintainers, imho.

If you address that anyway: Perfect!

@dKoitka
Copy link
Author

dKoitka commented Oct 22, 2023

I'll be happy to address the formatting issue, shouldn't take long. I don't remember seeing any specific case handled differently in the resource I was using to implement the ARL fix. However, if you'd like the ARL flag to be set in the only case I'm able to test, I'm confortable changing that. I believe it's only constants that I know for a fact work, I don't think R or V registers ever pop up for vp20compiler to process, but I think it's a possibility in some forum posts I remember looking at

@dKoitka
Copy link
Author

dKoitka commented Oct 22, 2023

I don't have any existing examples unfortunately, but could write one (which would piggy back off existing ones)

@dKoitka
Copy link
Author

dKoitka commented Oct 22, 2023

Not sure how to squash an existing merge request

@JayFoxRox JayFoxRox force-pushed the fix/arl_support branch 2 times, most recently from 1a478c7 to a7f9b94 Compare October 30, 2023 09:32
@JayFoxRox
Copy link
Member

I've fixed it for you.


In particular I did these steps in a terminal:

Set editor because I'll have to edit files as part of the git workflow

export EDITOR=nano

I downloaded your changes and made a working copy

git remote add dKoitka https://github.com/dKoitka/nxdk.git
git fetch dKoitka
git checkout dKoitka/fix/arl_support
git checkout -b fix/arl_support

I downloaded the latest nxdk version:

git fetch origin

I applied your changes to the latest nxdk version, -i[nteractively] which allows me to rename and edit things

git rebase -i origin/master

The interactive mode opens an editor now (nano for me) and I changed the second commit from pick to f[ixup] which means it gets combined into the other commit
I saved the filed and quit nano, so git started doing the pick and fixup step.

I then noticed another minor issue in the last commit and did this to edit the last commit (I also could have used r[eword] in an interactive rebase):

git commit --amend

In the editor, I renamed the previous commit and removed the long description.

Then I pushed my changes into your PR (which allows maintainers to edit it); force-pushing changes because I edited history / already public changes:

git push -u dKoitka fix/arl_support --force

@dKoitka
Copy link
Author

dKoitka commented Oct 30, 2023

thanks @JayFoxRox ! Sorry for ghosting like that, some life stuff happened, and I forgat again! Is the PROGRAM_ENV_PARAM comment you made the only thing remaining for this merge request?

@JayFoxRox
Copy link
Member

Sorry for ghosting like that, some life stuff happened, and I forgat again!

No worries.

Is the PROGRAM_ENV_PARAM comment you made the only thing remaining for this merge request?

I think we can ignore that for now and turn it into a GitHub issue so we can check it later.

I assume someone will merge this, or I'll do a final review-pass and merge it in the coming days (although my life is also quite busy right now, so it might take a while).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants