Skip to content

Fix _shader_compile_spirv_from_source#52278

Open
KPGabor1999 wants to merge 1 commit intogodotengine:masterfrom
migeran:fix_shader_compile_spirv_from_source
Open

Fix _shader_compile_spirv_from_source#52278
KPGabor1999 wants to merge 1 commit intogodotengine:masterfrom
migeran:fix_shader_compile_spirv_from_source

Conversation

@KPGabor1999
Copy link
Copy Markdown

This pull request fixes _shader_compile_spirv_from_source. Compute shaders are now being compiled properly. Previously when trying to compile compute shaders, other stages were also being compiled with it causing errors.

@KPGabor1999 KPGabor1999 requested a review from a team as a code owner August 31, 2021 11:28
@Calinou Calinou added this to the 4.0 milestone Aug 31, 2021
Copy link
Copy Markdown
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Please amend your pull request to follow the code style guidelines and C++ usage guidelines. We don't use auto in Godot's codebase.

Also, is the lambda really necessary here? We generally keep our use of lambdas to a minimum.

@KPGabor1999
Copy link
Copy Markdown
Author

Okay, fixed both issues.

Comment thread servers/rendering/rendering_device.cpp Outdated
Comment thread servers/rendering/rendering_device.cpp Outdated
Comment thread servers/rendering/rendering_device.cpp Outdated
Comment thread servers/rendering/rendering_device.cpp Outdated
@KPGabor1999
Copy link
Copy Markdown
Author

Okay, fixed all the spacing issues.

@kisg
Copy link
Copy Markdown
Contributor

kisg commented Sep 7, 2021

Hi @Calinou, do you need anything else to be changed in the PR? Thank you!

@KPGabor1999
Copy link
Copy Markdown
Author

Hi @Calinou, why do the static checks fail? I'm spacing that if statement exactly as requested.

@KPGabor1999
Copy link
Copy Markdown
Author

Okay, now everything should be fine.

Comment thread servers/rendering/rendering_device.cpp Outdated
Comment thread servers/rendering/rendering_device.cpp Outdated
Comment thread servers/rendering/rendering_device.cpp Outdated
@akien-mga
Copy link
Copy Markdown
Member

After doing style fixups, please squash the commits together as for such a bugfix PR a single commit should be good once merged: PR workflow.

@KPGabor1999 KPGabor1999 force-pushed the fix_shader_compile_spirv_from_source branch from 1964736 to 42885c4 Compare September 16, 2021 12:26
@KPGabor1999 KPGabor1999 requested review from a team as code owners September 16, 2021 12:26
@akien-mga akien-mga requested a review from Calinou September 16, 2021 12:43
@akien-mga
Copy link
Copy Markdown
Member

It seems like you squashed your work together with other unrelated commits (see merge conflicts and +709 line additions). You can get back to the previous state using git reflog to find a hash for your branch before that unfortunate rebase, and use git reset --hard <hash> to go back to it.

Once fixed up, the resulting commit should also be given a meaningful description (currently it's "Squashing all the previous commits together.", which doesn't describe what the commit does, only what you did :)).

The above can be a bit tricky if you're not familiar with these Git commands, so if preferred, it's also fine to redo your changes in a clean new branch to make a new PR. You can also set up our pre-commit hooks to ensure that you get style issues fixed right away: https://docs.godotengine.org/en/latest/community/contributing/code_style_guidelines.html

Now it handles the compute pipeline and the render pipeline separately.
@KPGabor1999 KPGabor1999 force-pushed the fix_shader_compile_spirv_from_source branch from 42885c4 to 5dda9a5 Compare September 17, 2021 11:04
@kisg
Copy link
Copy Markdown
Contributor

kisg commented Oct 3, 2021

Hi @akien-mga, we updated the PR as requested. Could you please take a look? Thank you!

@akien-mga
Copy link
Copy Markdown
Member

This looks good style and Git wise 👍

I'll try to get the @godotengine/rendering team to review and approve the code changes.

bytecode.instantiate();
for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) {
String error;
String error;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is mandated in the newer GLSL that you specify #version so shaders will probably never be empty if they exist. Seems like its easier to just check for empty shader and continue if nothing found.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

But we already check for whether the current stage source code != String() before we do anything. Why is that wrong?

@akien-mga akien-mga modified the milestones: 4.0, 4.x Feb 12, 2023
@akien-mga
Copy link
Copy Markdown
Member

Sorry for the huge delay. Is this still relevant in the current master branch?

There's no linked bug report / steps to reproduce so it's difficult to assess what this aimed to fix exactly.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants