OSDN Git Service

Removed SwiftShader's custom Viewport structure
authorAlexis Hetu <sugoi@google.com>
Tue, 27 Nov 2018 21:16:39 +0000 (16:16 -0500)
committerAlexis Hétu <sugoi@google.com>
Wed, 28 Nov 2018 15:29:48 +0000 (15:29 +0000)
- Replaced sw::Viewport with VkViewport

Bug b/118386749

Change-Id: I2446883ba9e5623753322fc417386394a3fe370c
Reviewed-on: https://swiftshader-review.googlesource.com/c/22909
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
src/Device/Renderer.cpp
src/Device/Renderer.hpp

index 1963caf..12f3b81 100644 (file)
@@ -483,10 +483,10 @@ namespace sw
                {
                        float W = 0.5f * viewport.width;
                        float H = 0.5f * viewport.height;
-                       float X0 = viewport.x0 + W;
-                       float Y0 = viewport.y0 + H;
-                       float N = viewport.minZ;
-                       float F = viewport.maxZ;
+                       float X0 = viewport.x + W;
+                       float Y0 = viewport.y + H;
+                       float N = viewport.minDepth;
+                       float F = viewport.maxDepth;
                        float Z = F - N;
 
                        if(context->isDrawTriangle())
@@ -2291,7 +2291,7 @@ namespace sw
                }
        #endif
 
-       void Renderer::setViewport(const Viewport &viewport)
+       void Renderer::setViewport(const VkViewport &viewport)
        {
                this->viewport = viewport;
        }
index 232a9be..3e92954 100644 (file)
@@ -192,16 +192,6 @@ namespace sw
                float4 a2c3;
        };
 
-       struct Viewport
-       {
-               float x0;
-               float y0;
-               float width;
-               float height;
-               float minZ;
-               float maxZ;
-       };
-
        class Renderer : public VertexProcessor, public PixelProcessor, public SetupProcessor
        {
                struct Task
@@ -315,7 +305,7 @@ namespace sw
                void setVertexShaderConstantB(unsigned int index, const int *boolean, unsigned int count = 1);
 
                // Viewport & Clipper
-               void setViewport(const Viewport &viewport);
+               void setViewport(const VkViewport &viewport);
                void setScissor(const Rect &scissor);
                void setClipFlags(int flags);
                void setClipPlane(unsigned int index, const float plane[4]);
@@ -372,7 +362,7 @@ namespace sw
                Context *context;
                Clipper *clipper;
                Blitter *blitter;
-               Viewport viewport;
+               VkViewport viewport;
                Rect scissor;
                int clipFlags;