Skip to content

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