Commit d80d5e0
committed
EGLBE: Restore buf state when binding default FB
This is very subtle, but glBindFramebuffer(..., 0) should restore the
current context's previous draw/read buffer state for the default
framebuffer, as glXMake*Current() does. Swapping the buffers of a GLX
drawable causes the EGL back end to create a new FBO to serve as the
drawable's default framebuffer, with the new FBO containing the previous
RBOs bound in reverse order. The default draw/read buffer for a new FBO
is GL_COLOR_ATTACHMENT0, which the EGL back end uses as the front left
buffer. Thus, if the default framebuffer for a drawable isn't bound
when the drawable's buffers are swapped, then the FBO's initial
draw/read buffer remains unchanged. If GL_BACK was active the last time
the default framebuffer was bound, then calling
glBindFrameBuffer(..., 0) after a buffer swap put VirtualGL into a weird
state whereby it reported that GL_BACK was active, but the RBO
corresponding to GL_FRONT was actually active. This issue caused Webots
to flicker when rendering a camera view, and it may have affected other
applications as well.
Fixes #1721 parent 5b2c1e8 commit d80d5e0
3 files changed
Lines changed: 61 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
82 | | - | |
83 | | - | |
| 86 | + | |
| 87 | + | |
84 | 88 | | |
85 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
91 | | - | |
92 | | - | |
| 97 | + | |
| 98 | + | |
93 | 99 | | |
94 | | - | |
| 100 | + | |
| 101 | + | |
95 | 102 | | |
96 | 103 | | |
97 | 104 | | |
| |||
107 | 114 | | |
108 | 115 | | |
109 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
110 | 131 | | |
111 | 132 | | |
112 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
994 | 994 | | |
995 | 995 | | |
996 | 996 | | |
997 | | - | |
998 | | - | |
999 | 997 | | |
1000 | 998 | | |
| 999 | + | |
| 1000 | + | |
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
| |||
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
1020 | 1039 | | |
1021 | | - | |
1022 | | - | |
1023 | 1040 | | |
1024 | 1041 | | |
1025 | 1042 | | |
| |||
2044 | 2061 | | |
2045 | 2062 | | |
2046 | 2063 | | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
2047 | 2071 | | |
2048 | 2072 | | |
2049 | 2073 | | |
| |||
0 commit comments