Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QT Frontend: Add disk shader loading progress bar #5071

Merged
merged 2 commits into from Jan 23, 2020

Conversation

jroweboy
Copy link
Contributor

@jroweboy jroweboy commented Jan 22, 2020

Until we get a on screen display or async shader loading, we should at
least have some measure of progress in the meantime. This is 90% a port
from the loading screen I made for yuzu, but with a slightly different
changed detection for when to display the ETA. Now we keep track of a
rolling estimate for shader load ETA and only display a ETA if its going
to take longer than 10 seconds.

The gif might cut out, but whatever. It already works fine in yuzu and I tested it pretty well here too https://i.imgur.com/enHMyqS.gifv


This change is Reviewable

@jroweboy
Copy link
Contributor Author

jroweboy commented Jan 22, 2020

Planning on merging this quickly since its a port PR and its actively become the number one support request since i merged disk shader caching. I was seriously hoping to have the on screen display or async shader loading done by now, but we need something to hold us over until then.

Copy link
Member

@zhaowenlan1779 zhaowenlan1779 left a comment

Overall LGTM!

// TODO when banner becomes supported, decode it and add it as a movie
buffer.clear();
}
if (loader.ReadLogo(buffer) == Loader::ResultStatus::Success) {
Copy link
Member

@zhaowenlan1779 zhaowenlan1779 Jan 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think logo is a pixmap here, and I don't think it is very easy to actually show it.
It might be easier to read the SMDH and show the icon, if something is to be displayed there...

src/citra_qt/loading_screen.cpp Show resolved Hide resolved
src/citra_qt/loading_screen.h Outdated Show resolved Hide resolved
src/citra_qt/loading_screen.h Outdated Show resolved Hide resolved

// Definitions for the differences in text and styling for each stage
std::unordered_map<VideoCore::LoadCallbackStage, const char*> progressbar_style;
std::unordered_map<VideoCore::LoadCallbackStage, QString> stage_translations;
Copy link
Member

@zhaowenlan1779 zhaowenlan1779 Jan 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of class members, these should really just be static constants.

Copy link
Contributor Author

@jroweboy jroweboy Jan 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't make them const because .arg and tr() but I moved them to be static file vars instead

Copy link
Member

@zhaowenlan1779 zhaowenlan1779 Jan 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how you can't make them const, you don't modify them anyway.

src/citra_qt/loading_screen.h Outdated Show resolved Hide resolved
@jroweboy
Copy link
Contributor Author

jroweboy commented Jan 22, 2020

@jroweboy
Copy link
Contributor Author

jroweboy commented Jan 22, 2020

Changed up the loading screen a bit to add an icon and the title of the game https://i.imgur.com/VIVI3au.png

@jroweboy
Copy link
Contributor Author

jroweboy commented Jan 22, 2020

Planning on merging this in maybe 12 or so hours. Normally I'd let it marinate for a bit more, but its quickly become our number one support request, so I'd like to get it into nightly soon.

const auto now = high_resolution_clock::now();
// reset the timer if the stage changes
if (stage != previous_stage) {
ui->progress_bar->setStyleSheet(tr(progressbar_style.at(stage)));
Copy link
Member

@zhaowenlan1779 zhaowenlan1779 Jan 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no point in translating the stylesheet (and they weren't marked as translatable anyway)

Copy link
Contributor Author

@jroweboy jroweboy Jan 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops how'd that get there. fixed good catch.

jroweboy added 2 commits Jan 23, 2020
Until we get a on screen display or async shader loading, we should at
least have some measure of progress in the meantime. This is 90% a port
from the loading screen I made for yuzu, but with a slightly different
changed detection for when to display the ETA. Now we keep track of a
rolling estimate for shader load ETA and only display a ETA if its going
to take longer than 10 seconds.
@jroweboy jroweboy merged commit f3e6c4f into citra-emu:master Jan 23, 2020
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants