Skip to content
Permalink
Browse files

Fix a VK validation failure when opening the homebrew menu

  • Loading branch information...
hrydgard committed Mar 11, 2019
1 parent 3445f39 commit 624587c594c48e2a9c9b38c2cc82348829934423
Showing with 8 additions and 2 deletions.
  1. +3 −0 ext/native/thin3d/VulkanRenderManager.h
  2. +5 −2 ext/native/ui/ui_context.cpp
@@ -118,6 +118,7 @@ class VulkanRenderManager {

void SetViewport(const VkViewport &vp) {
_dbg_assert_(G3D, curRenderStep_ && curRenderStep_->stepType == VKRStepType::RENDER);
_dbg_assert_(G3D, (int)vp.width >= 0);
VkRenderData data{ VKRRenderCommand::VIEWPORT };
data.viewport.vp.x = vp.x;
data.viewport.vp.y = vp.y;
@@ -132,6 +133,8 @@ class VulkanRenderManager {

void SetScissor(const VkRect2D &rc) {
_dbg_assert_(G3D, curRenderStep_ && curRenderStep_->stepType == VKRStepType::RENDER);
_dbg_assert_(G3D, (int)rc.extent.width >= 0);
_dbg_assert_(G3D, (int)rc.extent.height >= 0);
VkRenderData data{ VKRRenderCommand::SCISSOR };
data.scissor.scissor = rc;
curRenderStep_->commands.push_back(data);
@@ -1,4 +1,7 @@
#include "ppsspp_config.h"

#include <algorithm>

#include "base/display.h"
#include "ui/ui.h"
#include "ui/view.h"
@@ -111,8 +114,8 @@ void UIContext::ActivateTopScissor() {
bounds = scissorStack_.back();
int x = floorf(scale_x * bounds.x);
int y = floorf(scale_y * bounds.y);
int w = ceilf(scale_x * bounds.w);
int h = ceilf(scale_y * bounds.h);
int w = std::max(0.0f, ceilf(scale_x * bounds.w));
int h = std::max(0.0f, ceilf(scale_y * bounds.h));
draw_->SetScissorRect(x, y, w, h);
} else {
// Avoid rounding errors

0 comments on commit 624587c

Please sign in to comment.
You can’t perform that action at this time.