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
Image rendered in gray since 1847c72 #618
Comments
I finally took to some time to understand what's the problem is. At 1847c72#diff-c0ea44662863be913517b9e9a9ce2befe9c9eaadf01e4e36283ff9e97e0164d5R147, you say that But at 1847c72#diff-c0ea44662863be913517b9e9a9ce2befe9c9eaadf01e4e36283ff9e97e0164d5R344, you exclude GLES310. Do you think you should replace |
Hey, sorry for completely neglecting this issue, and your PRs. This particular commit is enabling a GLES 3.1+ feature where texture, input and output locations can be specified directly in the shader using That it renders a gray image seems to be some sort of a driver bug, which I would most probably need to work around in some way. I ran through the shader tests on a bunch of targets that have GLES 3.2 and it all passes for me. You're saying that if you use Can you share more details about the hardware you test on? Ideally the output of the |
No problem for the delay. Plus, hardware specific problem could be difficult to fix. The phone: https://rog.asus.com/phones/rog-phone-6-model/ The log: Yes, replacing Branch 1 and 2 enabled : color
For branch 1, if I force it :
Tell me if you need for information. |
Thank you! So that seems like explicit uniform location isn't working on Adreno. Or a subset of it, or the shader is triggering some unfortunate code path in the driver but the rest of the feature works. (I remember having an issue with explicit uniform location on Intel drivers on Windows, where the explicit uniform location only worked if the uniforms were numbered in an order exactly as they appeared in the code, with no gaps, and that was just impossible to workaround in a robust way so there I had to disable them completely.) I looked around and didn't find any bugreports related to this. But since it's an ES3.1 feature, it's possible that very few projects actually opted in to use it and stayed on the classic way for more compatibility (which also is why it may be buggy). The list at https://chromium.googlesource.com/chromium/src/gpu/+/refs/heads/main/config/gpu_driver_bug_list.json contains a ton of Adreno-related bugs, but this one not, probably for a similar reason, that Chrome just doesn't make use of explicit uniform location. I have extensive tests for the Flat shader, could you run them on the device? Assuming you have
I'm interested in an output both with vanilla unchanged code, and with the "Branch 1 enabled, 2 disabled" changes from above. The output will show some Thanks again! |
I wasn't able to run ctest. So I copy all built files and all tga files to device. I hope it's fine. false_false.log : first branch disabled / second branch disabled (vanilla) true_false.log : first branch forced ( true_true.log : first branch forced ( Both branch definitely must be forced in my case. |
Thanks, nice, so it can be convinced to render everything properly :) The GL errors in the first case are suspicious, and might point to something. Could you re-run the first case with In the second case it looks like it only affects UBO usage and not classic uniforms, which reduces the scope of the needed workaround quite a lot. On the other hand, SSBO binding works, even though it's the same Sorry that you couldn't get ctest to run, forgot to mention the runner script was only ever tested on Linux. (I wanted to eventually ask you to run all tests there to uncover potential other driver bugs, but given there's about 300 test executables, without the ctest automation it'd be way too painful.) |
Oh, and one more thing so I have the full information, can you get me the output of |
I launched a The result of vanilla for And |
It doesn't seem that bad, actually :)
The debug / GPU validation log unfortunately didn't enlighten me much. It seems like the driver just completely ignores the I got two "last hope" ideas for fixing the Flat shader -- can you try this patch with no other change? Maybe the driver just has some version checks messed up and compiling the shader as GLSL ES 3.20 instead of 3.10 would make it recognize everything properly? diff --git a/src/Magnum/Shaders/FlatGL.cpp b/src/Magnum/Shaders/FlatGL.cpp
index fe5a5cbe9..412c34931 100644
--- a/src/Magnum/Shaders/FlatGL.cpp
+++ b/src/Magnum/Shaders/FlatGL.cpp
@@ -162,7 +162,7 @@ template<UnsignedInt dimensions> typename FlatGL<dimensions>::CompileState FlatG
#else
const GL::Version version = context.supportedVersion({
#ifndef MAGNUM_TARGET_WEBGL
- GL::Version::GLES310,
+ GL::Version::GLES320,
#endif
GL::Version::GLES300, GL::Version::GLES200});
#endif
The other idea would be this -- again try this change alone, not even with the above. This makes the diff --git a/src/Magnum/Shaders/compatibility.glsl b/src/Magnum/Shaders/compatibility.glsl
index 7f5b9eb24..d8bde772c 100644
--- a/src/Magnum/Shaders/compatibility.glsl
+++ b/src/Magnum/Shaders/compatibility.glsl
@@ -47,12 +47,10 @@
#if __VERSION__ >= 300
#define EXPLICIT_ATTRIB_LOCATION
#endif
- #if __VERSION__ >= 310
- #define EXPLICIT_BINDING
- #define EXPLICIT_UNIFORM_LOCATION
- #endif
/* RUNTIME_CONST is not available in OpenGL ES */
#endif
+#define EXPLICIT_BINDING
+#define EXPLICIT_UNIFORM_LOCATION
/* Precision qualifiers are not supported in GLSL 1.20 */
#if !defined(GL_ES) && __VERSION__ == 120
If neither of the two make any difference, I'll proceed with creating the full workaround. Thanks a lot for being this responsive! |
Thanks for your diagnostic. It's annoying that GPU driver are so buggy. LibreOffice also maintains a (very) small blacklist GPU list for OpenGL / Skia for computer but blocks very widely. For vanilly + For vanilly + change to force
|
Thank you!
Well, that's just stupid :/ Such a silly bug. So basically the driver supports everything and has no bugs whatsoever, it's just that when they added ES3.1+ support they forgot to update the So the fix would be to supply my own version define and ignore |
I searched a little on https://rog-forum.asus.com without success. My Rog 6 phone is up to date (33.0610.2810.104) and not rooted. |
Alright, if I did everything correctly, the a00270c and 9b160e9 commits in the Once you confirm, I'll merge to |
I checkout next. I have color without any modification! Thanks, log for all tests. I added some missing data files. all_tests.log |
Wonderful :) The above is now pushed to I went through the log and everything seems fine now, the only remaining errors I see in If you still have time, could you re-run this single test with diff --git a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp
index b579a4d35..45fd6e710 100644
--- a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp
+++ b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp
@@ -4581,8 +4581,9 @@ template<MeshVisualizerGL2D::Flag flag> void MeshVisualizerGLTest::renderObjectV
CORRADE_SKIP(GL::Version::GLES310 << "is not supported.");
#endif
- /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders */
- if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 3)
+ /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders,
+ some others (Qualcomm Adreno 730) support just 4 blocks */
+ if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < (data.flags2D & MeshVisualizerGL2D::Flag::TextureTransformation ? 4 : 3))
CORRADE_SKIP("Only" << GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) << "shader storage blocks supported in vertex shaders.");
} else
#endif
@@ -4796,8 +4797,9 @@ template<MeshVisualizerGL3D::Flag flag> void MeshVisualizerGLTest::renderObjectV
CORRADE_SKIP(GL::Version::GLES310 << "is not supported.");
#endif
- /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders */
- if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 3)
+ /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders,
+ some others (Qualcomm Adreno 730) support just 4 blocks */
+ if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < (data.flags3D & MeshVisualizerGL3D::Flag::TextureTransformation ? 5 : 4))
CORRADE_SKIP("Only" << GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) << "shader storage blocks supported in vertex shaders.");
} else
#endif
@@ -5290,8 +5292,9 @@ template<MeshVisualizerGL2D::Flag flag> void MeshVisualizerGLTest::renderSkinnin
CORRADE_SKIP(GL::Version::GLES310 << "is not supported.");
#endif
- /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders */
- if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 4)
+ /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders,
+ some others (Qualcomm Adreno 730) support just 4 blocks */
+ if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < (data.jointCount ? 4 : 3))
CORRADE_SKIP("Only" << GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) << "shader storage blocks supported in vertex shaders.");
} else
#endif
@@ -5451,8 +5454,9 @@ template<MeshVisualizerGL3D::Flag flag> void MeshVisualizerGLTest::renderSkinnin
CORRADE_SKIP(GL::Version::GLES310 << "is not supported.");
#endif
- /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders */
- if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 4)
+ /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders,
+ some others (Qualcomm Adreno 730) support just 4 blocks */
+ if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < (data.jointCount ? 5 : 4))
CORRADE_SKIP("Only" << GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) << "shader storage blocks supported in vertex shaders.");
} else
#endif
@@ -5613,8 +5617,9 @@ template<MeshVisualizerGL2D::Flag flag> void MeshVisualizerGLTest::renderInstanc
CORRADE_SKIP(GL::Version::GLES310 << "is not supported.");
#endif
- /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders */
- if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 3)
+ /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders,
+ some others (Qualcomm Adreno 730) support just 4 blocks */
+ if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < (data.flags & MeshVisualizerGL2D::Flag::TextureTransformation ? 3 : 4))
CORRADE_SKIP("Only" << GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) << "shader storage blocks supported in vertex shaders.");
} else
#endif
@@ -5911,7 +5916,7 @@ template<MeshVisualizerGL3D::Flag flag> void MeshVisualizerGLTest::renderInstanc
#endif
/* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders */
- if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 3)
+ if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < (data.flags & MeshVisualizerGL3D::Flag::TextureTransformation ? 5 : 4))
CORRADE_SKIP("Only" << GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) << "shader storage blocks supported in vertex shaders.");
} else
#endif
@@ -6239,8 +6244,9 @@ template<MeshVisualizerGL2D::Flag flag> void MeshVisualizerGLTest::renderInstanc
CORRADE_SKIP(GL::Version::GLES310 << "is not supported.");
#endif
- /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders */
- if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 3)
+ /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders,
+ some others (Qualcomm Adreno 730) support just 4 blocks */
+ if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 4)
CORRADE_SKIP("Only" << GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) << "shader storage blocks supported in vertex shaders.");
} else
#endif
@@ -6396,8 +6402,9 @@ template<MeshVisualizerGL3D::Flag flag> void MeshVisualizerGLTest::renderInstanc
CORRADE_SKIP(GL::Version::GLES310 << "is not supported.");
#endif
- /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders */
- if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 3)
+ /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders,
+ some others (Qualcomm Adreno 730) support just 4 blocks */
+ if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 5)
CORRADE_SKIP("Only" << GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) << "shader storage blocks supported in vertex shaders.");
} else
#endif
@@ -6571,8 +6578,9 @@ void MeshVisualizerGLTest::renderMulti2D() {
CORRADE_SKIP(GL::Version::GLES310 << "is not supported.");
#endif
- /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders */
- if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 3)
+ /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders,
+ some others (Qualcomm Adreno 730) support just 4 blocks */
+ if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < (data.flags & MeshVisualizerGL2D::Flag::TextureTransformation ? 4 : 3))
CORRADE_SKIP("Only" << GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) << "shader storage blocks supported in vertex shaders.");
}
#endif
@@ -6910,8 +6918,9 @@ void MeshVisualizerGLTest::renderMulti3D() {
CORRADE_SKIP(GL::Version::GLES310 << "is not supported.");
#endif
- /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders */
- if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 3)
+ /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders,
+ some others (Qualcomm Adreno 730) support just 4 blocks */
+ if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < (data.flags & MeshVisualizerGL3D::Flag::TextureTransformation ? 5 : 4))
CORRADE_SKIP("Only" << GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) << "shader storage blocks supported in vertex shaders.");
}
#endif
@@ -7253,7 +7262,8 @@ void MeshVisualizerGLTest::renderMultiSkinningWireframe2D() {
CORRADE_SKIP(GL::Version::GLES310 << "is not supported.");
#endif
- /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders */
+ /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders,
+ some others (Qualcomm Adreno 730) support just 4 blocks */
if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 4)
CORRADE_SKIP("Only" << GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) << "shader storage blocks supported in vertex shaders.");
}
@@ -7503,8 +7513,9 @@ void MeshVisualizerGLTest::renderMultiSkinningWireframe3D() {
CORRADE_SKIP(GL::Version::GLES310 << "is not supported.");
#endif
- /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders */
- if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 4)
+ /* Some drivers (ARM Mali-G71) don't support SSBOs in vertex shaders,
+ some others (Qualcomm Adreno 730) support just 4 blocks */
+ if(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) < 5)
CORRADE_SKIP("Only" << GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex) << "shader storage blocks supported in vertex shaders.");
}
#endif
Thanks! |
I patched MeshVisualizerGLTest.cpp then ran all tests with and without gpu-validation. all_tests_rog6.zip And if you are interested in, the same tests ran in a ROG5, rooted and not up to date 18.0840.2112.210. rog5.zip |
Ahh, finally it clicked for me. The remaining errors were my fault, geometry-shader-less wireframe rendering in the MeshVisualizer has some unused uniforms (in particular, they get DCE'd by the shader compiler), and turns out the Adreno driver doesn't like that I'm attempting to set them even though they're not there anymore. Not sure if it's valid or invalid according to the GL spec, nevertheless it's something I probably shouldn't be doing. So I patched the shader in 65669be to not do that anymore, and that should fix the remaining errors. Which makes this issue fully resolved and I can finally close it 🎉 Thanks for all the help and diagnostic here, much appreciated! I looked at the ROG5 test output, it seems that the older drivers work equally well, which is very nice. |
Thanks for spending time on my problem :) I don't have any remaining problem. |
I tried to update from corrade/magnum 2020.06 to master bc1859f.
I now have my image in gray instead of color. I made a bisect and git gave me commit 1847c72.
I used corrade mosra/corrade@68d0216
I only maintains the application. I didn't develop this part. What information do you need to diagnostic the problem ?
The text was updated successfully, but these errors were encountered: