|
83 | 83 | public class WebUi extends HttpServlet {
|
84 | 84 |
|
85 | 85 | private StringBuilder html;
|
86 |
| - private String deqpRoot = "/path/to/deqp"; // |
87 | 86 | private long startTime;
|
88 | 87 | private final AccessFileInfo accessFileInfo = new AccessFileInfo();
|
89 | 88 |
|
@@ -337,8 +336,6 @@ private void homepage(HttpServletRequest request, HttpServletResponse response)
|
337 | 336 | "generated token): ', '/static/runner.html?context=webgl2&token=', '',",
|
338 | 337 | "'/static/runner.htmlcontext=webgl2', true);\">",
|
339 | 338 | "Launch WebGL2 worker</div>\n",
|
340 |
| - "<a class='ui button' href='/webui/settings'>", |
341 |
| - "<i class=\"icon setting\"></i>Settings</a>\n", |
342 | 339 | "</p>\n",
|
343 | 340 | "</div>\n");
|
344 | 341 |
|
@@ -771,15 +768,6 @@ private void viewShader(HttpServletRequest request, HttpServletResponse response
|
771 | 768 |
|
772 | 769 | htmlAppendLn("<div class='ui segment'><h3>Shader: ", shaderName, "</h3>");
|
773 | 770 |
|
774 |
| - if (shaderName.contains("_reduced_final")) { |
775 |
| - htmlAppendLn("<form class='ui form' action='/webui/deqpExport' method='post'>", |
776 |
| - "<input type='hidden' name='type' value='deqpExport'>", |
777 |
| - "<input type='hidden' name='path' value='", shaderPath.toString(), "'>", |
778 |
| - "<p>This is a reduced shader: ", |
779 |
| - "<input type='submit' value='Export to dEQP'>", |
780 |
| - "</p></form>"); |
781 |
| - } |
782 |
| - |
783 | 771 | htmlAppendLn("<a class='ui button' href='/webui/run/", shaderPath.toString(),
|
784 | 772 | "'>Run shader</a>");
|
785 | 773 |
|
@@ -1673,106 +1661,6 @@ private void file(HttpServletRequest request, HttpServletResponse response)
|
1673 | 1661 | outputStream.write(Files.readAllBytes(Paths.get(filename)));
|
1674 | 1662 | }
|
1675 | 1663 |
|
1676 |
| - private void settings(HttpServletRequest request, HttpServletResponse response) |
1677 |
| - throws ServletException, IOException { |
1678 |
| - |
1679 |
| - response.setContentType("text/html"); |
1680 |
| - htmlHeader("Settings"); |
1681 |
| - |
1682 |
| - final String newDeqpRoot = request.getParameter("deqp_root"); |
1683 |
| - if (newDeqpRoot != null) { |
1684 |
| - deqpRoot = newDeqpRoot; |
1685 |
| - } |
1686 |
| - |
1687 |
| - htmlAppendLn("<div class='ui segment'> <h3>Settings</h3>"); |
1688 |
| - |
1689 |
| - html.append("<p>Current dEQP directory: <em>"); |
1690 |
| - if (deqpRoot.isEmpty()) { |
1691 |
| - html.append("UNSET"); |
1692 |
| - } else { |
1693 |
| - html.append(deqpRoot); |
1694 |
| - } |
1695 |
| - html.append("</em>"); |
1696 |
| - if (!(new File(deqpRoot).isDirectory())) { |
1697 |
| - html.append("<b>This path is not a directory!</b>"); |
1698 |
| - } |
1699 |
| - html.append("</p>\n"); |
1700 |
| - |
1701 |
| - htmlAppendLn("<form action='/webui/settings' class='ui form'>", |
1702 |
| - "<div class='inline field'>", |
1703 |
| - "<label>New dEQP directory:</label>", |
1704 |
| - "<input type='text' name='deqp_root' placeholder='/path/to/deqp'>", |
1705 |
| - "<button class='ui button' type='submit'>Update</button>", |
1706 |
| - "</div></form>"); |
1707 |
| - |
1708 |
| - htmlAppendLn("</div>"); |
1709 |
| - htmlFooter(); |
1710 |
| - response.getWriter().println(html); |
1711 |
| - } |
1712 |
| - |
1713 |
| - private void deqpExport(HttpServletRequest request, HttpServletResponse response) |
1714 |
| - throws ServletException, IOException { |
1715 |
| - response.setContentType("text/html"); |
1716 |
| - |
1717 |
| - htmlHeader("Export to dEQP"); |
1718 |
| - |
1719 |
| - htmlAppendLn("<div class='ui segment'>\n", |
1720 |
| - "<h3>Export shader to dEQP</h3>"); |
1721 |
| - |
1722 |
| - File graphicsFuzzRoot = new File(deqpRoot + "/external/graphicsfuzz"); |
1723 |
| - if (!graphicsFuzzRoot.isDirectory()) { |
1724 |
| - err404(request, response, |
1725 |
| - "Cannot find GraphicsFuzz directory under dEQP root: " |
1726 |
| - + graphicsFuzzRoot.toString() |
1727 |
| - + "\nYou can update dEQP root value in settings from homepage."); |
1728 |
| - return; |
1729 |
| - } |
1730 |
| - |
1731 |
| - String path = request.getParameter("path"); |
1732 |
| - if (path == null) { |
1733 |
| - err404(request, response, "No 'path' parameter in request"); |
1734 |
| - return; |
1735 |
| - } |
1736 |
| - |
1737 |
| - String[] files = path.split("/"); |
1738 |
| - assert (files[0].equals("processing")); |
1739 |
| - String device = files[1]; |
1740 |
| - String shadersetInv = files[2]; |
1741 |
| - int pos = shadersetInv.indexOf("_variant_"); |
1742 |
| - String shaderset = shadersetInv.substring(0, pos); |
1743 |
| - |
1744 |
| - String variantFrag = files[3]; |
1745 |
| - String variantJson = variantFrag.replace(".frag", ".json"); |
1746 |
| - |
1747 |
| - html.append("<pre>\n"); |
1748 |
| - html.append("Shaderset: " + shaderset + "\n"); |
1749 |
| - html.append("variant_frag: " + variantFrag + "\n"); |
1750 |
| - html.append("variant_json: " + variantJson + "\n"); |
1751 |
| - html.append("</pre>\n"); |
1752 |
| - |
1753 |
| - Path varFragPath = Paths.get("processing/" + device + "/" + shadersetInv + "/" + variantFrag); |
1754 |
| - Path varJsonPath = Paths.get("processing/" + device + "/" + shadersetInv + "/" + variantJson); |
1755 |
| - Path dest = Paths.get(graphicsFuzzRoot.toString() + "/gles3/" + shaderset + "/variants"); |
1756 |
| - if (!(dest.toFile().isDirectory())) { |
1757 |
| - Files.createDirectories(dest); |
1758 |
| - } |
1759 |
| - Path destFrag = Paths.get(dest.toString() + "/" + variantFrag); |
1760 |
| - Path destJson = Paths.get(dest.toString() + "/" + variantJson); |
1761 |
| - |
1762 |
| - Files.copy(varFragPath, destFrag, StandardCopyOption.REPLACE_EXISTING); |
1763 |
| - Files.copy(varJsonPath, destJson, StandardCopyOption.REPLACE_EXISTING); |
1764 |
| - |
1765 |
| - html.append("<p>Shader copied to: " + destFrag.toString() + "</p>"); |
1766 |
| - |
1767 |
| - html.append("<p><b>Make sure to run the update script in dEQP, and to" |
1768 |
| - + " recompile dEQP to see the new reduced variant appear.</b></p>"); |
1769 |
| - |
1770 |
| - |
1771 |
| - htmlAppendLn("</div>"); |
1772 |
| - htmlFooter(); |
1773 |
| - response.getWriter().println(html); |
1774 |
| - } |
1775 |
| - |
1776 | 1664 | // ========================= "GET" requests dispatcher =======================================
|
1777 | 1665 |
|
1778 | 1666 | public void doGet(HttpServletRequest request, HttpServletResponse response)
|
@@ -1814,8 +1702,6 @@ public void doGet(HttpServletRequest request, HttpServletResponse response)
|
1814 | 1702 | startRunShader(request, response);
|
1815 | 1703 | } else if (actions[1].equals("compare")) {
|
1816 | 1704 | compareWorkers(request, response);
|
1817 |
| - } else if (actions[1].equals("settings")) { |
1818 |
| - settings(request, response); |
1819 | 1705 | } else {
|
1820 | 1706 | // if no action match, serve from resources/public
|
1821 | 1707 | resource(request, response);
|
@@ -1859,8 +1745,6 @@ public void doPost(HttpServletRequest request, HttpServletResponse response)
|
1859 | 1745 | compareResults(request, response);
|
1860 | 1746 | } else if (type.equals("experiment")) {
|
1861 | 1747 | startExperiment(request, response);
|
1862 |
| - } else if (type.equals("deqpExport")) { |
1863 |
| - deqpExport(request, response); |
1864 | 1748 | }
|
1865 | 1749 | } catch (Exception exception) {
|
1866 | 1750 | exception.printStackTrace();
|
|
0 commit comments