Skip to content

Fix --no-clean for vulkan-shaders-gen #10445

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

Closed
wants to merge 5 commits into from
Closed

Fix --no-clean for vulkan-shaders-gen #10445

wants to merge 5 commits into from

Conversation

netrunnereve
Copy link
Collaborator

@netrunnereve netrunnereve commented Nov 21, 2024

This fixes the broken --no-clean option that prevents vulkan-shaders-gen.cpp from deleting the spir-v shaders after generation.


This is more of a side note but it's possible to disassemble the shaders to see what the compiler is doing, though the output is really cryptic.

AMD RGA is also another choice for disassembling shaders and it shows the register use and cycles per instruction as well. For the cosine shader for instance I can see that the vast majority of the time is spent on preparing the offsets and setting up the data and only 16 cycles are used for the actual calculation.

rga

@netrunnereve netrunnereve requested a review from 0cc4m November 21, 2024 17:38
@0cc4m
Copy link
Collaborator

0cc4m commented Nov 22, 2024

Can you describe the issue that you are fixing in more detail? I don't understand it yet.

@netrunnereve
Copy link
Collaborator Author

netrunnereve commented Nov 22, 2024

In this section where we read in the command line arguments for vulkan-shaders-gen the code expects each flag to have a corresponding value (e.g. --flag value). Try running the master version of vulkan-shaders-gen manually on the command line and you'll notice that --no-clean doesn't prevent the shaders from being deleted.

int main(int argc, char** argv) {
    std::map<std::string, std::string> args;
    for (int i = 1; i < argc; i += 2) {
        if (i + 1 < argc) {
            args[argv[i]] = argv[i + 1];
        }
    }

We could create a more complex parsing system to handle both no argument and one argument flags but simply adding a "true" to --no-clean is the easiest way to fix this.

@netrunnereve
Copy link
Collaborator Author

Replaced by #10484.

@netrunnereve netrunnereve deleted the vulkan branch November 26, 2024 01:34
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