Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ D3d12infoGUI

D3d12infoGUI is a GUI for [D3d12info](https://github.com/sawickiap/D3d12info) and a GPU hardware database

You can submit new reports to the databse via GUI, or browse existing entries on the [database website](https://d3d12infodb.boolka.dev/)
You can submit new reports to the database via GUI, or browse existing entries on the [database website](https://d3d12infodb.boolka.dev/)

# GUI Usage

Expand All @@ -23,6 +23,8 @@ After opening report, you will be able to submit your generated report to the [d

After submitting report (or in case database already has matching report), you have an option to open said report online. You can then share link to that report to be viewed on another computer.

You can also force disable submission to an online database by setting "D3D12INFOGUI_DISABLE_SUBMISSIONS" to "1". That ensures that you can't accidentally submit to the database.

# Command line options

```
Expand Down Expand Up @@ -58,8 +60,8 @@ cmake --build build -j
```
After build, artifacts will be in the `build/bin/{Configuration}` folder

By default D3d12info will be built from sources and embedded in GUI
You can configure this behaviour via following Cmake parameters:
By default, D3d12info will be built from sources and embedded in GUI
You can configure this behavior via following Cmake parameters:

* EMBED_D3D12INFO = <ON/OFF>
* Whether to embed D3d12info or run D3d12info located in the working directory
Expand All @@ -68,7 +70,7 @@ You can configure this behaviour via following Cmake parameters:
* D3D12INFO_PATH
* Specifies custom path to D3d12info binaries to embed
* Only has effect when EMBED_D3D12INFO=ON
* If it's non empty string, D3d12info build may be skipped
* If it's non-empty string, D3d12info build may be skipped
* Empty string by default

If you are building D3d12info as part of D3d12infoGUI build, make sure to check [D3d12info build instructions](https://github.com/sawickiap/D3d12info?tab=readme-ov-file#building)
Expand All @@ -77,7 +79,7 @@ If you are building D3d12info as part of D3d12infoGUI build, make sure to check

To run database you need to host contents of `source/website` as a static website

Database service is hosted separately from the website, and doesn't neccecarilly need to run on same machine
Database service is hosted separately from the website, and doesn't necessarily need to run on same machine

Note that URLs of database service and website are hardcoded in source code

Expand Down Expand Up @@ -112,4 +114,4 @@ node main.js
```
While node process is running, database service is available

It is recommended to wrap it into system service to startup/restart on error automatically (e.g. with systemd on linux)
It is recommended to wrap it into system service to startup/restart on error automatically (e.g. with systemd on Linux)
2 changes: 1 addition & 1 deletion source/GUI/html/default.js

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion source/GUI/private/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,21 @@ int RunGUI(HINSTANCE hInstance)
std::wstring d3d12infoPreviewCmdLine =
std::format(L"\"{}\" --OutputFile=\"{}\" --JSON --MinimizeJson --Formats --EnableExperimental=ON",
d3d12infoPreviewPath.wstring(), d3d12infoPreviewReport.wstring());

std::filesystem::path warpDLLDestPath = rootPath / "d3d10warp.dll";

if(g_CustomWarpPath.empty())
{
d3d12infoCmdLine += L" --AllAdapters";
d3d12infoPreviewCmdLine += L" --AllAdapters";
std::error_code errorCode;
std::filesystem::remove(warpDLLDestPath, errorCode);
// Ignoring error code, cause file may not exist
}
else
{
std::filesystem::copy_file(g_CustomWarpPath, rootPath / "d3d10warp.dll", std::filesystem::copy_options::overwrite_existing);
std::filesystem::copy_file(
g_CustomWarpPath, warpDLLDestPath, std::filesystem::copy_options::overwrite_existing);
d3d12infoCmdLine += L" --WARP";
d3d12infoPreviewCmdLine += L" --WARP";
}
Expand Down Expand Up @@ -92,8 +99,11 @@ int RunGUI(HINSTANCE hInstance)

window.ReportProgress(L"Generating report");

const char* disableSubmissionEnv = std::getenv("D3D12INFOGUI_DISABLE_SUBMISSIONS");

OpenOptions options{};
options.AutoSubmit = g_AutoSubmit;
options.DisableSubmit = disableSubmissionEnv != nullptr && disableSubmissionEnv == std::string("1");

ReportGenerator::GenerateHTML(rootPath, validReports, options);
if(window.IsExitRequested())
Expand Down
3 changes: 2 additions & 1 deletion source/GUI/private/report_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ namespace D3d12infoGUI
throw std::runtime_error("Failed to open output file");
}

dataFile << std::format("const openOptions = {{autoSubmit: {}}}\n", options.AutoSubmit);
dataFile << std::format(
"const openOptions = {{autoSubmit: {}, disableSubmit: {}}}\n", options.AutoSubmit, options.DisableSubmit);

dataFile << "const reports = [";
bool isFirst = true;
Expand Down
1 change: 1 addition & 0 deletions source/GUI/private/report_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace D3d12infoGUI
struct OpenOptions
{
bool AutoSubmit = false;
bool DisableSubmit = false;
};

class ReportGenerator
Expand Down
2 changes: 1 addition & 1 deletion source/frontend/assets/html_gui/data.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const openOptions = { autoSubmit: false }
const openOptions = { autoSubmit: false, disableSubmit: true }
const reports = [
{
"Header": {
Expand Down
28 changes: 26 additions & 2 deletions source/frontend/assets/js/gui.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function AddSubmitAllButton(tableBody, tableWidth) {
SubmitAllReports()
};

const buttonText = document.createTextNode("Submit all reports to online database")
const buttonText = document.createTextNode(openOptions.disableSubmit ? "Submissions disabled" : "Submit all reports to online database")
submitButton.appendChild(buttonText)

let tooltipIcon = document.createElement("img")
Expand All @@ -102,7 +102,7 @@ function AddSubmitAllButton(tableBody, tableWidth) {
const tooltipText = document.createElement("div")
tooltipText.classList.add("gui-tooltiptext")
tooltipText.style = "width: 25vw;left: 50%;transform: translateX(-50%)"
tooltipText.textContent = "Allows other users to see capabilities of your GPU and sharing of your reports via link to the online database. Those reports don't contain any personal information, you can see full contents of those reports on this page before submitting."
tooltipText.textContent = openOptions.disableSubmit ? 'Submissions are force disabled via "D3D12INFOGUI_DISABLE_SUBMISSIONS" environment variable\nIf you want to submit re-run D3d12infoGUI with that environment varible unset' : "Allows other users to see capabilities of your GPU and sharing of your reports via link to the online database. Those reports don't contain any personal information, you can see full contents of those reports on this page before submitting."
submitButton.appendChild(tooltipText)

cell.appendChild(submitButton)
Expand Down Expand Up @@ -181,6 +181,25 @@ function UpdateList() {
cell.appendChild(cellText)
break;
}
case -3:
{
let cellDiv = document.createElement("div")
cellDiv.classList.add("gui-tooltip")
let cellText = document.createTextNode("Submissions disabled")
cellDiv.appendChild(cellText)
let tooltipIcon = document.createElement("img")
tooltipIcon.classList.add("tooltipicon")
tooltipIcon.style = "filter: brightness(1.5);"
tooltipIcon.src = "info.svg"
cellDiv.appendChild(tooltipIcon)
const tooltipText = document.createElement("div")
tooltipText.classList.add("gui-tooltiptext")
tooltipText.style = "width: 20vw;left: 100%;transform: translateX(-100%)"
tooltipText.textContent = 'Submissions are force disabled via "D3D12INFOGUI_DISABLE_SUBMISSIONS" environment variable\nIf you want to submit re-run D3d12infoGUI with that environment varible unset'
cellDiv.appendChild(tooltipText)
cell.appendChild(cellDiv)
break;
}
default:
{
let link = document.createElement("a")
Expand Down Expand Up @@ -280,6 +299,11 @@ function QueryReportIDs() {
IterateAdapters(() => {++adapterCount});
let responseCount = 0;
IterateAdapters((retailIndex, index, adapter) => {
if (openOptions.disableSubmit)
{
SubmissionIDs[retailIndex][index] = -3; // Mark submissions disabled
return;
}
SubmissionIDs[retailIndex][index] = null;
Server.IsSubmitted(Headers[retailIndex], adapter, (ID) => {
SubmissionIDs[retailIndex][index] = ID;
Expand Down
Loading