Merge pull request #18135 from hrydgard/assorted-fixes-6

Fix closing the chat window with ESC, add some asserts
This commit is contained in:
Henrik Rydgård
2023-09-11 18:12:12 +02:00
committed by GitHub
4 changed files with 13 additions and 9 deletions
+1 -2
View File
@@ -241,8 +241,7 @@ public:
}
void BindPipeline(VKRGraphicsPipeline *pipeline, PipelineFlags flags, VkPipelineLayout pipelineLayout) {
_dbg_assert_(curRenderStep_ && curRenderStep_->stepType == VKRStepType::RENDER);
_dbg_assert_(pipeline != nullptr);
_assert_(curRenderStep_ && curRenderStep_->stepType == VKRStepType::RENDER && pipeline != nullptr);
VkRenderData &data = curRenderStep_->commands.push_uninitialized();
data.cmd = VKRRenderCommand::BIND_GRAPHICS_PIPELINE;
pipelinesToCheck_.push_back(pipeline);
+3 -3
View File
@@ -91,19 +91,19 @@ bool UIScreen::UnsyncTouch(const TouchInput &touch) {
}
}
std::lock_guard<std::mutex> guard(eventQueueLock_);
QueuedEvent ev{};
ev.type = QueuedEventType::TOUCH;
ev.touch = touch;
std::lock_guard<std::mutex> guard(eventQueueLock_);
eventQueue_.push_back(ev);
return false;
}
void UIScreen::UnsyncAxis(const AxisInput &axis) {
std::lock_guard<std::mutex> guard(eventQueueLock_);
QueuedEvent ev{};
ev.type = QueuedEventType::AXIS;
ev.axis = axis;
std::lock_guard<std::mutex> guard(eventQueueLock_);
eventQueue_.push_back(ev);
}
@@ -123,10 +123,10 @@ bool UIScreen::UnsyncKey(const KeyInput &key) {
}
}
std::lock_guard<std::mutex> guard(eventQueueLock_);
QueuedEvent ev{};
ev.type = QueuedEventType::KEY;
ev.key = key;
std::lock_guard<std::mutex> guard(eventQueueLock_);
eventQueue_.push_back(ev);
return retval;
}
+5
View File
@@ -180,6 +180,7 @@ static std::string CutFromMain(std::string str) {
static VulkanPipeline *CreateVulkanPipeline(VulkanRenderManager *renderManager, VkPipelineCache pipelineCache,
VkPipelineLayout layout, PipelineFlags pipelineFlags, VkSampleCountFlagBits sampleCount, const VulkanPipelineRasterStateKey &key,
const DecVtxFormat *decFmt, VulkanVertexShader *vs, VulkanFragmentShader *fs, VulkanGeometryShader *gs, bool useHwTransform, u32 variantBitmask, bool cacheLoad) {
_assert_(fs && vs);
if (!fs->GetModule()) {
ERROR_LOG(G3D, "Fragment shader missing in CreateVulkanPipeline");
@@ -189,6 +190,10 @@ static VulkanPipeline *CreateVulkanPipeline(VulkanRenderManager *renderManager,
ERROR_LOG(G3D, "Vertex shader missing in CreateVulkanPipeline");
return nullptr;
}
if (gs && !gs->GetModule()) {
ERROR_LOG(G3D, "Geometry shader missing in CreateVulkanPipeline");
return nullptr;
}
VulkanPipeline *vulkanPipeline = new VulkanPipeline();
vulkanPipeline->desc = new VKRGraphicsPipelineDesc();
+4 -4
View File
@@ -844,16 +844,16 @@ bool EmuScreen::UnsyncKey(const KeyInput &key) {
System_Notify(SystemNotification::ACTIVITY);
if (UI::IsFocusMovementEnabled()) {
if (UIScreen::UnsyncKey(key)) {
return true;
} else if ((key.flags & KEY_DOWN) != 0 && UI::IsEscapeKey(key)) {
bool retval = UIScreen::UnsyncKey(key);
if ((key.flags & KEY_DOWN) != 0 && UI::IsEscapeKey(key)) {
if (chatMenu_)
chatMenu_->Close();
if (chatButton_)
chatButton_->SetVisibility(UI::V_VISIBLE);
UI::EnableFocusMovement(false);
return true;
retval = true;
}
return retval;
}
return controlMapper_.Key(key, &pauseTrigger_);