-
-
Notifications
You must be signed in to change notification settings - Fork 20.8k
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
Vulkan: Don't warn about invalid pipelines cache if missing #89180
Vulkan: Don't warn about invalid pipelines cache if missing #89180
Conversation
@@ -3828,8 +3828,8 @@ bool RenderingDeviceDriverVulkan::pipeline_cache_create(const Vector<uint8_t> &p | |||
|
|||
// Parse. | |||
{ | |||
if (p_data.size() <= (int)sizeof(PipelineCacheHeader)) { | |||
WARN_PRINT("Invalid/corrupt pipelines cache."); | |||
if (p_data.size() != (int)sizeof(PipelineCacheHeader)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change it back to <=
if it was indeed intentional to treat a bigger buffer as supported and attempt parsing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like it'd make it fail any time the data is not exactly the size of the header. The condition is for ensuring it has enough bytes to parse at least the header. This effectively makes the pipeline cache never work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I only singled out the size() == 0
case, so that it doesn't warn when there's no data (which is the case currently, it just loads the file and sends the data to the function without further check).
But then I still got warnings after adding a 3D node to my project, presumably because the data was now bigger than the previous pipelines cache generated from an empty scene? Might have been with my !=
change though, so I'll test again with <=
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can say in isolation the code doing the <= check is the intended approach at least. I believe there's other reasons why it keeps complaining it's corrupted, but this condition can't be it: it's just checking if there's enough bytes to parse the header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted that change and now only handle the size() == 0
case specifically.
That solves the warning when editing a project without a pre-existing cache, and doesn't seem to trigger warnings when modifying the project (from a quick test). So the warnings I saw earlier were likely from my changing the check to !=
.
In theory it should not do that. There seems to be an unrelated error as to why it thinks the pipeline cache is corrupted every time it starts. The only kind of change that should lead to invalidating it is a driver version change or some source-level change in Godot itself that invalidates everything by changing the version number. That said the pipeline cache is a bit of a discussion point and I'm not sure I've seen much benefit of using it myself. I think the current belief is that Mobile might rely more on it, as on desktop it's pretty much guaranteed the driver will handle it on its own as well. It'll certainly make things a bit harder going forward to provide parallel PSO compilation, as synchronizing one cache is a multi-thread contention point there. |
See #80232 which makes the messages more descriptive without removing them entirely. |
IMO given how spammy those are, I wouldn't make them even more verbose and give users the impression their game will suffer from it. Edit: After my PR is merged, I guess those additions could be ok, as those warnings should become rare. But those warnings being rare and engine dev oriented is also an incentive not to make them too verbose and user-oriented. |
e00c56a
to
2cb0ba2
Compare
It used to warn when opening a new project because no cache pre-exists, which isn't particularly helpful. Also include the rendering method in the cache filename, as it differs between Forward+ and Mobile for a same GPU.
2cb0ba2
to
e74f4ea
Compare
It used to warn when opening a new project because no cache pre-exists,
which isn't particularly helpful.
See #81150 (comment)
Also include the rendering method in the cache filename, as it differs
between Forward+ and Mobile for a same GPU.
Full set of pipelines caches on my laptop with integrated AMD and discrete AMD GPUs, editing both Forward+ and Mobile versions of a blank Vulkan project.