-
Notifications
You must be signed in to change notification settings - Fork 769
changed minimal opengl version to 3.1 #352
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
What about adding glfwSetErrorCallback, and glGetError at places? |
@xlz where? why? is it related to the lower version or just to improve error handling? |
To improve diagnosis for common situations like the output being black, since there isn't much information printed about internal OpenGL errors. I can make a separate PR for this later, but since you already have an OpenGL PR going on, I thought this would be an easy addition. glfwseterrorcallback is called before glfwinit. |
@christiankerl couldn't you just use GL_EXT_texture_rectangle instead of GL_ARB_texture_rectangle? However, I'm not sure if it's worth the hassle, 3.1 is already very widely supported AFAICT. BTW, unfortunately this still doesn't change anything on Intel GPU under Linux: all depth windows remain black :-/ @xlz's suggestion of liberal glGetError usage is probably the only way to deal with this at some point. |
After adding a bunch of glGetError, the first error is
Intel Mesa has
I think we can drop the 10th frame and allocate |
The second error is
The solution is to change |
The last issue is black output with Ubuntu 14.04. 3.3 (Core Profile) Mesa 10.1.3 does not work. 3.3 (Core Profile) Mesa 10.7.0-devel (git-86a74e9 2015-06-03 trusty-oibaf-ppa) works. Mesa 10.1.3 also works with this change in stage1.fs: - bvec3 invalid_pixel = bvec3(!valid_pixel);
+ vec3 invalid_pixel = vec3(!valid_pixel);
A = mix(vec3(ab0.x, ab1.x, ab2.x), vec3(0.0), invalid_pixel);
|
so with all these changes it works on mesa 10.1.3 on intel gpu? I will try to update the PR |
Yes. I had it working with Mesa 10.1.3 all the changes. The first one: The second one, But the last one is only a workaround. I have not found the root cause. I think there will be a bit performance penalty to use vec3 instead of bvec3. |
The root cause of the last issue is this (fixed in this commit): commit 2e51dc838be177a09f60958da7d1d904f1038d9c
Author: Matt Turner <[email protected]>
Date: Fri Aug 8 21:00:31 2014 -0700
i965: Use ~0 to represent true on Gen >= 6.
total instructions in shared programs: 4292303 -> 4288650 (-0.09%)
instructions in affected programs: 299670 -> 296017 (-1.22%)
Reviewed-by: Anuj Phogat <[email protected]>
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 12f898a..216b788 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -483,7 +483,32 @@ brw_initialize_context_constants(struct brw_context *brw)
ctx->Const.QuadsFollowProvokingVertexConvention = false;
ctx->Const.NativeIntegers = true;
- ctx->Const.UniformBooleanTrue = 1;
+
+ /* Regarding the CMP instruction, the Ivybridge PRM says:
+ *
+ * "For each enabled channel 0b or 1b is assigned to the appropriate flag
+ * bit and 0/all zeros or all ones (e.g, byte 0xFF, word 0xFFFF, DWord
+ * 0xFFFFFFFF) is assigned to dst."
+ *
+ * but PRMs for earlier generations say
+ *
+ * "In dword format, one GRF may store up to 8 results. When the register
+ * is used later as a vector of Booleans, as only LSB at each channel
+ * contains meaning [sic] data, software should make sure all higher bits
+ * are masked out (e.g. by 'and-ing' an [sic] 0x01 constant)."
+ *
+ * We select the representation of a true boolean uniform to match what the
+ * CMP instruction returns.
+ *
+ * The Sandybridge BSpec's description of the CMP instruction matches that
+ * of the Ivybridge PRM. (The description in the Sandybridge PRM is seems
+ * to have not been updated from Ironlake). Its CMP instruction behaves like
+ * Ivybridge and newer.
+ */
+ if (brw->gen >= 6)
+ ctx->Const.UniformBooleanTrue = ~0;
+ else
+ ctx->Const.UniformBooleanTrue = 1; |
Closing in favor of #368. |
this should maximize compatibility with older mesa versions. just tested on nvidia gpu, could someone try this on intel/mesa? downgrading to opengl 3.0 would require to remove the use of rectangle textures (this would be some more work...)