Fix build errors with makeViewport
authorBoris Zanin <boris.zanin@mobica.com>
Tue, 29 Aug 2017 09:07:34 +0000 (11:07 +0200)
committerBoris Zanin <boris.zanin@mobica.com>
Tue, 29 Aug 2017 09:07:34 +0000 (11:07 +0200)
Local makeViewport cannot be used in recently added tests
in vktImageMutableTests.

Fix: Remove local makeViewport and use one from vkTypeUtil.inl

Components: Vulkan

VK-GL-CTS issue: 124

Change-Id: I27c9c255d9e46a74a6528327339317ba74e5eb98

external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp
external/vulkancts/modules/vulkan/image/vktImageTestsUtil.cpp
external/vulkancts/modules/vulkan/image/vktImageTestsUtil.hpp

index fd3f9a867de15a3b872d855f672a0f66a663212e..d33b206fb6e7eae2837855fe8dbf40fabba4c6d3 100644 (file)
@@ -1524,7 +1524,7 @@ void GraphicsAttachmentsTestInstance::transcodeRead ()
                MovePtr<Buffer>                         dstImageBuffer                  = MovePtr<Buffer>(new Buffer(vk, device, allocator, dstImageBufferInfo, MemoryRequirement::HostVisible));
 
                const VkExtent2D                        renderSize                              (makeExtent2D(uncompressedImageRes.x(), uncompressedImageRes.y()));
-               const VkViewport                        viewport                                = makeViewport(renderSize.width, renderSize.height);
+               const VkViewport                        viewport                                = makeViewport(0.0f, 0.0f, static_cast<float>(renderSize.width), static_cast<float>(renderSize.height), 0.0f, 1.0f);
                const VkRect2D                          scissor                                 = makeScissor(renderSize.width, renderSize.height);
 
                for (deUint32 layerNdx = 0; layerNdx < getLayerCount(); ++layerNdx)
@@ -1652,7 +1652,7 @@ void GraphicsAttachmentsTestInstance::transcodeWrite ()
                const VkImageCreateInfo         srcImageCreateInfo              = makeCreateImageInfo(m_srcFormat, m_parameters.imageType, srcImageResolution, m_srcImageUsageFlags, imgCreateFlagsOverride, SINGLE_LEVEL, SINGLE_LAYER);
 
                const VkExtent2D                        renderSize                              (makeExtent2D(uncompressedImageRes.x(), uncompressedImageRes.y()));
-               const VkViewport                        viewport                                = makeViewport(renderSize.width, renderSize.height);
+               const VkViewport                        viewport                                = makeViewport(0.0f, 0.0f, static_cast<float>(renderSize.width), static_cast<float>(renderSize.height), 0.0f, 1.0f);
                const VkRect2D                          scissor                                 = makeScissor(renderSize.width, renderSize.height);
 
                for (deUint32 layerNdx = 0; layerNdx < getLayerCount(); ++layerNdx)
@@ -2077,7 +2077,7 @@ void GraphicsTextureTestInstance::transcodeRead ()
                MovePtr<Buffer>                         dstImageBuffer                  = MovePtr<Buffer>(new Buffer(vk, device, allocator, dstImageBufferInfo, MemoryRequirement::HostVisible));
 
                const VkExtent2D                        renderSize                              (makeExtent2D(uncompressedImageRes.x(), uncompressedImageRes.y()));
-               const VkViewport                        viewport                                = makeViewport(renderSize.width, renderSize.height);
+               const VkViewport                        viewport                                = makeViewport(0.0f, 0.0f, static_cast<float>(renderSize.width), static_cast<float>(renderSize.height), 0.0f, 1.0f);
                const VkRect2D                          scissor                                 = makeScissor(renderSize.width, renderSize.height);
 
                for (deUint32 layerNdx = 0; layerNdx < getLayerCount(); ++layerNdx)
@@ -2211,7 +2211,7 @@ void GraphicsTextureTestInstance::transcodeWrite ()
                const VkImageCreateInfo         srcImageCreateInfo              = makeCreateImageInfo(m_srcFormat, m_parameters.imageType, srcImageResolution, m_srcImageUsageFlags, imgCreateFlagsOverride, SINGLE_LEVEL, SINGLE_LAYER);
 
                const VkExtent2D                        renderSize                              (makeExtent2D(uncompressedImageRes.x(), uncompressedImageRes.y()));
-               const VkViewport                        viewport                                = makeViewport(renderSize.width, renderSize.height);
+               const VkViewport                        viewport                                = makeViewport(0.0f, 0.0f, static_cast<float>(renderSize.width), static_cast<float>(renderSize.height), 0.0f, 1.0f);
                const VkRect2D                          scissor                                 = makeScissor(renderSize.width, renderSize.height);
 
                for (deUint32 layerNdx = 0; layerNdx < getLayerCount(); ++layerNdx)
index 65e01dd7b7fba5264cfb432f6d170e4621266af8..8dd9ea95c075020a8c2522e5527f85bb5dab3c8d 100644 (file)
@@ -1261,22 +1261,6 @@ Move<VkFramebuffer> makeFramebuffer (const DeviceInterface&      vk,
        return createFramebuffer(vk, device, &framebufferInfo);
 }
 
-VkViewport makeViewport (const deUint32        width,
-                                                const deUint32 height)
-{
-       const VkViewport viewport =
-       {
-               0.0f,                   // float        originX;
-               0.0f,                   // float        originY;
-               (float)width,   // float        width;
-               (float)height,  // float        height;
-               0.0f,                   // float        minDepth;
-               1.0f                    // float        maxDepth;
-       };
-
-       return viewport;
-}
-
 VkRect2D makeScissor (const deUint32   width,
                                          const deUint32        height)
 {
index d6b256ad42abe4633f6156ea72385760242b0f4e..1fee1c4d14c3ffe82b09d59918cf8ded8605aae2 100644 (file)
@@ -223,9 +223,6 @@ vk::Move<vk::VkFramebuffer> makeFramebuffer (const vk::DeviceInterface&     vk,
                                                                                         const vk::VkExtent2D&          size,
                                                                                         const deUint32                         layersCount);
 
-vk::VkViewport makeViewport (const deUint32    width,
-                                                        const deUint32 height);
-
 vk::VkRect2D makeScissor (const deUint32       width,
                                                  const deUint32        height);