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

Move post processing settings to the Display Layout Editor #16417

Merged
merged 5 commits into from
Nov 23, 2022
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
13 changes: 9 additions & 4 deletions GPU/Common/FramebufferManagerCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,15 @@ bool FramebufferManagerCommon::UpdateRenderSize() {
return newRender || newSettings;
}

void FramebufferManagerCommon::BeginFrame() {
DecimateFBOs();

// Might have a new post shader - let's compile it.
void FramebufferManagerCommon::CheckPostShaders() {
if (updatePostShaders_) {
presentation_->UpdatePostShader();
updatePostShaders_ = false;
}
}

void FramebufferManagerCommon::BeginFrame() {
DecimateFBOs();

currentRenderVfb_ = nullptr;
}
Expand Down Expand Up @@ -2382,6 +2383,10 @@ void FramebufferManagerCommon::NotifyRenderResized() {
#endif
}

void FramebufferManagerCommon::NotifyConfigChanged() {
updatePostShaders_ = true;
}

void FramebufferManagerCommon::DestroyAllFBOs() {
currentRenderVfb_ = nullptr;
displayFramebuf_ = nullptr;
Expand Down
5 changes: 4 additions & 1 deletion GPU/Common/FramebufferManagerCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,11 @@ class FramebufferManagerCommon {
}
void SetSafeSize(u16 w, u16 h);

virtual void NotifyRenderResized();
void NotifyRenderResized();
virtual void NotifyDisplayResized();
void NotifyConfigChanged();

void CheckPostShaders();

virtual void DestroyAllFBOs();

Expand Down
7 changes: 6 additions & 1 deletion GPU/GPUCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,11 +633,16 @@ void GPUCommon::CheckConfigChanged() {
if (configChanged_) {
gstate_c.useFlags = CheckGPUFeatures();
drawEngineCommon_->NotifyConfigChanged();
shaderManager_->DirtyLastShader(); // Don't think this is needed, at all.
textureCache_->NotifyConfigChanged();
framebufferManager_->NotifyConfigChanged();
BuildReportingInfo();
configChanged_ = false;
}

// Check needed when running tests.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, it's really that the software renderer has no, and has no need for a, framebuffer manager. It's not just tests. Probably several of these things crash now when using the software renderer, since it wasn't in common before.

-[Unknown]

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, it's fine because NotifyConfigChanged() does nothing on softgpu.

-[Unknown]

if (framebufferManager_) {
framebufferManager_->CheckPostShaders();
}
}

void GPUCommon::CheckDisplayResized() {
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class GPUCommon : public GPUInterface, public GPUDebugInterface {
virtual u32 CheckGPUFeatures() const;

void CheckDisplayResized() override;
void CheckConfigChanged() override;

void UpdateCmdInfo();

Expand Down Expand Up @@ -266,7 +267,6 @@ class GPUCommon : public GPUInterface, public GPUDebugInterface {
void DeviceLost() override;
void DeviceRestore() override;

void CheckConfigChanged();
void CheckRenderResized();

// Add additional common features dependent on other features, which may be backend-determined.
Expand Down
1 change: 1 addition & 0 deletions GPU/GPUInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ class GPUInterface {
virtual void EndHostFrame() = 0;

virtual void CheckDisplayResized() = 0;
virtual void CheckConfigChanged() = 0;

// Draw queue management
virtual DisplayList* getList(int listid) = 0;
Expand Down
4 changes: 2 additions & 2 deletions UI/ComboKeyMappingScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ namespace UI {
class CheckBox;
}

class ComboKeyScreen : public UIDialogScreenWithBackground {
class ComboKeyScreen : public UIDialogScreenWithGameBackground {
public:
ComboKeyScreen(int id): id_(id) {}
ComboKeyScreen(const Path &gamePath, int id) : UIDialogScreenWithGameBackground(gamePath), id_(id) {}

const char *tag() const override { return "ComboKey"; }

Expand Down
12 changes: 6 additions & 6 deletions UI/ControlMappingScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ void ControlMappingScreen::update() {
RecreateViews();
}

UIDialogScreenWithBackground::update();
UIDialogScreenWithGameBackground::update();
SetVRAppMode(VRAppMode::VR_MENU_MODE);
}

Expand Down Expand Up @@ -309,7 +309,7 @@ UI::EventReturn ControlMappingScreen::OnAutoConfigure(UI::EventParams &params) {
}

UI::EventReturn ControlMappingScreen::OnVisualizeMapping(UI::EventParams &params) {
VisualMappingScreen *visualMapping = new VisualMappingScreen();
VisualMappingScreen *visualMapping = new VisualMappingScreen(gamePath_);
screenManager()->push(visualMapping);
return UI::EVENT_DONE;
}
Expand Down Expand Up @@ -581,7 +581,7 @@ void JoystickHistoryView::Update() {
}
}

AnalogSetupScreen::AnalogSetupScreen() {
AnalogSetupScreen::AnalogSetupScreen(const Path &gamePath) : UIDialogScreenWithGameBackground(gamePath) {
mapper_.SetCallbacks([](int vkey) {}, [](int vkey) {}, [&](int stick, float x, float y) {
analogX_[stick] = x;
analogY_[stick] = y;
Expand Down Expand Up @@ -673,7 +673,7 @@ UI::EventReturn AnalogSetupScreen::OnResetToDefaults(UI::EventParams &e) {
}

bool TouchTestScreen::touch(const TouchInput &touch) {
UIDialogScreenWithBackground::touch(touch);
UIDialogScreenWithGameBackground::touch(touch);
if (touch.flags & TOUCH_DOWN) {
bool found = false;
for (int i = 0; i < MAX_TOUCH_POINTS; i++) {
Expand Down Expand Up @@ -802,7 +802,7 @@ bool TouchTestScreen::axis(const AxisInput &axis) {
}

void TouchTestScreen::render() {
UIDialogScreenWithBackground::render();
UIDialogScreenWithGameBackground::render();
UIContext *ui_context = screenManager()->getUIContext();
Bounds bounds = ui_context->GetLayoutBounds();

Expand Down Expand Up @@ -1161,7 +1161,7 @@ void VisualMappingScreen::CreateViews() {
}

void VisualMappingScreen::resized() {
UIDialogScreenWithBackground::resized();
UIDialogScreenWithGameBackground::resized();
RecreateViews();
}

Expand Down
18 changes: 9 additions & 9 deletions UI/ControlMappingScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

class SingleControlMapper;

class ControlMappingScreen : public UIDialogScreenWithBackground {
class ControlMappingScreen : public UIDialogScreenWithGameBackground {
public:
ControlMappingScreen() {}
ControlMappingScreen(const Path &gamePath) : UIDialogScreenWithGameBackground(gamePath) {}
const char *tag() const override { return "ControlMapping"; }

protected:
Expand Down Expand Up @@ -84,7 +84,7 @@ class KeyMappingNewKeyDialog : public PopupScreen {

class KeyMappingNewMouseKeyDialog : public PopupScreen {
public:
explicit KeyMappingNewMouseKeyDialog(int btn, bool replace, std::function<void(KeyDef)> callback, std::shared_ptr<I18NCategory> i18n)
KeyMappingNewMouseKeyDialog(int btn, bool replace, std::function<void(KeyDef)> callback, std::shared_ptr<I18NCategory> i18n)
: PopupScreen(i18n->T("Map Mouse"), "", ""), callback_(callback), mapped_(false) {
pspBtn_ = btn;
}
Expand All @@ -109,9 +109,9 @@ class KeyMappingNewMouseKeyDialog : public PopupScreen {

class JoystickHistoryView;

class AnalogSetupScreen : public UIDialogScreenWithBackground {
class AnalogSetupScreen : public UIDialogScreenWithGameBackground {
public:
AnalogSetupScreen();
AnalogSetupScreen(const Path &gamePath);

bool key(const KeyInput &key) override;
bool axis(const AxisInput &axis) override;
Expand All @@ -136,9 +136,9 @@ class AnalogSetupScreen : public UIDialogScreenWithBackground {
JoystickHistoryView *stickView_[2]{};
};

class TouchTestScreen : public UIDialogScreenWithBackground {
class TouchTestScreen : public UIDialogScreenWithGameBackground {
public:
TouchTestScreen() {
TouchTestScreen(const Path &gamePath) : UIDialogScreenWithGameBackground(gamePath) {
for (int i = 0; i < MAX_TOUCH_POINTS; i++) {
touches_[i].id = -1;
}
Expand Down Expand Up @@ -175,9 +175,9 @@ class TouchTestScreen : public UIDialogScreenWithBackground {

class MockPSP;

class VisualMappingScreen : public UIDialogScreenWithBackground {
class VisualMappingScreen : public UIDialogScreenWithGameBackground {
public:
VisualMappingScreen() {}
VisualMappingScreen(const Path &gamePath) : UIDialogScreenWithGameBackground(gamePath) {}

const char *tag() const override { return "VisualMapping"; }

Expand Down
5 changes: 2 additions & 3 deletions UI/CwCheatScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
static const int FILE_CHECK_FRAME_INTERVAL = 53;

CwCheatScreen::CwCheatScreen(const Path &gamePath)
: UIDialogScreenWithBackground() {
gamePath_ = gamePath;
: UIDialogScreenWithGameBackground(gamePath) {
}

CwCheatScreen::~CwCheatScreen() {
Expand Down Expand Up @@ -129,7 +128,7 @@ void CwCheatScreen::update() {
fileCheckCounter_ = 0;
}

UIDialogScreenWithBackground::update();
UIDialogScreenWithGameBackground::update();
}

void CwCheatScreen::onFinish(DialogResult result) {
Expand Down
3 changes: 1 addition & 2 deletions UI/CwCheatScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
struct CheatFileInfo;
class CWCheatEngine;

class CwCheatScreen : public UIDialogScreenWithBackground {
class CwCheatScreen : public UIDialogScreenWithGameBackground {
public:
CwCheatScreen(const Path &gamePath);
~CwCheatScreen();
Expand Down Expand Up @@ -56,7 +56,6 @@ class CwCheatScreen : public UIDialogScreenWithBackground {
UI::ScrollView *rightScroll_ = nullptr;
CWCheatEngine *engine_ = nullptr;
std::vector<CheatFileInfo> fileInfo_;
Path gamePath_;
std::string gameID_;
int fileCheckCounter_ = 0;
uint64_t fileCheckHash_;
Expand Down
2 changes: 1 addition & 1 deletion UI/DevScreens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ UI::EventReturn DevMenuScreen::OnLogConfig(UI::EventParams &e) {

UI::EventReturn DevMenuScreen::OnDeveloperTools(UI::EventParams &e) {
UpdateUIState(UISTATE_PAUSEMENU);
screenManager()->push(new DeveloperToolsScreen());
screenManager()->push(new DeveloperToolsScreen(gamePath_));
return UI::EVENT_DONE;
}

Expand Down
5 changes: 4 additions & 1 deletion UI/DevScreens.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

class DevMenuScreen : public PopupScreen {
public:
DevMenuScreen(std::shared_ptr<I18NCategory> i18n) : PopupScreen(i18n->T("Dev Tools")) {}
DevMenuScreen(const Path &gamePath, std::shared_ptr<I18NCategory> i18n) : PopupScreen(i18n->T("Dev Tools")), gamePath_(gamePath) {}

const char *tag() const override { return "DevMenu"; }

Expand All @@ -47,6 +47,9 @@ class DevMenuScreen : public PopupScreen {
UI::EventReturn OnDeveloperTools(UI::EventParams &e);
UI::EventReturn OnToggleAudioDebug(UI::EventParams &e);
UI::EventReturn OnResetLimitedLogging(UI::EventParams &e);

private:
Path gamePath_;
};

class JitDebugScreen : public UIDialogScreenWithBackground {
Expand Down
Loading