Part of the changes of the branch alvin/T6696-opengl-angle (up to e3b45ab77508e59e3d9929d3fb212519603f7b7b)
These are the changes for making ANGLE work.
Things to note:
- The run-once check in KisOpenGL::setDefaultFormat is only to remove a warning message in Qt. There should be no functional differences.
- The warning message is: Warning: Setting a new default format with a different version or profile after the global shared context is created may cause issues with context sharing.
- OpenGL ES 3 does not have mandatory support for GL_BGRA, but the extension GL_EXT_texture_format_BGRA8888 supports it and it is present in ANGLE. Fallback for OpenGL ES implementations without GL_EXT_texture_format_BGRA8888 is to use RGBA8 with texture swizzle mask to swap the red and blue channels.
- The checkerboard falls back to GL_RGBA instead. Since it should be grayscale it shouldn't matter. Correct me if I am wrong.
- I haven't tried to look for 16-bit integer support in OpenGL ES 3 or ANGLE so I'm using 8-bit integer instead. Might need to fix this to support 10-bit display...
- I assumed the texture formats I used will map to D3D11 texture formats directly so there shouldn't be any conversion done by ANGLE, but I'm only certain on this with BGRA.
- If I'm reading correctly, LoD is enabled. I think OpenGL ES 3 does support LoD.
- Looks like KisOpenGL::hasOpenGL3() would return false. I haven't checked if this does any weird things.
OpenGL ES 3 does not support glLogicOp, so the cursor outline is going green again :(I changed the cursor to use a certain blend mode so it shows up better than no blend mode at all.