-
Notifications
You must be signed in to change notification settings - Fork 769
Intel Mesa OpenGL bug fixes and cleanup #368
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
Conversation
@@ -347,10 +424,10 @@ struct OpenGLDepthPacketProcessorImpl : public WithOpenGLBindings | |||
Texture<U16C1> input_data; | |||
|
|||
Texture<F32C4> stage1_debug; | |||
Texture<F32C3> stage1_data[3]; | |||
Texture<F32C4> stage1_data[3]; |
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.
Just curious, what was the particular effect of the old value?
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.
The effect is the texture can't be attached to FBO. With INTEL_DEBUG=fbo,...
you get FBO incomplete: Unsupported HW texture/renderbuffer format attached: MESA_FORMAT_RGB_FLOAT32
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.
Original diagnosis was in #352.
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.
Ah okay, thanks for the explanation
v2:
|
v3:
|
Rebased to master. |
Could you please rebase once more, so it only shows the new commits? |
Tested on Ubuntu 14.04 with |
Intel/Mesa has GL_MAX_RECTANGLE_TEXTURE_SIZE=4096, but this was asking for 424*10. Drop the 10th frame which seems useless now, so the texture size works for Intel/Mesa.
F32C3 format is not supported on Intel/Mesa making FBOs incomplete. Just change F32C3 to F32C4, and vec3 output automatically expands to vec4. Also add completeness checks to each FBO.
Mesa 10.2.9 and older versions are oblivious to a behavior change in the CMP instruction on Intel CPU SandyBridge and newer. On SandyBridge and newer ones, CMP instruction sets all bits to one in dst register (-1) as boolean true value. Before that, only the LSB is set to one with other bits being undefined. Mesa 10.2.9 and older use XOR instruction on the LSB for the logical not operator, which produces -2 as boolean value for !true. The value is then used by SEL instruction in mix(), which compares the value with zero and does not clear high bits before that, selecting wrong components. A macro MESA_BUGGY_BOOL_CMP is added to forcibly convert -1 to 1 for Mesa 10.2.9 and older before logical not result is used for mix(). The rest of comparison operators and conditionals are safe from this behavior. I could not independently reproduce this behavior in a seperate standalone problem. It is possibly because instruction generation varies from optimization. This behavior was fixed in Mesa upstream 2e51dc838be177a09f60958da7d1d904f1038d9c, only appearing in 10.3+.
Remove commented definitions. They can be found in commit history. Move OpenGL version check out of flextGL, and use LOG_* macros for error reporting.
Assembly errors and lost packets should not flood the log output.
Rebased to master. |
This is weird. Did you use |
No, this was with the viewer enabled. Nevertheless, since the viewer and the OpenGL DPP are not linked together, I would assume that download and re-upload to GPU memory still have to happen? |
Yes. OpenGL should be slower because it does extra flipping on CPU. |
As usual: if we don't merge it, we'll never know if it has hidden issues. Merging. |
Intel Mesa OpenGL bug fixes and cleanup
This is rebased on #364. Commits of this PR begin from "changed minimal opengl version to 3.1".
This PR fixes all bugs on Intel GPU. This PR supersedes #352.
Performance comparison on i7-4600U @ 2.10GHz: