()
| 242 | this.onError = onError; |
| 243 | return this; |
| 244 | } |
| 245 | |
| 246 | protected boolean perform0() { |
| 247 | boolean work = false; |
| 248 | |
| 249 | GraphicsContext.checkError(() -> "on shader entry"); |
| 250 | |
| 251 | Log.log("graphics.trace", () -> " checking :" + source.keySet()); |
| 252 | |
| 253 | |
| 254 | for (Map.Entry<Type, Source> s : source.entrySet()) { |
| 255 | work |= s.getValue() |
| 256 | .clean(); |
| 257 | } |
| 258 | |
| 259 | State name = GraphicsContext.get(this); |
| 260 | |
| 261 | work |= name.work; |
| 262 | name.work = false; |
| 263 | |
| 264 | if (work) { |
| 265 | // System.out.println(" -- shader has work to do in stage :"+name+" in context "+GraphicsContext.getContext()); |
| 266 | |
| 267 | name.valid = true; |
| 268 | for (Map.Entry<Type, Source> s : source.entrySet()) { |
| 269 | Source.State state = GraphicsContext.get(s.getValue()); |
| 270 | if (s.getValue().status != 0 && state.name != -1 && !state.attachedTo.contains(name.name)) { |
| 271 | GL20.glAttachShader(name.name, state.name); |
| 272 | state.attachedTo.add(name.name); |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | if (!source.containsKey(Type.compute)) { |
| 277 | GL30.glBindFragDataLocation(name.name, 0, "_output"); |
| 278 | GL30.glBindFragDataLocation(name.name, 0, "_output0"); |
| 279 | GL30.glBindFragDataLocation(name.name, 1, "_output1"); |
| 280 | GL30.glBindFragDataLocation(name.name, 2, "_output2"); |
| 281 | GL30.glBindFragDataLocation(name.name, 3, "_output3"); |
| 282 | |
| 283 | for (int i = 1; i < 16; i++) |
| 284 | glBindAttribLocation(name.name, i, "attribute" + i); |
| 285 | } |
| 286 | |
| 287 | GraphicsContext.checkError(() -> "before link and validate"); |
| 288 | name.valid = linkAndValidateNow(name.name); |
| 289 | GraphicsContext.checkError(() -> "afer link and validate"); |
| 290 | |
| 291 | if (name.valid) { |
| 292 | if (introspection == null) { |
| 293 | introspection = new ShaderIntrospection(this); |
| 294 | introspection.reloadedAt = Instant.now(); |
| 295 | } else { |
| 296 | introspection.reloadedAt = Instant.now(); |
| 297 | introspection.reloadedTimes++; |
| 298 | introspection.invocationCountSinceReload = 0; |
| 299 | } |
| 300 | |
| 301 | introspection.introspectNow(); |
nothing calls this directly
no test coverage detected