private List<String> getJobQueueAsJobInfoList(Queue<IServerJob> jobQueue) { List<String> res = new ArrayList<>(); for (IServerJob job : jobQueue) { if (job instanceof SingleJob) { SingleJob sj = (SingleJob) job; if (sj.job.isSetImageJob()) { ImageJob ij = sj.job.getImageJob(); StringBuilder infoString = new StringBuilder(); if (ij.isSetName()) { infoString.append(ij.getName()); } if (ij.isSetName()) { infoString.append(ij.getName()); infoString.append("; "); } res.add(infoString.toString()); continue; } } // otherwise: res.add(job.toString()); } return res; }
@Override public ImageJobResult getImage(ImageJob imageJob) throws ShaderDispatchException, InterruptedException { // For running shaders locally, we write the necessary files to a temp directory, // run the get_image tool, and then collect the results in an ImageJobResult. // Due to strange Thrift behaviour, we set this default value explicitly // otherwise "isSetSkipRender()" is false. if (!imageJob.isSetSkipRender()) { imageJob.setSkipRender(false); } File localTempShaderJobFile = new File( tempDir, (imageJob.getName() != null ? imageJob.getName() + ".json" : "temp.json") ); try { return fileOps.runGetImageOnImageJob(imageJob, localTempShaderJobFile, usingSwiftShader); } catch (IOException exception) { throw new ShaderDispatchException(exception); } }
} else if (res.isSetImageJob()) { logmsg.append("(name: "); logmsg.append(res.getImageJob().getName()); logmsg.append(")"); } else {
@Override public ImageJobResult getImage(ImageJob imageJob) throws ShaderDispatchException { LOGGER.info("Get image (via server) job: {}", imageJob.getName()); // Due to strange Thrift behaviour, we set this default value explicitly // otherwise "isSetSkipRender()" is false. if (!imageJob.isSetSkipRender()) { imageJob.setSkipRender(false); } // Optimisation: no need to actually use HTTP if we are on the server. if (fuzzerServiceManager != null) { try { return getImageHelper(imageJob, fuzzerServiceManager); } catch (TException exception) { throw new ShaderDispatchException(exception); } } else { try (CloseableHttpClient httpClient = HttpClients.createDefault()) { return getImageHelper(imageJob, getFuzzerServiceManagerProxy(httpClient)); } catch (IOException | TException exception) { throw new ShaderDispatchException(exception); } } }
public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NAME: return getName(); case FRAGMENT_SOURCE: return getFragmentSource(); case VERTEX_SOURCE: return getVertexSource(); case COMPUTE_SOURCE: return getComputeSource(); case UNIFORMS_INFO: return getUniformsInfo(); case COMPUTE_INFO: return getComputeInfo(); case POINTS: return getPoints(); case TEXTURE_POINTS: return getTexturePoints(); case TEXTURE_BINARY: return getTextureBinary(); case SKIP_RENDER: return isSkipRender(); case RESULT: return getResult(); } throw new java.lang.IllegalStateException(); }