-
Notifications
You must be signed in to change notification settings - Fork 2k
Tests: Fixes for backend tests when using Vulkan #9031
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
base: main
Are you sure you want to change the base?
Conversation
- Make sure the defaultRenderTarget is created before calling makeCurrent. - Add some missing TextureUsage flags to textures - Add a finish to the RenderFrame destructor, so it guarantess that the GPU work is completed, prevents some synchronization issues.
filament/backend/test/Lifetimes.cpp
Outdated
@@ -25,6 +25,7 @@ RenderFrame::RenderFrame(filament::backend::DriverApi& api): mApi(api) { | |||
|
|||
RenderFrame::~RenderFrame() { | |||
mApi.endFrame(0); | |||
mApi.finish(); |
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.
Can you elaborate on the synchronization issues you were experiencing? Was it only with the Vulkan backend?
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 only saw it with the vulkan backend (the only one I tested) and it was just the report of the validation layers, the source of this is coming when doing readPixels which is not synchronized properly with vulkan, cant comment on metal.
So I just made the safe approach to make sure the work is completed before trying to read the data, which in the case of tests should be fine.
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.
We can't "fix the tests" to workaround bugs in the backends -- that's the whole point of having tests. readPixels
should work without having to call finish() and it should work from within a renderpass. If the vk backend needs fixing, I prefer we file a buganizer, prioritize and fix rather an working around in the tests.
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 removed the finish calls.
Will create a bug for the readPixels synchronization issue.
@@ -48,7 +48,7 @@ layout(location = 0) out vec4 fragColor; | |||
|
|||
// Filament's Vulkan backend requires a descriptor set index of 1 for all samplers. | |||
// This parameter is ignored for other backends. | |||
layout(location = 0, set = 0) uniform {samplerType} test_tex; | |||
layout(binding = 0, set = 0) uniform {samplerType} test_tex; |
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.
are we sure this doesn't break the other backends?
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.
Using location here is wrong GLSL code, the correct one is binding
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.
so there's glsl for opengl and then glsl for spirv conversion. Could this be one of places where they differ?
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 checked here https://www.khronos.org/opengl/wiki/Layout_Qualifier_(GLSL)
The only thing extra in vulkan is the "set" parameter, but that one seems to be ignored in GL
Uh oh!
There was an error while loading. Please reload this page.