Sanity checks in Vulkan backend, PSPDialog

This commit is contained in:
Henrik Rydgård
2025-05-14 00:37:49 +02:00
parent 80147f318e
commit e2bfc48886
4 changed files with 22 additions and 14 deletions
+8 -2
View File
@@ -799,6 +799,7 @@ VKRGraphicsPipeline *VulkanRenderManager::CreateGraphicsPipeline(VKRGraphicsPipe
};
VKRRenderPass *compatibleRenderPass = queueRunner_.GetRenderPass(key);
std::unique_lock<std::mutex> lock(compileQueueMutex_);
_dbg_assert_(runCompileThread_);
bool needsCompile = false;
for (size_t i = 0; i < (size_t)RenderPassType::TYPE_COUNT; i++) {
if (!(variantBitmask & (1 << i)))
@@ -820,8 +821,11 @@ VKRGraphicsPipeline *VulkanRenderManager::CreateGraphicsPipeline(VKRGraphicsPipe
sampleCount = VK_SAMPLE_COUNT_1_BIT;
}
pipeline->pipeline[i] = Promise<VkPipeline>::CreateEmpty();
compileQueue_.emplace_back(pipeline, compatibleRenderPass->Get(vulkan_, rpType, sampleCount), rpType, sampleCount);
// Sanity check
if (runCompileThread_) {
pipeline->pipeline[i] = Promise<VkPipeline>::CreateEmpty();
compileQueue_.emplace_back(pipeline, compatibleRenderPass->Get(vulkan_, rpType, sampleCount), rpType, sampleCount);
}
needsCompile = true;
}
if (needsCompile)
@@ -834,6 +838,8 @@ void VulkanRenderManager::EndCurRenderStep() {
if (!curRenderStep_)
return;
_dbg_assert_(runCompileThread_);
RPKey key{
curRenderStep_->render.colorLoad, curRenderStep_->render.depthLoad, curRenderStep_->render.stencilLoad,
curRenderStep_->render.colorStore, curRenderStep_->render.depthStore, curRenderStep_->render.stencilStore,
+7 -7
View File
@@ -259,12 +259,6 @@ void PSPDialog::DoState(PointerWrap &p) {
}
}
pspUtilityDialogCommon *PSPDialog::GetCommonParam()
{
// FIXME
return 0;
}
void PSPDialog::UpdateButtons()
{
lastButtons = __CtrlPeekButtons();
@@ -323,7 +317,13 @@ void PSPDialog::DisplayButtons(int flags, std::string_view caption) {
auto di = GetI18NCategory(I18NCat::DIALOG);
float x1 = 183.5f, x2 = 261.5f;
if (GetCommonParam()->buttonSwap == 1) {
const pspUtilityDialogCommon *commonParams = GetCommonParam();
if (!commonParams) {
return;
}
if (commonParams->buttonSwap == 1) {
x1 = 261.5f;
x2 = 183.5f;
}
+5 -3
View File
@@ -29,8 +29,7 @@ class PointerWrap;
#define SCE_UTILITY_DIALOG_RESULT_CANCEL 1
#define SCE_UTILITY_DIALOG_RESULT_ABORT 2
struct pspUtilityDialogCommon
{
struct pspUtilityDialogCommon {
u32_le size; /** Size of the structure */
s32_le language; /** Language */
s32_le buttonSwap; /** Set to 1 for X/O button swap */
@@ -50,7 +49,10 @@ public:
virtual int Update(int animSpeed) = 0;
virtual int Shutdown(bool force = false);
virtual void DoState(PointerWrap &p);
virtual pspUtilityDialogCommon *GetCommonParam();
virtual pspUtilityDialogCommon *GetCommonParam() {
// This is returned properly by the derived classes (or should be...).
return nullptr;
}
enum DialogStatus {
SCE_UTILITY_STATUS_NONE = 0,
+2 -2
View File
@@ -484,10 +484,10 @@ static int sceUtilitySavedataGetStatus() {
}
static int sceUtilitySavedataUpdate(int animSpeed) {
if (currentDialogType != UtilityDialogType::SAVEDATA) {
if (currentDialogType != UtilityDialogType::SAVEDATA || !saveDialog) {
return hleLogWarning(Log::sceUtility, SCE_ERROR_UTILITY_WRONG_TYPE, "wrong dialog type");
}
int result = hleLogDebug(Log::sceUtility, saveDialog->Update(animSpeed));
if (result >= 0)
return hleDelayResult(result, "savedata update", 300);