Vulkan: Fix FragCoord scaling when a viewport is applied.

We were using the pivot based on the viewport dimensions which is
only valid if the viewport is the size of the framebuffer. The more
correct pivot size is actually based on the Framebuffer height.

Also updates the driver uniforms block to be a bit simpler.

Bug: angleproject:2598
Change-Id: I1cb500cded7141d10e8db6862b6ed29758cc7fb4
Reviewed-on: https://chromium-review.googlesource.com/1214205
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/ContextVk.cpp b/src/libANGLE/renderer/vulkan/ContextVk.cpp
index 0f9cc20..c22ab4e 100644
--- a/src/libANGLE/renderer/vulkan/ContextVk.cpp
+++ b/src/libANGLE/renderer/vulkan/ContextVk.cpp
@@ -1091,6 +1091,8 @@
     mDriverUniformsBuffer.releaseRetainedBuffers(mRenderer);
 
     const gl::Rectangle &glViewport = mState.getState().getViewport();
+    float halfRenderAreaHeight =
+        static_cast<float>(mDrawFramebuffer->getState().getDimensions().height) * 0.5f;
 
     // Allocate a new region in the dynamic buffer.
     uint8_t *ptr            = nullptr;
@@ -1110,7 +1112,10 @@
     *driverUniforms                = {
         {static_cast<float>(glViewport.x), static_cast<float>(glViewport.y),
          static_cast<float>(glViewport.width), static_cast<float>(glViewport.height)},
-        {1.0f, -scaleY, 1.0f, scaleY},
+        halfRenderAreaHeight,
+        scaleY,
+        -scaleY,
+        0.0f,
         {depthRangeNear, depthRangeFar, depthRangeDiff, 0.0f}};
 
     ANGLE_TRY(mDriverUniformsBuffer.flush(this));