(int pass)
| 244 | } |
| 245 | |
| 246 | @Override |
| 247 | public boolean perform(int pass) { |
| 248 | |
| 249 | Log.log("graphics.trace", () -> " perform pass :" + this + " / " + pass); |
| 250 | |
| 251 | if (pass == 0) { |
| 252 | Integer va = GraphicsContext.get(this); |
| 253 | if (va == null) { |
| 254 | va = glGenVertexArrays(); |
| 255 | GraphicsContext.put(this, va); |
| 256 | Integer finalVa1 = va; |
| 257 | Log.log("graphics.trace", () -> " allocated new VA name for this " + finalVa1); |
| 258 | } |
| 259 | |
| 260 | final Integer finalVa = va; |
| 261 | Log.log("graphics.trace", () -> " va name is " + finalVa); |
| 262 | glBindVertexArray(va); |
| 263 | |
| 264 | boolean work = false; |
| 265 | |
| 266 | trimElementLimit(); |
| 267 | trimVertexLimit(); |
| 268 | |
| 269 | if (elements != null) work |= elements.clean(limitElement); |
| 270 | |
| 271 | LinkedHashSet<Integer> notSeen = new LinkedHashSet<>(); |
| 272 | notSeen.addAll(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)); |
| 273 | |
| 274 | for (ArrayBuffer b : buffers) |
| 275 | if (b != null) { |
| 276 | work |= b.clean(limitVertex); |
| 277 | notSeen.remove(b.getAttribute()); |
| 278 | } |
| 279 | |
| 280 | if (work) { |
| 281 | for (ArrayBuffer b : buffers) |
| 282 | if (b != null) glEnableVertexAttribArray(b.getAttribute()); |
| 283 | |
| 284 | for (Integer i : notSeen) |
| 285 | glDisableVertexAttribArray(i); |
| 286 | } |
| 287 | |
| 288 | super.update(0, this::performNow); |
| 289 | |
| 290 | glBindVertexArray(0); |
| 291 | } |
| 292 | return true; |
| 293 | } |
| 294 | |
| 295 | protected boolean performNow() { |
| 296 | return true; |
nothing calls this directly
no test coverage detected