Skip to content

Commit

Permalink
Apply viewport before SoftwareTransform so flipping can be checked
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 26, 2020
1 parent 3aa575d commit 92a1395
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions GPU/Vulkan/DrawEngineVulkan.cpp
Expand Up @@ -895,6 +895,14 @@ void DrawEngineVulkan::DoFlush() {
params.allowSeparateAlphaClear = false;
params.provokeFlatFirst = true;

// We need to update the viewport early because it's checked for flipping in SoftwareTransform.
// We don't have a "DrawStateEarly" in vulkan, so...
// TODO: Probably should eventually refactor this and feed the vp size into SoftwareTransform directly (Unknown's idea).
if (gstate_c.IsDirty(DIRTY_VIEWPORTSCISSOR_STATE)) {
gstate_c.vpWidth = gstate.getViewportXScale() * 2.0f;
gstate_c.vpHeight = gstate.getViewportYScale() * 2.0f;
}

int maxIndex = indexGen.MaxIndex();
SoftwareTransform(
prim, indexGen.VertexCount(),
Expand Down

0 comments on commit 92a1395

Please sign in to comment.