draw tests: fix review comments
authorscygan <slawomir.cygan@intel.com>
Wed, 16 Dec 2015 18:45:58 +0000 (19:45 +0100)
committerscygan <slawomir.cygan@intel.com>
Mon, 21 Dec 2015 16:08:12 +0000 (17:08 +0100)
19 files changed:
external/vulkancts/data/draw/VertexFetch.vert
external/vulkancts/data/draw/VertexFetchWithInstance.vert
external/vulkancts/modules/vulkan/draw/CMakeLists.txt
external/vulkancts/modules/vulkan/draw/vktDrawBaseClass.cpp
external/vulkancts/modules/vulkan/draw/vktDrawBaseClass.hpp
external/vulkancts/modules/vulkan/draw/vktDrawBufferObjectUtil.cpp
external/vulkancts/modules/vulkan/draw/vktDrawBufferObjectUtil.hpp
external/vulkancts/modules/vulkan/draw/vktDrawCreateInfoUtil.cpp
external/vulkancts/modules/vulkan/draw/vktDrawCreateInfoUtil.hpp
external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.cpp
external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.hpp
external/vulkancts/modules/vulkan/draw/vktDrawIndexedTest.cpp
external/vulkancts/modules/vulkan/draw/vktDrawIndexedTest.hpp
external/vulkancts/modules/vulkan/draw/vktDrawIndirectTest.cpp
external/vulkancts/modules/vulkan/draw/vktDrawIndirectTest.hpp
external/vulkancts/modules/vulkan/draw/vktDrawSimpleTest.cpp
external/vulkancts/modules/vulkan/draw/vktDrawSimpleTest.hpp
external/vulkancts/modules/vulkan/draw/vktDrawTestCaseUtil.hpp
external/vulkancts/modules/vulkan/draw/vktDrawTests.hpp

index 30439aa..1730f5f 100644 (file)
@@ -1,5 +1,5 @@
 #version 430
-       
+
 layout(location = 0) in vec4 in_position;
 layout(location = 1) in vec4 in_color;
 
index d4cac1d..6f54e46 100644 (file)
@@ -1,5 +1,5 @@
 #version 430
-       
+
 layout(location = 0) in vec4 in_position;
 layout(location = 1) in vec4 in_color;
 
@@ -8,7 +8,7 @@ layout(location = 0) out vec4 out_color;
 void main() {
        vec2 perVertex = vec2(in_position.x, in_position.y);
        vec2 perInstance[6]     = vec2[6](vec2(0.7, -0.7), vec2(-0.75, 0.8), vec2(0.0, 0.0), vec2(0.3, 0.0), vec2(0.0, -0.3),vec2(0.3, -0.3) );
-    
+
        gl_Position = vec4(perVertex + perInstance[gl_InstanceID], 0.0, 1.0);
        out_color = in_color;
 }
\ No newline at end of file
index c1f89bf..5d7901b 100644 (file)
@@ -10,7 +10,7 @@ set(DEQP_VK_DRAW_SRCS
        vktDrawSimpleTest.hpp
        vktDrawSimpleTest.cpp
        vktDrawBaseClass.hpp
-       vktDrawBaseClass.cpp    
+       vktDrawBaseClass.cpp
        vktDrawCreateInfoUtil.hpp
        vktDrawCreateInfoUtil.cpp
        vktDrawImageObjectUtil.hpp
@@ -18,7 +18,6 @@ set(DEQP_VK_DRAW_SRCS
        vktDrawBufferObjectUtil.hpp
        vktDrawBufferObjectUtil.cpp
        vktDrawTestCaseUtil.hpp
-
 )
 
 set(DEQP_VK_DRAW_LIBS
index be14a06..98bcfa3 100644 (file)
@@ -33,7 +33,6 @@
 * \brief Command draw Tests - Base Class
 *//*--------------------------------------------------------------------*/
 
-
 #include "vktDrawBaseClass.hpp"
 
 namespace vkt
@@ -41,7 +40,7 @@ namespace vkt
 namespace Draw
 {
 
-DrawTestsBaseClass::DrawTestsBaseClass (Context &context, const char* vertexShaderName, const char* fragmentShaderName)
+DrawTestsBaseClass::DrawTestsBaseClass (Contextcontext, const char* vertexShaderName, const char* fragmentShaderName)
        : TestInstance                          (context)
        , m_colorAttachmentFormat       (vk::VK_FORMAT_R8G8B8A8_UNORM)
        , m_topology                            (vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP)
@@ -51,8 +50,6 @@ DrawTestsBaseClass::DrawTestsBaseClass (Context &context, const char* vertexShad
 {
 }
 
-
-
 void DrawTestsBaseClass::initialize (void)
 {
        tcu::TestLog &log                                               = m_context.getTestContext().getLog();
@@ -80,7 +77,7 @@ void DrawTestsBaseClass::initialize (void)
                                                                                                                         vk::VK_ATTACHMENT_STORE_OP_STORE,
                                                                                                                         vk::VK_IMAGE_LAYOUT_GENERAL,
                                                                                                                         vk::VK_IMAGE_LAYOUT_GENERAL));
-               
+
 
        const vk::VkAttachmentReference colorAttachmentReference =
        {
@@ -136,14 +133,14 @@ void DrawTestsBaseClass::initialize (void)
                                                                                                                          2,
                                                                                                                          vertexInputAttributeDescriptions);
 
-       const vk::VkDeviceSize dataSize = m_data.size() * sizeof(Vec4RGBA);
+       const vk::VkDeviceSize dataSize = m_data.size() * sizeof(PositionColorVertex);
        m_vertexBuffer = Buffer::createAndAlloc(m_vk, device, BufferCreateInfo(dataSize,
                vk::VK_BUFFER_USAGE_VERTEX_BUFFER_BIT), m_context.getDefaultAllocator(), vk::MemoryRequirement::HostVisible);
 
-       unsigned char *ptr = reinterpret_cast<unsigned char *>(m_vertexBuffer->getBoundMemory().getHostPtr());
+       deUint8* ptr = reinterpret_cast<deUint8*>(m_vertexBuffer->getBoundMemory().getHostPtr());
        deMemcpy(ptr, &m_data[0], dataSize);
 
-       vk::flushMappedMemoryRange(m_vk, 
+       vk::flushMappedMemoryRange(m_vk,
                                                           device,
                                                           m_vertexBuffer->getBoundMemory().getMemory(),
                                                           m_vertexBuffer->getBoundMemory().getOffset(),
@@ -196,7 +193,7 @@ void DrawTestsBaseClass::initPipeline (const vk::VkDevice device)
        pipelineCreateInfo.addState(PipelineCreateInfo::DepthStencilState());
        pipelineCreateInfo.addState(PipelineCreateInfo::RasterizerState());
        pipelineCreateInfo.addState(PipelineCreateInfo::MultiSampleState());
-                       
+
        m_pipeline = vk::createGraphicsPipeline(m_vk, device, DE_NULL, &pipelineCreateInfo);
 }
 
@@ -204,11 +201,11 @@ void DrawTestsBaseClass::beginRenderPass (void)
 {
        const vk::VkClearColorValue clearColor = { { 0.0f, 0.0f, 0.0f, 1.0f } };
        const CmdBufferBeginInfo beginInfo;
-       
+
        m_vk.beginCommandBuffer(*m_cmdBuffer, &beginInfo);
 
        initialTransitionColor2DImage(m_vk, *m_cmdBuffer, m_colorTargetImage->object(), vk::VK_IMAGE_LAYOUT_GENERAL);
-       
+
        const ImageSubresourceRange subresourceRange(vk::VK_IMAGE_ASPECT_COLOR_BIT);
        m_vk.cmdClearColorImage(*m_cmdBuffer, m_colorTargetImage->object(),
                vk::VK_IMAGE_LAYOUT_GENERAL, &clearColor, 1, &subresourceRange);
@@ -217,8 +214,7 @@ void DrawTestsBaseClass::beginRenderPass (void)
        const RenderPassBeginInfo renderPassBegin(*m_renderPass, *m_framebuffer, renderArea);
 
        m_vk.cmdBeginRenderPass(*m_cmdBuffer, &renderPassBegin, vk::VK_SUBPASS_CONTENTS_INLINE);
-
 }
 
-}      //Draw
-}      //vkt
+}      // Draw
+}      // vkt
index 2df8cd8..f303723 100644 (file)
@@ -35,6 +35,7 @@
 * \brief Command draw Tests - Base Class
 *//*--------------------------------------------------------------------*/
 
+#include "vkDefs.hpp"
 #include "vktTestCase.hpp"
 
 #include "tcuTestLog.hpp"
@@ -58,35 +59,52 @@ namespace vkt
 namespace Draw
 {
 
-inline tcu::Vec4 vec4Red(void)
+struct PositionColorVertex
 {
-       return tcu::Vec4(1.0f, 0.0f, 0.0f, 1.0f);
-}
+       PositionColorVertex(tcu::Vec4 position_, tcu::Vec4 color_)
+               : position(position_)
+               , color(color_)
+       {}
+       tcu::Vec4 position;
+       tcu::Vec4 color;
+};
 
-inline tcu::Vec4 vec4Green(void)
+struct ReferenceImageCoordinates
 {
-       return tcu::Vec4(0.0f, 1.0f, 0.0f, 1.0f);
-}
+       ReferenceImageCoordinates (void)
+               : left          (-0.3)
+               , right         (0.3)
+               , top           (0.3)
+               , bottom        (-0.3)
+       {
+       }
 
-inline tcu::Vec4 vec4Blue(void)
-{
-       return tcu::Vec4(0.0f, 0.0f, 1.0f, 1.0f);
-}
+       double left;
+       double right;
+       double top;
+       double bottom;
+};
 
-struct Vec4RGBA
+struct ReferenceImageInstancedCoordinates
 {
-       Vec4RGBA(tcu::Vec4 p, tcu::Vec4 c)
-       : position      (p)
-       , color         (c)
-       {}
-       tcu::Vec4 position;
-       tcu::Vec4 color;
+       ReferenceImageInstancedCoordinates (void)
+               : left          (-0.3)
+               , right         (0.6)
+               , top           (0.3)
+               , bottom        (-0.6)
+       {
+       }
+
+       double left;
+       double right;
+       double top;
+       double bottom;
 };
 
 class DrawTestsBaseClass : public TestInstance
 {
 public:
-                                                               DrawTestsBaseClass      (Context &context, const char* vertexShaderName, const char* fragmentShaderName);
+                                                               DrawTestsBaseClass      (Contextcontext, const char* vertexShaderName, const char* fragmentShaderName);
 
 protected:
        void                                            initialize                      (void);
@@ -108,7 +126,7 @@ protected:
 
        vk::Move<vk::VkPipeline>                                                m_pipeline;
        vk::Move<vk::VkPipelineLayout>                                  m_pipelineLayout;
-       
+
        de::SharedPtr<Image>                                                    m_colorTargetImage;
        vk::Move<vk::VkImageView>                                               m_colorTargetView;
 
@@ -124,12 +142,12 @@ protected:
        const std::string                                                               m_vertexShaderName;
        const std::string                                                               m_fragmentShaderName;
 
-       std::vector<Vec4RGBA>                                                   m_data;
+       std::vector<PositionColorVertex>                                m_data;
        std::vector<deUint32>                                                   m_indexes;
        de::SharedPtr<Buffer>                                                   m_indexBuffer;
 };
 
-}      //Draw
-}      //vkt
+}      // Draw
+}      // vkt
 
-#endif //_VKTDRAWBASECLASS_HPP
+#endif // _VKTDRAWBASECLASS_HPP
index 659635e..55bc209 100644 (file)
@@ -42,7 +42,7 @@ namespace vkt
 namespace Draw
 {
 
-Buffer::Buffer (const vk::DeviceInterface &vk, vk::VkDevice device, vk::Move<vk::VkBuffer> object)
+Buffer::Buffer (const vk::DeviceInterfacevk, vk::VkDevice device, vk::Move<vk::VkBuffer> object)
        : m_object              (object)
        , m_allocation  (DE_NULL)
        , m_vk                  (vk)
@@ -59,7 +59,7 @@ void Buffer::bindMemory (de::MovePtr<vk::Allocation> allocation)
        m_allocation = allocation;
 }
 
-de::SharedPtr<Buffer> Buffer::createAndAlloc (const vk::DeviceInterface &vk,
+de::SharedPtr<Buffer> Buffer::createAndAlloc (const vk::DeviceInterfacevk,
                                                                                          vk::VkDevice device,
                                                                                          const vk::VkBufferCreateInfo &createInfo,
                                                                                          vk::Allocator &allocator,
@@ -72,12 +72,12 @@ de::SharedPtr<Buffer> Buffer::createAndAlloc (const vk::DeviceInterface &vk,
        return ret;
 }
 
-de::SharedPtr<Buffer> Buffer::create (const vk::DeviceInterface &vk,
+de::SharedPtr<Buffer> Buffer::create (const vk::DeviceInterfacevk,
                                                                          vk::VkDevice device,
-                                                                         const vk::VkBufferCreateInfo &createInfo)
+                                                                         const vk::VkBufferCreateInfocreateInfo)
 {
        return de::SharedPtr<Buffer>(new Buffer(vk, device, vk::createBuffer(vk, device, &createInfo)));
 }
 
-} //Draw
-} //vkt
+} // Draw
+} // vkt
index a3b2bfd..f52e77a 100644 (file)
@@ -35,7 +35,6 @@
  * \brief Buffer Object Util
  *//*--------------------------------------------------------------------*/
 
-#include "vkDefs.hpp"
 #include "vkMemUtil.hpp"
 #include "vkRefUtil.hpp"
 
@@ -60,27 +59,24 @@ public:
 
                                                                Buffer                  (const vk::DeviceInterface &vk, vk::VkDevice device, vk::Move<vk::VkBuffer> object);
 
-
        void                                            bindMemory              (de::MovePtr<vk::Allocation> allocation);
 
-
        vk::VkBuffer                            object                  (void) const                                                            { return *m_object;             }
        vk::Allocation                          getBoundMemory  (void) const                                                            { return *m_allocation; }
 
 private:
 
        Buffer                                                                          (const Buffer& other);  // Not allowed!
-       Buffer                                          &operator=              (const Buffer& other);  // Not allowed!
-
+       Buffer&                                         operator=               (const Buffer& other);  // Not allowed!
 
        de::MovePtr<vk::Allocation>             m_allocation;
        vk::Unique<vk::VkBuffer>                m_object;
 
-       const   vk::DeviceInterface &   m_vk;
-                       vk::VkDevice                    m_device;
+       const vk::DeviceInterface&              m_vk;
+       vk::VkDevice                                    m_device;
 };
 
-} //Draw
-} //vkt
+} // Draw
+} // vkt
 
-#endif // _VKT_DRAWBUFFEROBJECTUTIL_HPP
+#endif // _VKTDRAWBUFFEROBJECTUTIL_HPP
index d49c804..dfd7038 100644 (file)
@@ -141,14 +141,13 @@ BufferViewCreateInfo::BufferViewCreateInfo (vk::VkBuffer  _buffer,
        range   = _range;
 }
 
-
 BufferCreateInfo::BufferCreateInfo (vk::VkDeviceSize           _size,
                                                                        vk::VkBufferUsageFlags  _usage,
                                                                        vk::VkSharingMode               _sharingMode,
                                                                        deUint32                                _queueFamilyIndexCount,
                                                                        const deUint32*                 _pQueueFamilyIndices,
                                                                        vk::VkBufferCreateFlags _flags)
-{   
+{
        sType = vk::VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
        pNext = DE_NULL;
        size                                    = _size;
@@ -166,7 +165,7 @@ BufferCreateInfo::BufferCreateInfo (vk::VkDeviceSize                _size,
        else
        {
                pQueueFamilyIndices = _pQueueFamilyIndices;
-       }   
+       }
 }
 
 BufferCreateInfo::BufferCreateInfo (const BufferCreateInfo &other)
@@ -228,7 +227,7 @@ ImageCreateInfo::ImageCreateInfo (vk::VkImageType                   _imageType,
                                                                  vk::VkImageUsageFlags         _usage,
                                                                  vk::VkSharingMode                     _sharingMode,
                                                                  deUint32                                      _queueFamilyIndexCount,
-                                                                 const deUint32*                       _pQueueFamilyIndices,
+                                                                 const deUint32*                       _pQueueFamilyIndices,
                                                                  vk::VkImageCreateFlags        _flags,
                                                                  vk::VkImageLayout                     _initialLayout)
 {
@@ -263,7 +262,7 @@ ImageCreateInfo::ImageCreateInfo (vk::VkImageType                   _imageType,
 }
 
 FramebufferCreateInfo::FramebufferCreateInfo (vk::VkRenderPass                                         _renderPass,
-                                                                                         const std::vector<vk::VkImageView>&   atachments, 
+                                                                                         const std::vector<vk::VkImageView>&   atachments,
                                                                                          deUint32                                                              _width,
                                                                                          deUint32                                                              _height,
                                                                                          deUint32                                                              _layers)
@@ -298,7 +297,7 @@ RenderPassCreateInfo::RenderPassCreateInfo (const std::vector<vk::VkAttachmentDe
 {
        sType = vk::VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
        pNext = DE_NULL;
-       flags = 0; 
+       flags = 0;
 
        attachmentCount = static_cast<deUint32>(m_attachments.size());
        pAttachments    = &m_attachmentsStructs[0];
@@ -393,7 +392,7 @@ RenderPassCreateInfo::addDependency (vk::VkSubpassDependency dependency)
 RenderPassBeginInfo::RenderPassBeginInfo (vk::VkRenderPass                                             _renderPass,
                                                                                  vk::VkFramebuffer                                             _framebuffer,
                                                                                  vk::VkRect2D                                                  _renderArea,
-                                                                                 const std::vector<vk::VkClearValue>&  _clearValues)
+                                                                                 const std::vector<vk::VkClearValue>&  _clearValues)
 {
 
        m_clearValues   = _clearValues;
@@ -436,7 +435,7 @@ AttachmentDescription::AttachmentDescription (vk::VkFormat                          _format,
        finalLayout             = _finalLayout;
 }
 
-AttachmentDescription::AttachmentDescription (const vk::VkAttachmentDescription &rhs)
+AttachmentDescription::AttachmentDescription (const vk::VkAttachmentDescriptionrhs)
 {
        flags                   = rhs.flags;
        format                  = rhs.format;
@@ -603,7 +602,7 @@ SubpassDependency::SubpassDependency (deUint32                                      _srcSubpass,
        dependencyFlags = _dependencyFlags;
 }
 
-SubpassDependency::SubpassDependency (const vk::VkSubpassDependency &rhs)
+SubpassDependency::SubpassDependency (const vk::VkSubpassDependencyrhs)
 {
        srcSubpass              = rhs.srcSubpass;
        dstSubpass              = rhs.dstSubpass;
@@ -680,7 +679,6 @@ DescriptorSetLayoutCreateInfo::DescriptorSetLayoutCreateInfo (deUint32 _bindingC
        pBinding         = _pBindings;
 }
 
-
 PipelineLayoutCreateInfo::PipelineLayoutCreateInfo (deUint32                                                   _descriptorSetCount,
                                                                                                        const vk::VkDescriptorSetLayout*        _pSetLayouts,
                                                                                                        deUint32                                                        _pushConstantRangeCount,
@@ -737,7 +735,6 @@ PipelineLayoutCreateInfo::PipelineLayoutCreateInfo (const std::vector<vk::VkDesc
        }
 }
 
-
 PipelineCreateInfo::PipelineShaderStage::PipelineShaderStage (vk::VkShaderModule _module, const char* _pName, vk::VkShaderStageFlagBits _stage)
 {
        sType = vk::VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
@@ -789,7 +786,7 @@ PipelineCreateInfo::ViewportState::ViewportState (deUint32                                          _viewportCount,
        flags                   = 0u;
        viewportCount   = _viewportCount;
        scissorCount    = _viewportCount;
-       
+
        if (!_viewports.size())
        {
                m_viewports.resize(viewportCount);
@@ -814,7 +811,7 @@ PipelineCreateInfo::ViewportState::ViewportState (deUint32                                          _viewportCount,
        pScissors       = &m_scissors[0];
 }
 
-PipelineCreateInfo::ViewportState::ViewportState (const ViewportState &other)
+PipelineCreateInfo::ViewportState::ViewportState (const ViewportStateother)
 {
        sType                   = other.sType;
        pNext                   = other.pNext;
@@ -828,7 +825,7 @@ PipelineCreateInfo::ViewportState::ViewportState (const ViewportState &other)
        pScissors       = &m_scissors[0];
 }
 
-PipelineCreateInfo::ViewportState & PipelineCreateInfo::ViewportState::operator= (const ViewportState &other)
+PipelineCreateInfo::ViewportState& PipelineCreateInfo::ViewportState::operator= (const ViewportState& other)
 {
        sType                   = other.sType;
        pNext                   = other.pNext;
@@ -874,7 +871,7 @@ PipelineCreateInfo::MultiSampleState::MultiSampleState (vk::VkSampleCountFlagBit
                                                                                                                vk::VkBool32                                                    _sampleShadingEnable,
                                                                                                                float                                                                   _minSampleShading,
                                                                                                                const std::vector<vk::VkSampleMask>&    _sampleMask,
-                                                                                                               bool                                                                    _alphaToCoverageEnable, 
+                                                                                                               bool                                                                    _alphaToCoverageEnable,
                                                                                                                bool                                                                    _alphaToOneEnable)
        : m_sampleMask(_sampleMask)
 {
@@ -889,21 +886,21 @@ PipelineCreateInfo::MultiSampleState::MultiSampleState (vk::VkSampleCountFlagBit
        alphaToOneEnable                = _alphaToOneEnable;
 }
 
-PipelineCreateInfo::MultiSampleState::MultiSampleState (const MultiSampleState &other)
+PipelineCreateInfo::MultiSampleState::MultiSampleState (const MultiSampleStateother)
 {
        sType                                   = other.sType;
        pNext                                   = other.pNext;
        rasterizationSamples    = other.rasterizationSamples;
        sampleShadingEnable             = other.sampleShadingEnable;
        minSampleShading                = other.minSampleShading;
-       
+
        const size_t sampleMaskArrayLen = (sizeof(vk::VkSampleMask) * 8 + other.rasterizationSamples) / (sizeof(vk::VkSampleMask) * 8);
 
        m_sampleMask    = std::vector<vk::VkSampleMask>(other.pSampleMask, other.pSampleMask + sampleMaskArrayLen);
        pSampleMask             = &m_sampleMask[0];
 }
 
-PipelineCreateInfo::MultiSampleState& PipelineCreateInfo::MultiSampleState::operator= (const MultiSampleState & other)
+PipelineCreateInfo::MultiSampleState& PipelineCreateInfo::MultiSampleState::operator= (const MultiSampleState& other)
 {
        sType = other.sType;
        pNext = other.pNext;
@@ -925,7 +922,7 @@ PipelineCreateInfo::ColorBlendState::ColorBlendState (const std::vector<vk::VkPi
        : m_attachments(_attachments)
 {
        sType = vk::VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
-       pNext = DE_NULL; 
+       pNext = DE_NULL;
        flags                                   = 0u;
        logicOpEnable                   = _logicOpEnable;
        logicOp                                 = _logicOp;
@@ -934,20 +931,20 @@ PipelineCreateInfo::ColorBlendState::ColorBlendState (const std::vector<vk::VkPi
 }
 
 PipelineCreateInfo::ColorBlendState::ColorBlendState (deUint32                                                                                 _attachmentCount,
-                                                                                                         const vk::VkPipelineColorBlendAttachmentState*        _attachments,
+                                                                                                         const vk::VkPipelineColorBlendAttachmentState*        _attachments,
                                                                                                          vk::VkBool32                                                                          _logicOpEnable,
                                                                                                          vk::VkLogicOp                                                                         _logicOp)
        : m_attachments(_attachments, _attachments + _attachmentCount)
 {
        sType = vk::VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
-       pNext   = DE_NULL; 
+       pNext   = DE_NULL;
        logicOpEnable                   = _logicOpEnable;
        logicOp                                 = _logicOp;
        attachmentCount                 = static_cast<deUint32>(m_attachments.size());
        pAttachments                    = &m_attachments[0];
 }
 
-PipelineCreateInfo::ColorBlendState::ColorBlendState (const vk::VkPipelineColorBlendStateCreateInfo &createInfo)
+PipelineCreateInfo::ColorBlendState::ColorBlendState (const vk::VkPipelineColorBlendStateCreateInfocreateInfo)
        : m_attachments (createInfo.pAttachments, createInfo.pAttachments + createInfo.attachmentCount)
 {
        sType = createInfo.sType;
@@ -958,7 +955,7 @@ PipelineCreateInfo::ColorBlendState::ColorBlendState (const vk::VkPipelineColorB
        pAttachments                    = &m_attachments[0];
 }
 
-PipelineCreateInfo::ColorBlendState::ColorBlendState (const ColorBlendState &createInfo, std::vector<float> _blendConstants)
+PipelineCreateInfo::ColorBlendState::ColorBlendState (const ColorBlendStatecreateInfo, std::vector<float> _blendConstants)
        : m_attachments (createInfo.pAttachments, createInfo.pAttachments + createInfo.attachmentCount)
 {
        sType = createInfo.sType;
@@ -1062,7 +1059,7 @@ PipelineCreateInfo::DynamicState::DynamicState (const DynamicState &other)
        pDynamicStates = &m_dynamicStates[0];
 }
 
-PipelineCreateInfo::DynamicState & PipelineCreateInfo::DynamicState::operator= (const DynamicState &other)
+PipelineCreateInfo::DynamicState& PipelineCreateInfo::DynamicState::operator= (const DynamicState& other)
 {
        sType = other.sType;
        pNext = other.pNext;
@@ -1094,7 +1091,7 @@ PipelineCreateInfo::PipelineCreateInfo (vk::VkPipelineLayout              _layout,
        pDynamicState           = DE_NULL;
 }
 
-PipelineCreateInfo& PipelineCreateInfo::addShader (const vk::VkPipelineShaderStageCreateInfo &shader)
+PipelineCreateInfo& PipelineCreateInfo::addShader (const vk::VkPipelineShaderStageCreateInfoshader)
 {
        m_shaders.push_back(shader);
 
@@ -1187,19 +1184,19 @@ PipelineCreateInfo& PipelineCreateInfo::addState (const vk::VkPipelineDynamicSta
 }
 
 SamplerCreateInfo::SamplerCreateInfo (vk::VkFilter                             _magFilter,
-                                                                        vk::VkFilter                           _minFilter,
-                                                                        vk::VkSamplerMipmapMode        _mipmapMode,
-                                                                        vk::VkSamplerAddressMode       _addressModeU,
-                                                                        vk::VkSamplerAddressMode       _addressModeV,
-                                                                        vk::VkSamplerAddressMode       _addressModeW,
-                                                                        float                                          _mipLodBias,
-                                                                        float                                          _maxAnisotropy,
-                                                                        vk::VkBool32                           _compareEnable,
-                                                                        vk::VkCompareOp                        _compareOp,
-                                                                        float                                          _minLod,
-                                                                        float                                          _maxLod,
-                                                                        vk::VkBorderColor                      _borderColor,
-                                                                        vk::VkBool32                           _unnormalizedCoordinates)
+                                                                         vk::VkFilter                          _minFilter,
+                                                                         vk::VkSamplerMipmapMode       _mipmapMode,
+                                                                         vk::VkSamplerAddressMode      _addressModeU,
+                                                                         vk::VkSamplerAddressMode      _addressModeV,
+                                                                         vk::VkSamplerAddressMode      _addressModeW,
+                                                                         float                                         _mipLodBias,
+                                                                         float                                         _maxAnisotropy,
+                                                                         vk::VkBool32                          _compareEnable,
+                                                                         vk::VkCompareOp                       _compareOp,
+                                                                         float                                         _minLod,
+                                                                         float                                         _maxLod,
+                                                                         vk::VkBorderColor                     _borderColor,
+                                                                         vk::VkBool32                          _unnormalizedCoordinates)
 {
        sType                                   = vk::VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
        pNext                                   = DE_NULL;
@@ -1219,6 +1216,5 @@ SamplerCreateInfo::SamplerCreateInfo (vk::VkFilter                                _magFilter,
        borderColor                             = _borderColor;
        unnormalizedCoordinates = _unnormalizedCoordinates;
 }
-
 } // Draw
 } // vkt
index 15ee661..aa6f16f 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _VKTDRAWCREATEINFO_UTIL_HPP
-#define _VKTDRAWCREATEINFO_UTIL_HPP
+#ifndef _VKTDRAWCREATEINFOUTIL_HPP
+#define _VKTDRAWCREATEINFOUTIL_HPP
 /*------------------------------------------------------------------------
  * Vulkan Conformance Tests
  * ------------------------
@@ -37,9 +37,7 @@
 
 #include "vkDefs.hpp"
 #include "tcuVector.hpp"
-
 #include "deSharedPtr.hpp"
-
 #include <vector>
 
 namespace vkt
@@ -50,86 +48,85 @@ namespace Draw
 class ImageSubresourceRange : public vk::VkImageSubresourceRange
 {
 public:
-       ImageSubresourceRange ( vk::VkImageAspectFlags  aspectMask,
-                                                       deUint32                                baseMipLevel    = 0,
-                                                       deUint32                                levelCount              = 1,
-                                                       deUint32                                baseArrayLayer  = 0,
-                                                       deUint32                                layerCount              = 1);
+       ImageSubresourceRange           (vk::VkImageAspectFlags aspectMask,
+                                                                deUint32                               baseMipLevel    = 0,
+                                                                deUint32                               levelCount              = 1,
+                                                                deUint32                               baseArrayLayer  = 0,
+                                                                deUint32                               layerCount              = 1);
 };
 
 class ComponentMapping : public vk::VkComponentMapping
 {
 public:
-       ComponentMapping (      vk::VkComponentSwizzle r = vk::VK_COMPONENT_SWIZZLE_R,
-                                               vk::VkComponentSwizzle g = vk::VK_COMPONENT_SWIZZLE_G,
-                                               vk::VkComponentSwizzle b = vk::VK_COMPONENT_SWIZZLE_B,
-                                               vk::VkComponentSwizzle a = vk::VK_COMPONENT_SWIZZLE_A);
+       ComponentMapping                        (vk::VkComponentSwizzle r = vk::VK_COMPONENT_SWIZZLE_R,
+                                                                vk::VkComponentSwizzle g = vk::VK_COMPONENT_SWIZZLE_G,
+                                                                vk::VkComponentSwizzle b = vk::VK_COMPONENT_SWIZZLE_B,
+                                                                vk::VkComponentSwizzle a = vk::VK_COMPONENT_SWIZZLE_A);
 };
 
 class ImageViewCreateInfo : public vk::VkImageViewCreateInfo
 {
 public:
-       ImageViewCreateInfo (           vk::VkImage                                             image,
-                                                               vk::VkImageViewType                             viewType,
-                                                               vk::VkFormat                                    format,
-                                               const   vk::VkImageSubresourceRange&    subresourceRange,
-                                               const   vk::VkComponentMapping&                 components                      = ComponentMapping(),
-                                                               vk::VkImageViewCreateFlags              flags                           = 0);
-
-       ImageViewCreateInfo (           vk::VkImage                                             image,
-                                                               vk::VkImageViewType                             viewType,
-                                                               vk::VkFormat                                    format,
-                                               const   vk::VkComponentMapping&                 components                      = ComponentMapping(),
-                                                               vk::VkImageViewCreateFlags              flags                           = 0);
+       ImageViewCreateInfo                     (vk::VkImage                                            image,
+                                                                vk::VkImageViewType                            viewType,
+                                                                vk::VkFormat                                           format,
+                                                                const vk::VkImageSubresourceRange&     subresourceRange,
+                                                                const vk::VkComponentMapping&          components                      = ComponentMapping(),
+                                                                vk::VkImageViewCreateFlags                     flags                           = 0);
+
+       ImageViewCreateInfo                     (vk::VkImage                                            image,
+                                                                vk::VkImageViewType                            viewType,
+                                                                vk::VkFormat                                           format,
+                                                                const vk::VkComponentMapping&          components                      = ComponentMapping(),
+                                                                vk::VkImageViewCreateFlags                     flags                           = 0);
 };
 
 class BufferViewCreateInfo : public vk::VkBufferViewCreateInfo
 {
 public:
-       BufferViewCreateInfo (  vk::VkBuffer            buffer,
-                                                       vk::VkFormat            format,
-                                                       vk::VkDeviceSize        offset,
-                                                       vk::VkDeviceSize        range);
+       BufferViewCreateInfo             (vk::VkBuffer          buffer,
+                                                                 vk::VkFormat          format,
+                                                                 vk::VkDeviceSize      offset,
+                                                                 vk::VkDeviceSize      range);
 };
 
 class BufferCreateInfo : public vk::VkBufferCreateInfo
 {
 public:
-       BufferCreateInfo (              vk::VkDeviceSize                        size,
-                                                       vk::VkBufferCreateFlags         usage,
-                                                       vk::VkSharingMode                       sharingMode                             = vk::VK_SHARING_MODE_EXCLUSIVE,
-                                                       deUint32                                        queueFamilyIndexCount   = 0,
-                                                       const   deUint32*                       pQueueFamilyIndices             = DE_NULL, 
-                                                       vk::VkBufferCreateFlags         flags                                   = 0);
+       BufferCreateInfo                        (vk::VkDeviceSize                       size,
+                                                                vk::VkBufferCreateFlags        usage,
+                                                                vk::VkSharingMode                      sharingMode                             = vk::VK_SHARING_MODE_EXCLUSIVE,
+                                                                deUint32                                       queueFamilyIndexCount   = 0,
+                                                                const deUint32*                        pQueueFamilyIndices             = DE_NULL,
+                                                                vk::VkBufferCreateFlags        flags                                   = 0);
 
-       BufferCreateInfo                        (const BufferCreateInfo &other);        
-       BufferCreateInfo &operator=     (const BufferCreateInfo &other);
+       BufferCreateInfo                        (const BufferCreateInfo&        other);
+       BufferCreateInfo& operator=     (const BufferCreateInfo&        other);
 
 private:
        std::vector<deUint32> m_queueFamilyIndices;
 };
 
-
 class ImageCreateInfo : public vk::VkImageCreateInfo
 {
 public:
-       ImageCreateInfo (               vk::VkImageType                         imageType,
-                                                       vk::VkFormat                            format,
-                                                       vk::VkExtent3D                          extent,
-                                                       deUint32                                        mipLevels,
-                                                       deUint32                                        arrayLayers,
-                                                       vk::VkSampleCountFlagBits       samples,
-                                                       vk::VkImageTiling                       tiling,
-                                                       vk::VkImageUsageFlags           usage,
-                                                       vk::VkSharingMode                       sharingMode                             = vk::VK_SHARING_MODE_EXCLUSIVE,
-                                                       deUint32                                        queueFamilyIndexCount   = 0,
-                                       const   deUint32*                                       pQueueFamilyIndices             = DE_NULL,
-                                                       vk::VkImageCreateFlags          flags                                   = 0, 
-                                                       vk::VkImageLayout                       initialLayout                   = vk::VK_IMAGE_LAYOUT_UNDEFINED);
+       ImageCreateInfo                         (vk::VkImageType                        imageType,
+                                                                vk::VkFormat                           format,
+                                                                vk::VkExtent3D                         extent,
+                                                                deUint32                                       mipLevels,
+                                                                deUint32                                       arrayLayers,
+                                                                vk::VkSampleCountFlagBits      samples,
+                                                                vk::VkImageTiling                      tiling,
+                                                                vk::VkImageUsageFlags          usage,
+                                                                vk::VkSharingMode                      sharingMode                             = vk::VK_SHARING_MODE_EXCLUSIVE,
+                                                                deUint32                                       queueFamilyIndexCount   = 0,
+                                                                const deUint32*                        pQueueFamilyIndices             = DE_NULL,
+                                                                vk::VkImageCreateFlags         flags                                   = 0,
+                                                                vk::VkImageLayout                      initialLayout                   = vk::VK_IMAGE_LAYOUT_UNDEFINED);
 
 private:
-       ImageCreateInfo                         (const ImageCreateInfo &other);
-       ImageCreateInfo &operator=      (const ImageCreateInfo &other);
+       ImageCreateInfo                         (const ImageCreateInfo&         other);
+       ImageCreateInfo& operator=      (const ImageCreateInfo&         other);
 
        std::vector<deUint32> m_queueFamilyIndices;
 };
@@ -137,58 +134,58 @@ private:
 class FramebufferCreateInfo : public vk::VkFramebufferCreateInfo
 {
 public:
-       FramebufferCreateInfo (                 vk::VkRenderPass                                renderPass,
-                                                       const   std::vector<vk::VkImageView>&   attachments,
-                                                                       deUint32                                                width,
-                                                                       deUint32                                                height,
-                                                                       deUint32                                                layers);
+       FramebufferCreateInfo           (vk::VkRenderPass                                               renderPass,
+                                                                const std::vector<vk::VkImageView>&    attachments,
+                                                                deUint32                                                               width,
+                                                                deUint32                                                               height,
+                                                                deUint32                                                               layers);
 };
 
 class AttachmentDescription : public vk::VkAttachmentDescription
 {
 public:
-       AttachmentDescription ( vk::VkFormat                            format,
-                                                       vk::VkSampleCountFlagBits       samples,
-                                                       vk::VkAttachmentLoadOp          loadOp,
-                                                       vk::VkAttachmentStoreOp         storeOp,
-                                                       vk::VkAttachmentLoadOp          stencilLoadOp,
-                                                       vk::VkAttachmentStoreOp         stencilStoreOp,
-                                                       vk::VkImageLayout                       initialLayout,
-                                                       vk::VkImageLayout                       finalLayout);
-
-       AttachmentDescription (const vk::VkAttachmentDescription &);
+       AttachmentDescription   (vk::VkFormat                           format,
+                                                        vk::VkSampleCountFlagBits      samples,
+                                                        vk::VkAttachmentLoadOp         loadOp,
+                                                        vk::VkAttachmentStoreOp        storeOp,
+                                                        vk::VkAttachmentLoadOp         stencilLoadOp,
+                                                        vk::VkAttachmentStoreOp        stencilStoreOp,
+                                                        vk::VkImageLayout                      initialLayout,
+                                                        vk::VkImageLayout                      finalLayout);
+
+       AttachmentDescription   (const vk::VkAttachmentDescription &);
 };
 
 class AttachmentReference : public vk::VkAttachmentReference
 {
 public:
-       AttachmentReference (deUint32 attachment, vk::VkImageLayout layout);
-       AttachmentReference (void);
+       AttachmentReference             (deUint32 attachment, vk::VkImageLayout layout);
+       AttachmentReference             (void);
 };
 
 class SubpassDescription : public vk::VkSubpassDescription
 {
 public:
-       SubpassDescription (            vk::VkPipelineBindPoint                 pipelineBindPoint,
-                                                               vk::VkSubpassDescriptionFlags   flags,
-                                                               deUint32                                                inputAttachmentCount,
-                                               const   vk::VkAttachmentReference*              inputAttachments,
-                                                               deUint32                                                colorAttachmentCount,
-                                               const   vk::VkAttachmentReference*              colorAttachments,
-                                               const   vk::VkAttachmentReference*              resolveAttachments,
-                                                               vk::VkAttachmentReference               depthStencilAttachment,
-                                                               deUint32                                                preserveAttachmentCount,
-                                               const   vk::VkAttachmentReference*              preserveAttachments);
-
-       SubpassDescription                              (const vk::VkSubpassDescription& other);
-       SubpassDescription                              (const SubpassDescription& other);
-       SubpassDescription& operator=   (const SubpassDescription& other);
+       SubpassDescription                              (vk::VkPipelineBindPoint                        pipelineBindPoint,
+                                                                        vk::VkSubpassDescriptionFlags          flags,
+                                                                        deUint32                                                       inputAttachmentCount,
+                                                                        const vk::VkAttachmentReference*       inputAttachments,
+                                                                        deUint32                                                       colorAttachmentCount,
+                                                                        const vk::VkAttachmentReference*       colorAttachments,
+                                                                        const vk::VkAttachmentReference*       resolveAttachments,
+                                                                        vk::VkAttachmentReference                      depthStencilAttachment,
+                                                                        deUint32                                                       preserveAttachmentCount,
+                                                                        const vk::VkAttachmentReference*       preserveAttachments);
+
+       SubpassDescription                              (const vk::VkSubpassDescription&        other);
+       SubpassDescription                              (const SubpassDescription&                      other);
+       SubpassDescription& operator=   (const SubpassDescription&                      other);
 
 private:
-       std::vector<vk::VkAttachmentReference>   m_inputAttachments;
-       std::vector<vk::VkAttachmentReference>   m_colorAttachments;
-       std::vector<vk::VkAttachmentReference>   m_resolveAttachments;
-       std::vector<vk::VkAttachmentReference>   m_preserveAttachments;
+       std::vector<vk::VkAttachmentReference>  m_inputAttachments;
+       std::vector<vk::VkAttachmentReference>  m_colorAttachments;
+       std::vector<vk::VkAttachmentReference>  m_resolveAttachments;
+       std::vector<vk::VkAttachmentReference>  m_preserveAttachments;
 
        vk::VkAttachmentReference                               m_depthStencilAttachment;
 };
@@ -210,20 +207,20 @@ public:
 class RenderPassCreateInfo : public vk::VkRenderPassCreateInfo
 {
 public:
-       RenderPassCreateInfo (  const std::vector<vk::VkAttachmentDescription>& attachments,
-                                                       const std::vector<vk::VkSubpassDescription>&    subpasses,
-                                                       const std::vector<vk::VkSubpassDependency>&             dependiences            = std::vector<vk::VkSubpassDependency>());
+       RenderPassCreateInfo (const std::vector<vk::VkAttachmentDescription>&   attachments,
+                                                 const std::vector<vk::VkSubpassDescription>&          subpasses,
+                                                 const std::vector<vk::VkSubpassDependency>&           dependiences            = std::vector<vk::VkSubpassDependency>());
 
-       RenderPassCreateInfo (                  deUint32 attachmentCount                                                = 0,
-                                                       const   vk::VkAttachmentDescription*    pAttachments    = DE_NULL,
-                                                                       deUint32                                                subpassCount    = 0,
-                                                       const   vk::VkSubpassDescription*               pSubpasses              = DE_NULL,
-                                                                       deUint32                                                dependencyCount = 0,
-                                                       const   vk::VkSubpassDependency*                pDependiences   = DE_NULL);
+       RenderPassCreateInfo (deUint32                                                                                  attachmentCount = 0,
+                                                 const vk::VkAttachmentDescription*                            pAttachments    = DE_NULL,
+                                                 deUint32                                                                                      subpassCount    = 0,
+                                                 const vk::VkSubpassDescription*                                       pSubpasses              = DE_NULL,
+                                                 deUint32                                                                                      dependencyCount = 0,
+                                                 const vk::VkSubpassDependency*                                        pDependiences   = DE_NULL);
 
-       void addAttachment      (vk::VkAttachmentDescription attachment);
-       void addSubpass         (vk::VkSubpassDescription subpass);
-       void addDependency      (vk::VkSubpassDependency dependency);
+       void addAttachment      (vk::VkAttachmentDescription                                            attachment);
+       void addSubpass         (vk::VkSubpassDescription                                                       subpass);
+       void addDependency      (vk::VkSubpassDependency                                                        dependency);
 
 private:
        std::vector<AttachmentDescription>                      m_attachments;
@@ -235,45 +232,44 @@ private:
        std::vector<vk::VkSubpassDependency>            m_dependiencesStructs;
 
        RenderPassCreateInfo                    (const RenderPassCreateInfo &other); //Not allowed!
-       RenderPassCreateInfo &operator= (const RenderPassCreateInfo &other); //Not allowed!
+       RenderPassCreateInfooperator= (const RenderPassCreateInfo &other); //Not allowed!
 };
 
 class RenderPassBeginInfo : public vk::VkRenderPassBeginInfo
 {
 public:
-       RenderPassBeginInfo (                   vk::VkRenderPass                                renderPass,
-                                                                       vk::VkFramebuffer                               framebuffer,
-                                                                       vk::VkRect2D                                    renderArea,
-                                                       const   std::vector<vk::VkClearValue>&  clearValues = std::vector<vk::VkClearValue>());
+       RenderPassBeginInfo (vk::VkRenderPass                                           renderPass,
+                                                vk::VkFramebuffer                                              framebuffer,
+                                                vk::VkRect2D                                                   renderArea,
+                                                const std::vector<vk::VkClearValue>&   clearValues = std::vector<vk::VkClearValue>());
 
 private:
        std::vector<vk::VkClearValue> m_clearValues;
 
-       RenderPassBeginInfo                             (const RenderPassBeginInfo &other); //Not allowed!
-       RenderPassBeginInfo &operator=  (const RenderPassBeginInfo &other); //Not allowed!
+       RenderPassBeginInfo                             (const RenderPassBeginInfo&     other); //Not allowed!
+       RenderPassBeginInfo& operator=  (const RenderPassBeginInfo&     other); //Not allowed!
 };
 
 class CmdPoolCreateInfo : public vk::VkCommandPoolCreateInfo
 {
 public:
-       CmdPoolCreateInfo (deUint32 queueFamilyIndex,
-               vk::VkCommandPoolCreateFlags flags = vk::VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT);
+       CmdPoolCreateInfo (deUint32                                             queueFamilyIndex,
+                                          vk::VkCommandPoolCreateFlags flags                           = vk::VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT);
 };
 
 class CmdBufferBeginInfo : public vk::VkCommandBufferBeginInfo
 {
 public:
-       CmdBufferBeginInfo (vk::VkCommandBufferUsageFlags               flags   = 0);
+       CmdBufferBeginInfo (vk::VkCommandBufferUsageFlags               flags                                   = 0);
        CmdBufferBeginInfo (vk::VkRenderPass                                    renderPass,
                                                deUint32                                                        subpass,
                                                vk::VkFramebuffer                                       framebuffer,
-                                               vk::VkCommandBufferUsageFlags           flags                                   = 0, 
+                                               vk::VkCommandBufferUsageFlags           flags                                   = 0,
                                                bool                                                            occlusionQueryEnable    = false,
                                                vk::VkQueryControlFlags                         queryFlags                              = 0u,
                                                vk::VkQueryPipelineStatisticFlags       pipelineStatistics              = 0u);
 };
 
-
 class DescriptorPoolSize : public vk::VkDescriptorPoolSize
 {
 public:
@@ -287,9 +283,9 @@ public:
 class DescriptorPoolCreateInfo : public vk::VkDescriptorPoolCreateInfo
 {
 public:
-       DescriptorPoolCreateInfo (      const   std::vector<vk::VkDescriptorPoolSize>&  poolSizeCounts,\r
-                                                                               vk::VkDescriptorPoolCreateFlags flags, \r
-                                                                               deUint32 maxSets);
+       DescriptorPoolCreateInfo (const std::vector<vk::VkDescriptorPoolSize>&  poolSizeCounts,
+                                                         vk::VkDescriptorPoolCreateFlags                               flags,
+                                                         deUint32                                                                              maxSets);
 
        DescriptorPoolCreateInfo& addDescriptors (vk::VkDescriptorType type, deUint32 count);
 
@@ -297,25 +293,23 @@ private:
        std::vector<vk::VkDescriptorPoolSize> m_poolSizeCounts;
 };
 
-
 class DescriptorSetLayoutCreateInfo : public vk::VkDescriptorSetLayoutCreateInfo
 {
 public:
        DescriptorSetLayoutCreateInfo (deUint32 bindingCount, const vk::VkDescriptorSetLayoutBinding* pBindings);
 };
 
-
 class PipelineLayoutCreateInfo : public vk::VkPipelineLayoutCreateInfo
 {
 public:
-       PipelineLayoutCreateInfo (                      deUint32 descriptorSetCount,
-                                                               const   vk::VkDescriptorSetLayout*                              pSetLayouts,
-                                                                               deUint32                                                                pushConstantRangeCount  = 0,
-                                                                               const vk::VkPushConstantRange*                  pPushConstantRanges             = DE_NULL);
+       PipelineLayoutCreateInfo (deUint32                                                                              descriptorSetCount,
+                                                         const vk::VkDescriptorSetLayout*                              pSetLayouts,
+                                                                         deUint32                                                                              pushConstantRangeCount  = 0,
+                                                         const vk::VkPushConstantRange*                                pPushConstantRanges             = DE_NULL);
 
-       PipelineLayoutCreateInfo (      const   std::vector<vk::VkDescriptorSetLayout>& setLayouts                              = std::vector<vk::VkDescriptorSetLayout>(),
-                                                                               deUint32                                                                pushConstantRangeCount  = 0,
-                                                               const   vk::VkPushConstantRange*                                pPushConstantRanges             = DE_NULL);
+       PipelineLayoutCreateInfo (const std::vector<vk::VkDescriptorSetLayout>& setLayouts                              = std::vector<vk::VkDescriptorSetLayout>(),
+                                                         deUint32                                                                              pushConstantRangeCount  = 0,
+                                                         const vk::VkPushConstantRange*                                pPushConstantRanges             = DE_NULL);
 
 private:
        std::vector<vk::VkDescriptorSetLayout>  m_setLayouts;
@@ -328,10 +322,10 @@ public:
        class VertexInputState : public vk::VkPipelineVertexInputStateCreateInfo
        {
        public:
-               VertexInputState (                      deUint32                                                                vertexBindingDescriptionCount   = 0,
-                                                       const   vk::VkVertexInputBindingDescription*    pVertexBindingDescriptions              = NULL,
-                                                                       deUint32                                                                vertexAttributeDescriptionCount = 0,
-                                                       const   vk::VkVertexInputAttributeDescription*  pVertexAttributeDescriptions    = NULL);
+               VertexInputState (deUint32                                                                              vertexBindingDescriptionCount   = 0,
+                                                 const vk::VkVertexInputBindingDescription*    pVertexBindingDescriptions              = NULL,
+                                                 deUint32                                                                              vertexAttributeDescriptionCount = 0,
+                                                 const vk::VkVertexInputAttributeDescription*  pVertexAttributeDescriptions    = NULL);
        };
 
        class InputAssemblerState : public vk::VkPipelineInputAssemblyStateCreateInfo
@@ -349,12 +343,12 @@ public:
        class ViewportState : public vk::VkPipelineViewportStateCreateInfo
        {
        public:
-               ViewportState ( deUint32                                        viewportCount,
-                                               std::vector<vk::VkViewport> viewports           = std::vector<vk::VkViewport>(0),
-                                               std::vector<vk::VkRect2D>       scissors                = std::vector<vk::VkRect2D>(0));
+               ViewportState                           (deUint32                                               viewportCount,
+                                                                        std::vector<vk::VkViewport>    viewports               = std::vector<vk::VkViewport>(0),
+                                                                        std::vector<vk::VkRect2D>              scissors                = std::vector<vk::VkRect2D>(0));
 
-               ViewportState                           (const ViewportState &other);
-               ViewportState &operator=                (const ViewportState &other);
+               ViewportState                           (const ViewportState&                   other);
+               ViewportState& operator=        (const ViewportState&                   other);
 
                std::vector<vk::VkViewport> m_viewports;
                std::vector<vk::VkRect2D>       m_scissors;
@@ -363,30 +357,30 @@ public:
        class RasterizerState : public vk::VkPipelineRasterizationStateCreateInfo
        {
        public:
-               RasterizerState (       vk::VkBool32            depthClampEnable                = false,
-                                                       vk::VkBool32            rasterizerDiscardEnable = false,
-                                                       vk::VkPolygonMode       polygonMode                             = vk::VK_POLYGON_MODE_FILL,
-                                                       vk::VkCullModeFlags     cullMode                                = vk::VK_CULL_MODE_NONE,
-                                                       vk::VkFrontFace         frontFace                               = vk::VK_FRONT_FACE_CLOCKWISE,
-                                                       vk::VkBool32            depthBiasEnable                 = true,\r
-                                                       float                           depthBiasConstantFactor = 0.0f,
-                                                       float                           depthBiasClamp                  = 0.0f,
-                                                       float                           depthBiasSlopeFactor    = 0.0f,
-                                                       float                           lineWidth                               = 1.0f);
+               RasterizerState (vk::VkBool32                   depthClampEnable                = false,
+                                                vk::VkBool32                   rasterizerDiscardEnable = false,
+                                                vk::VkPolygonMode              polygonMode                             = vk::VK_POLYGON_MODE_FILL,
+                                                vk::VkCullModeFlags    cullMode                                = vk::VK_CULL_MODE_NONE,
+                                                vk::VkFrontFace                frontFace                               = vk::VK_FRONT_FACE_CLOCKWISE,
+                                                vk::VkBool32                   depthBiasEnable                 = true,
+                                                float                                  depthBiasConstantFactor = 0.0f,
+                                                float                                  depthBiasClamp                  = 0.0f,
+                                                float                                  depthBiasSlopeFactor    = 0.0f,
+                                                float                                  lineWidth                               = 1.0f);
        };
 
        class MultiSampleState : public vk::VkPipelineMultisampleStateCreateInfo
        {
        public:
-               MultiSampleState (                      vk::VkSampleCountFlagBits               rasterizationSamples            = vk::VK_SAMPLE_COUNT_1_BIT,
-                                                                       vk::VkBool32                                    sampleShadingEnable                     = false,
-                                                                       float                                                   minSampleShading                        = 0.0f,
-                                                       const   std::vector<vk::VkSampleMask>&  sampleMask                                      = std::vector<vk::VkSampleMask>(1, 0xffffffff), 
-                                                       bool                                                                    alphaToCoverageEnable           = false,
-                                                       bool                                                                    alphaToOneEnable                        = false);
+               MultiSampleState                        (vk::VkSampleCountFlagBits                              rasterizationSamples            = vk::VK_SAMPLE_COUNT_1_BIT,
+                                                                        vk::VkBool32                                                   sampleShadingEnable                     = false,
+                                                                        float                                                                  minSampleShading                        = 0.0f,
+                                                                        const std::vector<vk::VkSampleMask>&   sampleMask                                      = std::vector<vk::VkSampleMask>(1, 0xffffffff),
+                                                                        bool                                                                   alphaToCoverageEnable           = false,
+                                                                        bool                                                                   alphaToOneEnable                        = false);
 
-               MultiSampleState                        (const MultiSampleState &other);
-               MultiSampleState &operator= (const MultiSampleState &other);
+               MultiSampleState                        (const MultiSampleState&                                other);
+               MultiSampleState& operator= (const MultiSampleState&                            other);
 
        private:
                std::vector<vk::VkSampleMask> m_sampleMask;
@@ -405,20 +399,21 @@ public:
                                                vk::VkBlendFactor       srcAlphaBlendFactor     = vk::VK_BLEND_FACTOR_SRC_COLOR,
                                                vk::VkBlendFactor       dstAlphaBlendFactor     = vk::VK_BLEND_FACTOR_DST_COLOR,
                                                vk::VkBlendOp           alphaBlendOp            = vk::VK_BLEND_OP_ADD,
-                                               deUint8                         colorWriteMask  = 0xff);
+                                               deUint8                         colorWriteMask          = 0xff);
                };
 
-               ColorBlendState (       const   std::vector<vk::VkPipelineColorBlendAttachmentState>&   attachments,
-                                                                       vk::VkBool32                                                                                    alphaToCoverageEnable   = false,
-                                                                       vk::VkLogicOp                                                                                   logicOp                                 = vk::VK_LOGIC_OP_COPY);
+               ColorBlendState (const std::vector<vk::VkPipelineColorBlendAttachmentState>&    attachments,
+                                                vk::VkBool32                                                                                                   alphaToCoverageEnable   = false,
+                                                vk::VkLogicOp                                                                                                  logicOp                                 = vk::VK_LOGIC_OP_COPY);
 
-               ColorBlendState (                       deUint32                                                                                                attachmentCount,
-                                                       const   vk::VkPipelineColorBlendAttachmentState*                                attachments,
-                                                                       vk::VkBool32                                                                                    logicOpEnable                   = false,
-                                                                       vk::VkLogicOp                                                                                   logicOp                                 = vk::VK_LOGIC_OP_COPY);
+               ColorBlendState (deUint32                                                                                                               attachmentCount,
+                                                const vk::VkPipelineColorBlendAttachmentState*                                 attachments,
+                                                vk::VkBool32                                                                                                   logicOpEnable                   = false,
+                                                vk::VkLogicOp                                                                                                  logicOp                                 = vk::VK_LOGIC_OP_COPY);
 
-               ColorBlendState (const vk::VkPipelineColorBlendStateCreateInfo &createInfo);
-               ColorBlendState (const ColorBlendState &createInfo, std::vector<float> blendConstants = std::vector<float>(4));
+               ColorBlendState (const vk::VkPipelineColorBlendStateCreateInfo&                                 createInfo);
+               ColorBlendState (const ColorBlendState&                                                                                 createInfo,
+                                                std::vector<float>                                                                                             blendConstants                  = std::vector<float>(4));
 
        private:
                std::vector<vk::VkPipelineColorBlendAttachmentState> m_attachments;
@@ -430,56 +425,59 @@ public:
                class StencilOpState : public vk::VkStencilOpState
                {
                public:
-                       StencilOpState (vk::VkStencilOp failOp          = vk::VK_STENCIL_OP_REPLACE,
-                                                       vk::VkStencilOp passOp          = vk::VK_STENCIL_OP_REPLACE,
-                                                       vk::VkStencilOp depthFailOp     = vk::VK_STENCIL_OP_REPLACE,
-                                                       vk::VkCompareOp compareOp       = vk::VK_COMPARE_OP_ALWAYS,
-                                                       deUint32                compareMask     = 0xffffffffu,\r
-                                                       deUint32                writeMask       = 0xffffffffu,\r
-                                                       deUint32                reference       = 0);
+                       StencilOpState (vk::VkStencilOp failOp                                  = vk::VK_STENCIL_OP_REPLACE,
+                                                       vk::VkStencilOp passOp                                  = vk::VK_STENCIL_OP_REPLACE,
+                                                       vk::VkStencilOp depthFailOp                             = vk::VK_STENCIL_OP_REPLACE,
+                                                       vk::VkCompareOp compareOp                               = vk::VK_COMPARE_OP_ALWAYS,
+                                                       deUint32                compareMask                             = 0xffffffffu,
+                                                       deUint32                writeMask                               = 0xffffffffu,
+                                                       deUint32                reference                               = 0);
                };
 
-               DepthStencilState (     vk::VkBool32    depthTestEnable                 = false,
-                                                       vk::VkBool32    depthWriteEnable                = false,
-                                                       vk::VkCompareOp depthCompareOp                  = vk::VK_COMPARE_OP_ALWAYS,
-                                                       vk::VkBool32    depthBoundsTestEnable   = false,
-                                                       vk::VkBool32    stencilTestEnable               = false,
-                                                       StencilOpState  front                                   = StencilOpState(),
-                                                       StencilOpState  back                                    = StencilOpState(),
-                                                       float                   minDepthBounds                  = -1.0f,
-                                                       float                   maxDepthBounds                  = 1.0f);
+               DepthStencilState (vk::VkBool32         depthTestEnable                 = false,
+                                                  vk::VkBool32         depthWriteEnable                = false,
+                                                  vk::VkCompareOp      depthCompareOp                  = vk::VK_COMPARE_OP_ALWAYS,
+                                                  vk::VkBool32         depthBoundsTestEnable   = false,
+                                                  vk::VkBool32         stencilTestEnable               = false,
+                                                  StencilOpState       front                                   = StencilOpState(),
+                                                  StencilOpState       back                                    = StencilOpState(),
+                                                  float                        minDepthBounds                  = -1.0f,
+                                                  float                        maxDepthBounds                  = 1.0f);
        };
 
        class PipelineShaderStage : public vk::VkPipelineShaderStageCreateInfo
        {
        public:
-               PipelineShaderStage (vk::VkShaderModule shaderModule, const char* _pName, vk::VkShaderStageFlagBits stage);
+               PipelineShaderStage (vk::VkShaderModule shaderModule, const char* pName, vk::VkShaderStageFlagBits stage);
        };
 
        class DynamicState : public vk::VkPipelineDynamicStateCreateInfo
        {
        public:
-               DynamicState (const std::vector<vk::VkDynamicState>& dynamicStates = std::vector<vk::VkDynamicState>(0));
+               DynamicState                    (const std::vector<vk::VkDynamicState>& dynamicStates = std::vector<vk::VkDynamicState>(0));
 
-               DynamicState                    (const DynamicState &other);
-               DynamicState &operator= (const DynamicState &other);
+               DynamicState                    (const DynamicStateother);
+               DynamicState& operator= (const DynamicState& other);
 
                std::vector<vk::VkDynamicState> m_dynamicStates;
        };
 
-       PipelineCreateInfo(vk::VkPipelineLayout layout, vk::VkRenderPass renderPass, int subpass, vk::VkPipelineCreateFlags flags);
+       PipelineCreateInfo                              (vk::VkPipelineLayout                                                           layout,
+                                                                    vk::VkRenderPass                                                                   renderPass,
+                                                                        int                                                                                            subpass,
+                                                                        vk::VkPipelineCreateFlags                                                      flags);
 
-       PipelineCreateInfo& addShader (const vk::VkPipelineShaderStageCreateInfo&               shader);
+       PipelineCreateInfo& addShader   (const vk::VkPipelineShaderStageCreateInfo&                     shader);
 
-       PipelineCreateInfo& addState (const vk::VkPipelineVertexInputStateCreateInfo&   state);
-       PipelineCreateInfo& addState (const vk::VkPipelineInputAssemblyStateCreateInfo& state);
-       PipelineCreateInfo& addState (const vk::VkPipelineColorBlendStateCreateInfo&    state);
-       PipelineCreateInfo& addState (const vk::VkPipelineViewportStateCreateInfo&              state);
-       PipelineCreateInfo& addState (const vk::VkPipelineDepthStencilStateCreateInfo&  state);
-       PipelineCreateInfo& addState (const vk::VkPipelineTessellationStateCreateInfo&  state);
-       PipelineCreateInfo& addState (const vk::VkPipelineRasterizationStateCreateInfo&         state);
-       PipelineCreateInfo& addState (const vk::VkPipelineMultisampleStateCreateInfo&   state);
-       PipelineCreateInfo& addState (const vk::VkPipelineDynamicStateCreateInfo&                               state);
+       PipelineCreateInfo& addState    (const vk::VkPipelineVertexInputStateCreateInfo&        state);
+       PipelineCreateInfo& addState    (const vk::VkPipelineInputAssemblyStateCreateInfo&      state);
+       PipelineCreateInfo& addState    (const vk::VkPipelineColorBlendStateCreateInfo&         state);
+       PipelineCreateInfo& addState    (const vk::VkPipelineViewportStateCreateInfo&           state);
+       PipelineCreateInfo& addState    (const vk::VkPipelineDepthStencilStateCreateInfo&       state);
+       PipelineCreateInfo& addState    (const vk::VkPipelineTessellationStateCreateInfo&       state);
+       PipelineCreateInfo& addState    (const vk::VkPipelineRasterizationStateCreateInfo&      state);
+       PipelineCreateInfo& addState    (const vk::VkPipelineMultisampleStateCreateInfo&        state);
+       PipelineCreateInfo& addState    (const vk::VkPipelineDynamicStateCreateInfo&            state);
 
 private:
        std::vector<vk::VkPipelineShaderStageCreateInfo>                m_shaders;
@@ -495,34 +493,34 @@ private:
        vk::VkPipelineMultisampleStateCreateInfo                                m_multisampleState;
        vk::VkPipelineDynamicStateCreateInfo                                    m_dynamicState;
 
-       std::vector<vk::VkDynamicState> m_dynamicStates;
+       std::vector<vk::VkDynamicState>                                                 m_dynamicStates;
 
-       std::vector<vk::VkViewport>             m_viewports;
-       std::vector<vk::VkRect2D>               m_scissors;
+       std::vector<vk::VkViewport>                                                             m_viewports;
+       std::vector<vk::VkRect2D>                                                               m_scissors;
 
-       std::vector<vk::VkSampleMask>   m_multisampleStateSampleMask;
+       std::vector<vk::VkSampleMask>                                                   m_multisampleStateSampleMask;
 };
 
 class SamplerCreateInfo : public vk::VkSamplerCreateInfo
 {
 public:
-       SamplerCreateInfo (     vk::VkFilter                            magFilter                               = vk::VK_FILTER_NEAREST,
-                                               vk::VkFilter                            minFilter                               = vk::VK_FILTER_NEAREST,
-                                               vk::VkSamplerMipmapMode         mipmapMode                              = vk::VK_SAMPLER_MIPMAP_MODE_NEAREST,
-                                               vk::VkSamplerAddressMode        addressU                                = vk::VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT,
-                                               vk::VkSamplerAddressMode        addressV                                = vk::VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT,
-                                               vk::VkSamplerAddressMode        addressW                                = vk::VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT,
-                                               float                                           mipLodBias                              = 0.0f,
-                                               float                                           maxAnisotropy                   = 1.0f,
-                                               vk::VkBool32                            compareEnable                   = false,
-                                               vk::VkCompareOp                         compareOp                               = vk::VK_COMPARE_OP_ALWAYS,
-                                               float                                           minLod                                  = 0.0f,
-                                               float                                           maxLod                                  = 16.0f,
-                                               vk::VkBorderColor                       borderColor                             = vk::VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE, 
-                                               vk::VkBool32                            unnormalizedCoordinates = false);
+       SamplerCreateInfo (vk::VkFilter                         magFilter                               = vk::VK_FILTER_NEAREST,
+                                          vk::VkFilter                         minFilter                               = vk::VK_FILTER_NEAREST,
+                                          vk::VkSamplerMipmapMode      mipmapMode                              = vk::VK_SAMPLER_MIPMAP_MODE_NEAREST,
+                                          vk::VkSamplerAddressMode     addressU                                = vk::VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT,
+                                          vk::VkSamplerAddressMode     addressV                                = vk::VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT,
+                                          vk::VkSamplerAddressMode     addressW                                = vk::VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT,
+                                          float                                        mipLodBias                              = 0.0f,
+                                          float                                        maxAnisotropy                   = 1.0f,
+                                          vk::VkBool32                         compareEnable                   = false,
+                                          vk::VkCompareOp                      compareOp                               = vk::VK_COMPARE_OP_ALWAYS,
+                                          float                                        minLod                                  = 0.0f,
+                                          float                                        maxLod                                  = 16.0f,
+                                          vk::VkBorderColor            borderColor                             = vk::VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE,
+                                          vk::VkBool32                         unnormalizedCoordinates = false);
 };
 
 } // Draw
 } // vkt
 
-#endif // _VKTDRAWCREATEINFO_UTIL_HPP
+#endif // _VKTDRAWCREATEINFOUTIL_HPP
index ee558cd..2fd4d4c 100644 (file)
@@ -55,28 +55,31 @@ void MemoryOp::pack (int                            pixelSize,
                                         int                            width,
                                         int                            height,
                                         int                            depth,
-                                        vk::VkDeviceSize       rowPitch,
-                                        vk::VkDeviceSize       depthPitch,
+                                        vk::VkDeviceSize       rowPitchOrZero,
+                                        vk::VkDeviceSize       depthPitchOrZero,
                                         const void *           srcBuffer,
                                         void *                         destBuffer)
 {
-       if (rowPitch == 0) 
+       vk::VkDeviceSize rowPitch       = rowPitchOrZero;
+       vk::VkDeviceSize depthPitch     = depthPitchOrZero;
+
+       if (rowPitch == 0)
                rowPitch = width * pixelSize;
 
-       if (depthPitch == 0) 
+       if (depthPitch == 0)
                depthPitch = rowPitch * height;
 
        const vk::VkDeviceSize size = depthPitch * depth;
 
-       const char *srcRow = reinterpret_cast<const char *>(srcBuffer);
-       const char *srcStart;
+       const deUint8* srcRow = reinterpret_cast<const deUint8*>(srcBuffer);
+       const deUint8* srcStart;
        srcStart = srcRow;
-       char *dstRow = reinterpret_cast<char *>(destBuffer);
-       char *dstStart;
+       deUint8* dstRow = reinterpret_cast<deUint8 *>(destBuffer);
+       deUint8* dstStart;
        dstStart = dstRow;
 
        if (rowPitch == static_cast<vk::VkDeviceSize>(width * pixelSize) &&
-               depthPitch == static_cast<vk::VkDeviceSize>(rowPitch * height)) 
+               depthPitch == static_cast<vk::VkDeviceSize>(rowPitch * height))
        {
                // fast path
                deMemcpy(dstRow, srcRow, static_cast<size_t>(size));
@@ -90,7 +93,7 @@ void MemoryOp::pack (int                              pixelSize,
                        vk::VkDeviceSize offsetDepthSrc = d * (pixelSize * width * height);
                        srcRow = srcStart + offsetDepthSrc;
                        dstRow = dstStart + offsetDepthDst;
-                       for (int r = 0; r < height; ++r) 
+                       for (int r = 0; r < height; ++r)
                        {
                                deMemcpy(dstRow, srcRow, static_cast<size_t>(rowPitch));
                                srcRow += pixelSize * width;
@@ -104,28 +107,31 @@ void MemoryOp::unpack (int                                        pixelSize,
                                           int                                  width,
                                           int                                  height,
                                           int                                  depth,
-                                          vk::VkDeviceSize             rowPitch,
-                                          vk::VkDeviceSize             depthPitch,
+                                          vk::VkDeviceSize             rowPitchOrZero,
+                                          vk::VkDeviceSize             depthPitchOrZero,
                                           const void *                 srcBuffer,
                                           void *                               destBuffer)
 {
+       vk::VkDeviceSize rowPitch       = rowPitchOrZero;
+       vk::VkDeviceSize depthPitch = depthPitchOrZero;
+
        if (rowPitch == 0)
                rowPitch = width * pixelSize;
 
-       if (depthPitch == 0) 
+       if (depthPitch == 0)
                depthPitch = rowPitch * height;
 
        const vk::VkDeviceSize size = depthPitch * depth;
 
-       const char *srcRow = reinterpret_cast<const char *>(srcBuffer);
-       const char *srcStart;
+       const deUint8* srcRow = reinterpret_cast<const deUint8*>(srcBuffer);
+       const deUint8* srcStart;
        srcStart = srcRow;
-       char *dstRow = reinterpret_cast<char *>(destBuffer);
-       char *dstStart;
+       deUint8* dstRow = reinterpret_cast<deUint8*>(destBuffer);
+       deUint8* dstStart;
        dstStart = dstRow;
 
        if (rowPitch == static_cast<vk::VkDeviceSize>(width * pixelSize) &&
-               depthPitch == static_cast<vk::VkDeviceSize>(rowPitch * height)) 
+               depthPitch == static_cast<vk::VkDeviceSize>(rowPitch * height))
        {
                // fast path
                deMemcpy(dstRow, srcRow, static_cast<size_t>(size));
@@ -138,7 +144,7 @@ void MemoryOp::unpack (int                                  pixelSize,
                        vk::VkDeviceSize offsetDepthSrc = d * depthPitch;
                        srcRow = srcStart + offsetDepthSrc;
                        dstRow = dstStart + offsetDepthDst;
-                       for (int r = 0; r < height; ++r) 
+                       for (int r = 0; r < height; ++r)
                        {
                                deMemcpy(dstRow, srcRow, static_cast<size_t>(pixelSize * width));
                                srcRow += rowPitch;
@@ -148,10 +154,10 @@ void MemoryOp::unpack (int                                        pixelSize,
        }
 }
 
-Image::Image (const vk::DeviceInterface &vk,
+Image::Image (const vk::DeviceInterfacevk,
                          vk::VkDevice                          device,
                          vk::VkFormat                          format,
-                         const vk::VkExtent3D          &extend,
+                         const vk::VkExtent3D&         extend,
                          deUint32                                      levelCount,
                          deUint32                                      layerCount,
                          vk::Move<vk::VkImage>         object)
@@ -252,8 +258,7 @@ void Image::read (vk::VkQueue                                       queue,
                                  vk::VkImageType                               type,
                                  void *                                                data)
 {
-       if (layout != vk::VK_IMAGE_LAYOUT_GENERAL && layout != vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL) 
-               TCU_FAIL("Image::uploadFromSurface usage error: this function is not going to change Image layout!");
+       DE_ASSERT(layout == vk::VK_IMAGE_LAYOUT_GENERAL || layout == vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
 
        de::SharedPtr<Image> stagingResource = copyToLinearImage(queue, allocator, layout, offset, width,
                                                                                                                         height, depth, mipLevel, arrayElement, aspect, type);
@@ -273,8 +278,7 @@ void Image::readUsingBuffer (vk::VkQueue                            queue,
                                                         vk::VkImageAspectFlagBits      aspect,
                                                         void *                                         data)
 {
-       if (layout != vk::VK_IMAGE_LAYOUT_GENERAL && layout != vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL) 
-               TCU_FAIL("Image::uploadFromSurface usage error: this function is not going to change Image layout!");
+       DE_ASSERT(layout == vk::VK_IMAGE_LAYOUT_GENERAL || layout == vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);;
 
        de::SharedPtr<Buffer> stagingResource;
 
@@ -307,7 +311,7 @@ void Image::readUsingBuffer (vk::VkQueue                            queue,
        stagingResource = Buffer::createAndAlloc(m_vk, m_device, stagingBufferResourceCreateInfo, allocator, vk::MemoryRequirement::HostVisible);
 
        {
-               #pragma message("Get queue family index")
+               //todo [scygan] get proper queueFamilyIndex
                CmdPoolCreateInfo copyCmdPoolCreateInfo(0);
                vk::Unique<vk::VkCommandPool> copyCmdPool(vk::createCommandPool(m_vk, m_device, &copyCmdPoolCreateInfo));
 
@@ -347,11 +351,11 @@ void Image::readUsingBuffer (vk::VkQueue                          queue,
 
                        void* barriers[] = { &barrier };
 
-                       m_vk.cmdPipelineBarrier(*copyCmdBuffer, vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 
+                       m_vk.cmdPipelineBarrier(*copyCmdBuffer, vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
                                false, DE_LENGTH_OF_ARRAY(barriers), barriers);
                }
 
-               vk::VkBufferImageCopy region = 
+               vk::VkBufferImageCopy region =
                {
                        0, 0, 0,
                        { aspect, mipLevel, arrayElement, 1 },
@@ -366,11 +370,11 @@ void Image::readUsingBuffer (vk::VkQueue                          queue,
                {
                        vk::VK_STRUCTURE_TYPE_SUBMIT_INFO,      // VkStructureType                      sType;\r
                        DE_NULL,                                                        // const void*                          pNext;\r
-                       0,                                                                      // deUint32                                     waitSemaphoreCount;\r
-                       DE_NULL,                                                        // const VkSemaphore*           pWaitSemaphores;\r
-                       1,                                                                      // deUint32                                     commandBufferCount;\r
+                       0,                                                                              // deUint32                                     waitSemaphoreCount;\r
+                       DE_NULL,                                                                // const VkSemaphore*           pWaitSemaphores;\r
+                       1,                                                                              // deUint32                                     commandBufferCount;\r
                        &copyCmdBuffer.get(),                           // const VkCommandBuffer*       pCommandBuffers;\r
-                       0,                                                                      // deUint32                                     signalSemaphoreCount;\r
+                       0,                                                                              // deUint32                                     signalSemaphoreCount;\r
                        DE_NULL                                                         // const VkSemaphore*           pSignalSemaphores;\r
                };
                m_vk.queueSubmit(queue, 1, &submitInfo, DE_NULL);
@@ -379,7 +383,7 @@ void Image::readUsingBuffer (vk::VkQueue                            queue,
                VK_CHECK(m_vk.queueWaitIdle(queue));
        }
 
-       char* destPtr = reinterpret_cast<char*>(stagingResource->getBoundMemory().getHostPtr());
+       deUint8* destPtr = reinterpret_cast<deUint8*>(stagingResource->getBoundMemory().getHostPtr());
        deMemcpy(data, destPtr, bufferSize);
 }
 
@@ -411,7 +415,7 @@ void Image::readLinear (vk::VkOffset3D                              offset,
 
        m_vk.getImageSubresourceLayout(m_device, object(), &imageSubResource, &imageLayout);
 
-       const char* srcPtr = reinterpret_cast<const char*>(getBoundMemory().getHostPtr());
+       const deUint8* srcPtr = reinterpret_cast<const deUint8*>(getBoundMemory().getHostPtr());
        srcPtr += imageLayout.offset + getPixelOffset(offset, imageLayout.rowPitch, imageLayout.depthPitch, mipLevel, arrayElement);
 
        MemoryOp::unpack(vk::mapVkFormat(m_format).getPixelSize(), width, height, depth,
@@ -433,14 +437,13 @@ de::SharedPtr<Image> Image::copyToLinearImage (vk::VkQueue                                        queue,
        de::SharedPtr<Image> stagingResource;
        {
                vk::VkExtent3D stagingExtent = {width, height, depth};
-               ImageCreateInfo stagingResourceCreateInfo(
-                       type, m_format, stagingExtent, 1, 1, vk::VK_SAMPLE_COUNT_1_BIT,
-                       vk::VK_IMAGE_TILING_LINEAR, vk::VK_IMAGE_USAGE_TRANSFER_DST_BIT);
+               ImageCreateInfo stagingResourceCreateInfo(type, m_format, stagingExtent, 1, 1, vk::VK_SAMPLE_COUNT_1_BIT,
+                                                                                                 vk::VK_IMAGE_TILING_LINEAR, vk::VK_IMAGE_USAGE_TRANSFER_DST_BIT);
 
                stagingResource = Image::createAndAlloc(m_vk, m_device, stagingResourceCreateInfo, allocator,
-                       vk::MemoryRequirement::HostVisible);
+                                                                                               vk::MemoryRequirement::HostVisible);
 
-               #pragma message("Get queue family index")
+               //todo [scygan] get proper queueFamilyIndex
                CmdPoolCreateInfo copyCmdPoolCreateInfo(0);
                vk::Unique<vk::VkCommandPool> copyCmdPool(vk::createCommandPool(m_vk, m_device, &copyCmdPoolCreateInfo));
 
@@ -469,11 +472,11 @@ de::SharedPtr<Image> Image::copyToLinearImage (vk::VkQueue                                        queue,
                {
                        vk::VK_STRUCTURE_TYPE_SUBMIT_INFO,      // VkStructureType                      sType;\r
                        DE_NULL,                                                        // const void*                          pNext;\r
-                       0,                                                                      // deUint32                                     waitSemaphoreCount;\r
-                       DE_NULL,                                                        // const VkSemaphore*           pWaitSemaphores;\r
-                       1,                                                                      // deUint32                                     commandBufferCount;\r
+                       0,                                                                              // deUint32                                     waitSemaphoreCount;\r
+                       DE_NULL,                                                                // const VkSemaphore*           pWaitSemaphores;\r
+                       1,                                                                              // deUint32                                     commandBufferCount;\r
                        &copyCmdBuffer.get(),                           // const VkCommandBuffer*       pCommandBuffers;\r
-                       0,                                                                      // deUint32                                     signalSemaphoreCount;\r
+                       0,                                                                              // deUint32                                     signalSemaphoreCount;\r
                        DE_NULL                                                         // const VkSemaphore*           pSignalSemaphores;\r
                };
                m_vk.queueSubmit(queue, 1, &submitInfo, DE_NULL);
@@ -486,7 +489,7 @@ de::SharedPtr<Image> Image::copyToLinearImage (vk::VkQueue                                  queue,
 
 void Image::uploadVolume(const tcu::ConstPixelBufferAccess&    access,
                                                 vk::VkQueue                                            queue,
-                                                vk::Allocator&                                                 allocator,
+                                                vk::Allocator&                                                 allocator,
                                                 vk::VkImageLayout                                      layout,
                                                 vk::VkOffset3D                                         offset,
                                                 vk::VkImageAspectFlagBits                      aspect,
@@ -508,7 +511,7 @@ void Image::uploadVolume(const tcu::ConstPixelBufferAccess& access,
 
 void Image::uploadSurface (const tcu::ConstPixelBufferAccess&  access,
                                                   vk::VkQueue                                                  queue,
-                                                  vk::Allocator&                                               allocator,
+                                                  vk::Allocator&                                                       allocator,
                                                   vk::VkImageLayout                                    layout,
                                                   vk::VkOffset3D                                               offset,
                                                   vk::VkImageAspectFlagBits                    aspect,
@@ -530,7 +533,7 @@ void Image::uploadSurface (const tcu::ConstPixelBufferAccess&       access,
 
 void Image::uploadSurface1D (const tcu::ConstPixelBufferAccess&        access,
                                                         vk::VkQueue                                            queue,
-                                                        vk::Allocator&                                                 allocator,
+                                                        vk::Allocator&                                                 allocator,
                                                         vk::VkImageLayout                                      layout,
                                                         vk::VkOffset3D                                         offset,
                                                         vk::VkImageAspectFlagBits                      aspect,
@@ -563,7 +566,7 @@ void Image::uploadSurfaceLinear (const tcu::ConstPixelBufferAccess& access,
 }
 
 void Image::upload (vk::VkQueue                                        queue,
-                                       vk::Allocator&                          allocator,
+                                       vk::Allocator&                                  allocator,
                                        vk::VkImageLayout                       layout,
                                        vk::VkOffset3D                          offset,
                                        int                                                     width,
@@ -575,13 +578,7 @@ void Image::upload (vk::VkQueue                                    queue,
                                        vk::VkImageType                         type,
                                        const void *                            data)
 {
-
-       if (layout != vk::VK_IMAGE_LAYOUT_UNDEFINED
-               && layout != vk::VK_IMAGE_LAYOUT_GENERAL
-               && layout != vk::VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL) 
-       {
-               TCU_FAIL("Image::uploadFromRaw usage error: this function is not going to change Image layout!");
-       }
+       DE_ASSERT(layout == vk::VK_IMAGE_LAYOUT_GENERAL || layout == vk::VK_IMAGE_LAYOUT_UNDEFINED || layout == vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
 
        de::SharedPtr<Image> stagingResource;
        vk::VkExtent3D extent = {width, height, depth};
@@ -591,12 +588,12 @@ void Image::upload (vk::VkQueue                                   queue,
 
        stagingResource = Image::createAndAlloc(m_vk, m_device, stagingResourceCreateInfo, allocator,
                                                                vk::MemoryRequirement::HostVisible);
-       
+
        const vk::VkOffset3D zeroOffset = { 0, 0, 0 };
        stagingResource->uploadLinear(zeroOffset, width, height, depth, 0, 0, aspect, data);
 
        {
-               #pragma message("Get queue family index")
+               //todo [scygan] get proper queueFamilyIndex
                CmdPoolCreateInfo copyCmdPoolCreateInfo(0);
                vk::Unique<vk::VkCommandPool> copyCmdPool(vk::createCommandPool(m_vk, m_device, &copyCmdPoolCreateInfo));
 
@@ -608,11 +605,12 @@ void Image::upload (vk::VkQueue                                   queue,
                        vk::VK_COMMAND_BUFFER_LEVEL_PRIMARY,                            // VkCommandBufferLevel         level;
                        1u,                                                                                                     // deUint32                                     bufferCount;
                };
+
                vk::Unique<vk::VkCommandBuffer> copyCmdBuffer(vk::allocateCommandBuffer(m_vk, m_device, &cmdBufferAllocateInfo));
 
                CmdBufferBeginInfo beginInfo;
                VK_CHECK(m_vk.beginCommandBuffer(*copyCmdBuffer, &beginInfo));
-               
+
                if (layout == vk::VK_IMAGE_LAYOUT_UNDEFINED)
                {
                        layout = vk::VK_IMAGE_LAYOUT_GENERAL;
@@ -655,11 +653,11 @@ void Image::upload (vk::VkQueue                                   queue,
                {
                        vk::VK_STRUCTURE_TYPE_SUBMIT_INFO,      // VkStructureType                      sType;\r
                        DE_NULL,                                                        // const void*                          pNext;\r
-                       0,                                                                      // deUint32                                     waitSemaphoreCount;\r
-                       DE_NULL,                                                        // const VkSemaphore*           pWaitSemaphores;\r
-                       1,                                                                      // deUint32                                     commandBufferCount;\r
+                       0,                                                                              // deUint32                                     waitSemaphoreCount;\r
+                       DE_NULL,                                                                // const VkSemaphore*           pWaitSemaphores;\r
+                       1,                                                                              // deUint32                                     commandBufferCount;\r
                        &copyCmdBuffer.get(),                           // const VkCommandBuffer*       pCommandBuffers;\r
-                       0,                                                                      // deUint32                                     signalSemaphoreCount;\r
+                       0,                                                                              // deUint32                                     signalSemaphoreCount;\r
                        DE_NULL                                                         // const VkSemaphore*           pSignalSemaphores;\r
                };
                m_vk.queueSubmit(queue, 1, &submitInfo, DE_NULL);
@@ -670,7 +668,7 @@ void Image::upload (vk::VkQueue                                     queue,
 }
 
 void Image::uploadUsingBuffer (vk::VkQueue                                     queue,
-                                                          vk::Allocator&                               allocator,
+                                                          vk::Allocator&                                       allocator,
                                                           vk::VkImageLayout                    layout,
                                                           vk::VkOffset3D                               offset,
                                                           int                                                  width,
@@ -681,12 +679,7 @@ void Image::uploadUsingBuffer (vk::VkQueue                                 queue,
                                                           vk::VkImageAspectFlagBits    aspect,
                                                           const void *                                 data)
 {
-       if (layout != vk::VK_IMAGE_LAYOUT_UNDEFINED
-               && layout != vk::VK_IMAGE_LAYOUT_GENERAL
-               && layout != vk::VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL) 
-       {
-               TCU_FAIL("Image::uploadFromRaw usage error: this function is not going to change Image layout!");
-       }
+       DE_ASSERT(layout == vk::VK_IMAGE_LAYOUT_GENERAL || layout == vk::VK_IMAGE_LAYOUT_UNDEFINED || layout == vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
 
        de::SharedPtr<Buffer> stagingResource;
        bool isCombinedType = isCombinedDepthStencilType(vk::mapVkFormat(m_format).type);
@@ -713,11 +706,11 @@ void Image::uploadUsingBuffer (vk::VkQueue                                        queue,
        }
        BufferCreateInfo stagingBufferResourceCreateInfo(bufferSize, vk::VK_BUFFER_USAGE_TRANSFER_DST_BIT | vk::VK_BUFFER_USAGE_TRANSFER_SRC_BIT);
        stagingResource = Buffer::createAndAlloc(m_vk, m_device, stagingBufferResourceCreateInfo, allocator, vk::MemoryRequirement::HostVisible);
-       char* destPtr = reinterpret_cast<char*>(stagingResource->getBoundMemory().getHostPtr());
+       deUint8* destPtr = reinterpret_cast<deUint8*>(stagingResource->getBoundMemory().getHostPtr());
        deMemcpy(destPtr, data, bufferSize);
        vk::flushMappedMemoryRange(m_vk, m_device, stagingResource->getBoundMemory().getMemory(), stagingResource->getBoundMemory().getOffset(), bufferSize);
        {
-               #pragma message("Get queue family index")
+               //todo [scygan] get proper queueFamilyIndex
                CmdPoolCreateInfo copyCmdPoolCreateInfo(0);
                vk::Unique<vk::VkCommandPool> copyCmdPool(vk::createCommandPool(m_vk, m_device, &copyCmdPoolCreateInfo));
 
@@ -775,11 +768,11 @@ void Image::uploadUsingBuffer (vk::VkQueue                                        queue,
                {
                        vk::VK_STRUCTURE_TYPE_SUBMIT_INFO,      // VkStructureType                      sType;\r
                        DE_NULL,                                                        // const void*                          pNext;\r
-                       0,                                                                      // deUint32                                     waitSemaphoreCount;\r
-                       DE_NULL,                                                        // const VkSemaphore*           pWaitSemaphores;\r
-                       1,                                                                      // deUint32                                     commandBufferCount;\r
+                       0,                                                                              // deUint32                                     waitSemaphoreCount;\r
+                       DE_NULL,                                                                // const VkSemaphore*           pWaitSemaphores;\r
+                       1,                                                                              // deUint32                                     commandBufferCount;\r
                        &copyCmdBuffer.get(),                           // const VkCommandBuffer*       pCommandBuffers;\r
-                       0,                                                                      // deUint32                                     signalSemaphoreCount;\r
+                       0,                                                                              // deUint32                                     signalSemaphoreCount;\r
                        DE_NULL                                                         // const VkSemaphore*           pSignalSemaphores;\r
                };
                m_vk.queueSubmit(queue, 1, &submitInfo, DE_NULL);
@@ -789,7 +782,6 @@ void Image::uploadUsingBuffer (vk::VkQueue                                  queue,
        }
 }
 
-
 void Image::uploadLinear (vk::VkOffset3D                       offset,
                                                  int                                           width,
                                                  int                                           height,
@@ -806,11 +798,11 @@ void Image::uploadLinear (vk::VkOffset3D                  offset,
        m_vk.getImageSubresourceLayout(m_device, object(), &imageSubResource,
                                                                                                        &imageLayout);
 
-       char* destPtr = reinterpret_cast<char*>(getBoundMemory().getHostPtr());
+       deUint8* destPtr = reinterpret_cast<deUint8*>(getBoundMemory().getHostPtr());
 
        destPtr += imageLayout.offset + getPixelOffset(offset, imageLayout.rowPitch, imageLayout.depthPitch, mipLevel, arrayElement);
 
-       MemoryOp::pack(vk::mapVkFormat(m_format).getPixelSize(), width, height, depth, 
+       MemoryOp::pack(vk::mapVkFormat(m_format).getPixelSize(), width, height, depth,
                imageLayout.rowPitch, imageLayout.depthPitch, data, destPtr);
 }
 
@@ -820,11 +812,8 @@ vk::VkDeviceSize Image::getPixelOffset (vk::VkOffset3D             offset,
                                                                                unsigned int            level,
                                                                                unsigned int            layer)
 {
-       if (level >= m_levelCount) 
-               TCU_FAIL("mip level too large");
-
-       if (layer >= m_layerCount)
-               TCU_FAIL("array element too large");
+       DE_ASSERT(level < m_levelCount);
+       DE_ASSERT(layer < m_layerCount);
 
        vk::VkDeviceSize mipLevelSizes[32];
        vk::VkDeviceSize mipLevelRectSizes[32];
@@ -865,7 +854,7 @@ void Image::bindMemory (de::MovePtr<vk::Allocation> allocation)
 de::SharedPtr<Image> Image::createAndAlloc(const vk::DeviceInterface&  vk,
                                                                                   vk::VkDevice                                 device,
                                                                                   const vk::VkImageCreateInfo& createInfo,
-                                                                                  vk::Allocator&                               allocator,
+                                                                                  vk::Allocator&                                       allocator,
                                                                                   vk::MemoryRequirement                memoryRequirement)
 {
        de::SharedPtr<Image> ret = create(vk, device, createInfo);
@@ -884,14 +873,14 @@ de::SharedPtr<Image> Image::create(const vk::DeviceInterface&     vk,
                                                                vk::createImage(vk, device, &createInfo)));
 }
 
-void transition2DImage (const vk::DeviceInterface&     vk, 
-                                               vk::VkCommandBuffer                             cmdBuffer, 
-                                               vk::VkImage                                     image, 
-                                               vk::VkImageAspectFlags          aspectMask, 
+void transition2DImage (const vk::DeviceInterface&     vk,
+                                               vk::VkCommandBuffer                             cmdBuffer,
+                                               vk::VkImage                                     image,
+                                               vk::VkImageAspectFlags          aspectMask,
                                                vk::VkImageLayout                       oldLayout,
                                                vk::VkImageLayout                       newLayout)
 {
-       vk::VkImageMemoryBarrier barrier; 
+       vk::VkImageMemoryBarrier barrier;
        barrier.sType                                   = vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
        barrier.pNext                                   = DE_NULL;
        barrier.srcAccessMask                           = 0;
@@ -912,7 +901,6 @@ void transition2DImage (const vk::DeviceInterface&  vk,
        vk.cmdPipelineBarrier(cmdBuffer, vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, false, DE_LENGTH_OF_ARRAY(barriers), barriers);
 }
 
-
 void initialTransitionColor2DImage (const vk::DeviceInterface &vk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageLayout layout)
 {
        transition2DImage(vk, cmdBuffer, image, vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, layout);
@@ -933,5 +921,5 @@ void initialTransitionDepthStencil2DImage (const vk::DeviceInterface &vk, vk::Vk
        transition2DImage(vk, cmdBuffer, image, vk::VK_IMAGE_ASPECT_DEPTH_BIT | vk::VK_IMAGE_ASPECT_STENCIL_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, layout);
 }
 
-} //Draw
-} //vkt
+} // Draw
+} // vkt
index d85d014..58cd0c5 100644 (file)
@@ -35,7 +35,6 @@
  * \brief Image Object Util
  *//*--------------------------------------------------------------------*/
 
-#include "vkDefs.hpp"
 #include "vkMemUtil.hpp"
 #include "vkRefUtil.hpp"
 
@@ -55,8 +54,8 @@ public:
                                                 int                                    width,
                                                 int                                    height,
                                                 int                                    depth,
-                                                vk::VkDeviceSize               rowPitch,
-                                                vk::VkDeviceSize               depthPitch,
+                                                vk::VkDeviceSize               rowPitchOrZero,
+                                                vk::VkDeviceSize               depthPitchOrZero,
                                                 const void *                   srcBuffer,
                                                 void *                                 destBuffer);
 
@@ -64,17 +63,16 @@ public:
                                                 int                                    width,
                                                 int                                    height,
                                                 int                                    depth,
-                                                vk::VkDeviceSize               rowPitch,
-                                                vk::VkDeviceSize               depthPitch,
+                                                vk::VkDeviceSize               rowPitchOrZero,
+                                                vk::VkDeviceSize               depthPitchOrZero,
                                                 const void *                   srcBuffer,
                                                 void *                                 destBuffer);
 };
 
-
 class Image
 {
 public:
-       static de::SharedPtr<Image> create                              (const vk::DeviceInterface &vk, vk::VkDevice device, const vk::VkImageCreateInfo &createInfo);
+       static de::SharedPtr<Image> create                              (const vk::DeviceInterface& vk, vk::VkDevice device, const vk::VkImageCreateInfo& createInfo);
 
        static de::SharedPtr<Image> createAndAlloc              (const vk::DeviceInterface&                             vk,
                                                                                                         vk::VkDevice                                                   device,
@@ -112,7 +110,6 @@ public:
                                                                                                         unsigned int                                                   mipLevel = 0,
                                                                                                         unsigned int                                                   arrayElement = 0);
 
-
        tcu::ConstPixelBufferAccess readSurfaceLinear   (vk::VkOffset3D                                                 offset,
                                                                                                         int                                                                    width,
                                                                                                         int                                                                    height,
@@ -257,10 +254,10 @@ private:
                                                                                                         deUint32                                                               layerCount,
                                                                                                         vk::Move<vk::VkImage>                                  object);
 
-       Image                                                                                   (const Image &other);   // Not allowed!
-       Image                                            &operator=                     (const Image &other);   // Not allowed!
+       Image                                                                                   (const Imageother);   // Not allowed!
+       Image&                                          operator=                       (const Image& other);   // Not allowed!
 
-       de::MovePtr<vk::Allocation>     m_allocation;    
+       de::MovePtr<vk::Allocation>     m_allocation;
        vk::Unique<vk::VkImage>         m_object;
 
        vk::VkFormat                            m_format;
@@ -274,17 +271,17 @@ private:
        vk::VkDevice                            m_device;
 };
 
-void transition2DImage (const vk::DeviceInterface &vk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageAspectFlags aspectMask, vk::VkImageLayout oldLayout, vk::VkImageLayout newLayout);
+void transition2DImage (const vk::DeviceInterfacevk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageAspectFlags aspectMask, vk::VkImageLayout oldLayout, vk::VkImageLayout newLayout);
 
-void initialTransitionColor2DImage (const vk::DeviceInterface &vk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageLayout layout);
+void initialTransitionColor2DImage (const vk::DeviceInterfacevk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageLayout layout);
 
-void initialTransitionDepth2DImage (const vk::DeviceInterface &vk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageLayout layout);
+void initialTransitionDepth2DImage (const vk::DeviceInterfacevk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageLayout layout);
 
-void initialTransitionStencil2DImage (const vk::DeviceInterface &vk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageLayout layout);
+void initialTransitionStencil2DImage (const vk::DeviceInterfacevk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageLayout layout);
 
-void initialTransitionDepthStencil2DImage (const vk::DeviceInterface &vk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageLayout layout);
+void initialTransitionDepthStencil2DImage (const vk::DeviceInterfacevk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageLayout layout);
 
-} //Draw
-} //vkt
+} // Draw
+} // vkt
 
 #endif // _VKTDRAWIMAGEOBJECTUTIL_HPP
index 52eddc9..3caa6d2 100644 (file)
@@ -44,6 +44,7 @@
 #include "tcuResource.hpp"
 #include "tcuImageCompare.hpp"
 #include "tcuTextureUtil.hpp"
+#include "tcuRGBA.hpp"
 
 #include "vkDefs.hpp"
 
@@ -72,15 +73,15 @@ DrawIndexed::DrawIndexed (Context &context, ShaderMap shaders, vk::VkPrimitiveTo
 {
        m_topology = topology;
 
-       /*0*/ m_data.push_back(Vec4RGBA(tcu::Vec4(      -0.3f,   0.3f,  1.0f,   1.0f), vec4Blue()));
-       /*1*/ m_data.push_back(Vec4RGBA(tcu::Vec4(      -1.0f,   1.0f,  1.0f,   1.0f), vec4Blue()));
-       /*2*/ m_data.push_back(Vec4RGBA(tcu::Vec4(      -0.3f,  -0.3f,  1.0f,   1.0f), vec4Blue()));
-       /*3*/ m_data.push_back(Vec4RGBA(tcu::Vec4(       1.0f,  -1.0f,  1.0f,   1.0f), vec4Blue()));
-       /*4*/ m_data.push_back(Vec4RGBA(tcu::Vec4(      -0.3f,  -0.3f,  1.0f,   1.0f), vec4Blue()));
-       /*5*/ m_data.push_back(Vec4RGBA(tcu::Vec4(       0.3f,   0.3f,  1.0f,   1.0f), vec4Blue()));
-       /*6*/ m_data.push_back(Vec4RGBA(tcu::Vec4(       0.3f,  -0.3f,  1.0f,   1.0f), vec4Blue()));
-       /*7*/ m_data.push_back(Vec4RGBA(tcu::Vec4(       0.3f,   0.3f,  1.0f,   1.0f), vec4Blue()));
-       /*8*/ m_data.push_back(Vec4RGBA(tcu::Vec4(      -1.0f,   1.0f,  1.0f,   1.0f), vec4Blue()));
+       /*0*/ m_data.push_back(PositionColorVertex(tcu::Vec4(   -0.3f,   0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+       /*1*/ m_data.push_back(PositionColorVertex(tcu::Vec4(   -1.0f,   1.0f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+       /*2*/ m_data.push_back(PositionColorVertex(tcu::Vec4(   -0.3f,  -0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+       /*3*/ m_data.push_back(PositionColorVertex(tcu::Vec4(    1.0f,  -1.0f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+       /*4*/ m_data.push_back(PositionColorVertex(tcu::Vec4(   -0.3f,  -0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+       /*5*/ m_data.push_back(PositionColorVertex(tcu::Vec4(    0.3f,   0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+       /*6*/ m_data.push_back(PositionColorVertex(tcu::Vec4(    0.3f,  -0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+       /*7*/ m_data.push_back(PositionColorVertex(tcu::Vec4(    0.3f,   0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+       /*8*/ m_data.push_back(PositionColorVertex(tcu::Vec4(   -1.0f,   1.0f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
 
        switch (m_topology)
        {
@@ -105,11 +106,23 @@ DrawIndexed::DrawIndexed (Context &context, ShaderMap shaders, vk::VkPrimitiveTo
                        m_indexes.push_back(7);
                        break;
 
+               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
+               case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY:
+               case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
+               case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
+               case vk::VK_PRIMITIVE_TOPOLOGY_PATCH_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LAST:
+                       DE_FATAL("Topology not implemented");
+                       break;
                default:
-               ;
+                       DE_FATAL("Unknown topology");
+                       break;
        }
-
-       DrawTestsBaseClass::initialize();
+       initialize();
 };
 
 tcu::TestStatus DrawIndexed::iterate (void)
@@ -120,10 +133,14 @@ tcu::TestStatus DrawIndexed::iterate (void)
        beginRenderPass();
 
        const vk::VkDeviceSize dataSize = m_indexes.size() * sizeof(deUint32);
-       m_indexBuffer = Buffer::createAndAlloc(m_vk, m_context.getDevice(), BufferCreateInfo(dataSize,
-               vk::VK_BUFFER_USAGE_INDEX_BUFFER_BIT), m_context.getDefaultAllocator(), vk::MemoryRequirement::HostVisible);
+       m_indexBuffer = Buffer::createAndAlloc( m_vk, m_context.getDevice(),
+                                                                                       BufferCreateInfo(dataSize,
+                                                                                                                        vk::VK_BUFFER_USAGE_INDEX_BUFFER_BIT),
+                                                                                       m_context.getDefaultAllocator(),
+                                                                                       vk::MemoryRequirement::HostVisible);
+
+       deUint8* ptr = reinterpret_cast<deUint8*>(m_indexBuffer->getBoundMemory().getHostPtr());
 
-       unsigned char *ptr = reinterpret_cast<unsigned char *>(m_indexBuffer->getBoundMemory().getHostPtr());
        deMemcpy(ptr, &m_indexes[0], dataSize);
 
        vk::flushMappedMemoryRange(m_vk, m_context.getDevice(),
@@ -134,6 +151,7 @@ tcu::TestStatus DrawIndexed::iterate (void)
        const vk::VkDeviceSize vertexBufferOffset = 0;
        const vk::VkBuffer vertexBuffer = m_vertexBuffer->object();
        const vk::VkBuffer indexBuffer = m_indexBuffer->object();
+
        m_vk.cmdBindVertexBuffers(*m_cmdBuffer, 0, 1, &vertexBuffer, &vertexBufferOffset);
        m_vk.cmdBindIndexBuffer(*m_cmdBuffer, indexBuffer, 0, vk::VK_INDEX_TYPE_UINT32);
 
@@ -150,11 +168,11 @@ tcu::TestStatus DrawIndexed::iterate (void)
        {
                vk::VK_STRUCTURE_TYPE_SUBMIT_INFO,      // VkStructureType                      sType;
                DE_NULL,                                                        // const void*                          pNext;
-               0,                                                                      // deUint32                                     waitSemaphoreCount;
-               DE_NULL,                                                        // const VkSemaphore*           pWaitSemaphores;
-               1,                                                                      // deUint32                                     commandBufferCount;
+               0,                                                                              // deUint32                                     waitSemaphoreCount;
+               DE_NULL,                                                                // const VkSemaphore*           pWaitSemaphores;
+               1,                                                                              // deUint32                                     commandBufferCount;
                &m_cmdBuffer.get(),                                     // const VkCommandBuffer*       pCommandBuffers;
-               0,                                                                      // deUint32                                     signalSemaphoreCount;
+               0,                                                                              // deUint32                                     signalSemaphoreCount;
                DE_NULL                                                         // const VkSemaphore*           pSignalSemaphores;
        };
 
@@ -171,6 +189,8 @@ tcu::TestStatus DrawIndexed::iterate (void)
 
        tcu::clear(referenceFrame.getLevel(0), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
 
+       ReferenceImageCoordinates refCoords;
+
        for (int y = 0; y < frameHeight; y++)
        {
                const float yCoord = (float)(y / (0.5*frameHeight)) - 1.0f;
@@ -179,7 +199,10 @@ tcu::TestStatus DrawIndexed::iterate (void)
                {
                        const float xCoord = (float)(x / (0.5*frameWidth)) - 1.0f;
 
-                       if ((yCoord >= -0.3f && yCoord <= 0.3f && xCoord >= -0.3f && xCoord <= 0.3f))
+                       if ((yCoord >= refCoords.bottom &&
+                                yCoord <= refCoords.top        &&
+                                xCoord >= refCoords.left       &&
+                                xCoord <= refCoords.right))
                                referenceFrame.getLevel(0).setPixel(tcu::Vec4(0.0f, 0.0f, 1.0f, 1.0f), x, y);
                }
        }
@@ -212,12 +235,15 @@ tcu::TestStatus DrawInstancedIndexed::iterate (void)
        beginRenderPass();
 
        const vk::VkDeviceSize dataSize = m_indexes.size() * sizeof(deUint32);
-       m_indexBuffer = Buffer::createAndAlloc(m_vk, m_context.getDevice(), BufferCreateInfo(dataSize, vk::VK_BUFFER_USAGE_INDEX_BUFFER_BIT),
-                                                  m_context.getDefaultAllocator(), vk::MemoryRequirement::HostVisible);
+       m_indexBuffer = Buffer::createAndAlloc( m_vk, m_context.getDevice(),
+                                                                                       BufferCreateInfo(dataSize,
+                                                                                                                        vk::VK_BUFFER_USAGE_INDEX_BUFFER_BIT),
+                                                                                       m_context.getDefaultAllocator(),
+                                                                                       vk::MemoryRequirement::HostVisible);
 
-       unsigned char *ptr = reinterpret_cast<unsigned char *>(m_indexBuffer->getBoundMemory().getHostPtr());
-       deMemcpy(ptr, &m_indexes[0], dataSize);
+       deUint8* ptr = reinterpret_cast<deUint8*>(m_indexBuffer->getBoundMemory().getHostPtr());
 
+       deMemcpy(ptr, &m_indexes[0], dataSize);
        vk::flushMappedMemoryRange(m_vk, m_context.getDevice(),
                                                           m_vertexBuffer->getBoundMemory().getMemory(),
                                                           m_vertexBuffer->getBoundMemory().getOffset(),
@@ -226,40 +252,33 @@ tcu::TestStatus DrawInstancedIndexed::iterate (void)
        const vk::VkDeviceSize vertexBufferOffset = 0;
        const vk::VkBuffer vertexBuffer = m_vertexBuffer->object();
        const vk::VkBuffer indexBuffer = m_indexBuffer->object();
+
        m_vk.cmdBindVertexBuffers(*m_cmdBuffer, 0, 1, &vertexBuffer, &vertexBufferOffset);
        m_vk.cmdBindIndexBuffer(*m_cmdBuffer, indexBuffer, 0, vk::VK_INDEX_TYPE_UINT32);
-
        m_vk.cmdBindPipeline(*m_cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
 
        switch (m_topology)
        {
-               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
-                       break;
-               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
-                       break;
-               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST:
                        m_vk.cmdDrawIndexed(*m_cmdBuffer, 6, 4, 2, 0, 2);
                        break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP:
                        m_vk.cmdDrawIndexed(*m_cmdBuffer, 4, 4, 2, 0, 2);
                        break;
+               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_PATCH_LIST:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LAST:
+                       DE_FATAL("Topology not implemented");
                        break;
                default:
+                       DE_FATAL("Unknown topology");
                        break;
        }
 
@@ -270,11 +289,11 @@ tcu::TestStatus DrawInstancedIndexed::iterate (void)
        {
                vk::VK_STRUCTURE_TYPE_SUBMIT_INFO,      // VkStructureType                      sType;
                DE_NULL,                                                        // const void*                          pNext;
-               0,                                                                      // deUint32                                     waitSemaphoreCount;
-               DE_NULL,                                                        // const VkSemaphore*           pWaitSemaphores;
-               1,                                                                      // deUint32                                     commandBufferCount;
+               0,                                                                              // deUint32                                     waitSemaphoreCount;
+               DE_NULL,                                                                // const VkSemaphore*           pWaitSemaphores;
+               1,                                                                              // deUint32                                     commandBufferCount;
                &m_cmdBuffer.get(),                                     // const VkCommandBuffer*       pCommandBuffers;
-               0,                                                                      // deUint32                                     signalSemaphoreCount;
+               0,                                                                              // deUint32                                     signalSemaphoreCount;
                DE_NULL                                                         // const VkSemaphore*           pSignalSemaphores;
        };
        VK_CHECK(m_vk.queueSubmit(queue, 1, &submitInfo, DE_NULL));
@@ -292,6 +311,8 @@ tcu::TestStatus DrawInstancedIndexed::iterate (void)
 
        tcu::clear(referenceFrame.getLevel(0), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
 
+       ReferenceImageInstancedCoordinates refInstancedCoords;
+
        for (int y = 0; y < frameHeight; y++)
        {
                const float yCoord = (float)(y / (0.5*frameHeight)) - 1.0f;
@@ -300,7 +321,10 @@ tcu::TestStatus DrawInstancedIndexed::iterate (void)
                {
                        const float xCoord = (float)(x / (0.5*frameWidth)) - 1.0f;
 
-                       if ((yCoord >= -0.6f && yCoord <= 0.3f && xCoord >= -0.3f && xCoord <= 0.6f))
+                       if ((yCoord >= refInstancedCoords.bottom        &&
+                                yCoord <= refInstancedCoords.top               &&
+                                xCoord >= refInstancedCoords.left              &&
+                                xCoord <= refInstancedCoords.right))
                                referenceFrame.getLevel(0).setPixel(tcu::Vec4(0.0f, 0.0f, 1.0f, 1.0f), x, y);
                }
        }
@@ -336,14 +360,16 @@ void DrawIndexedTests::init (void)
        ShaderMap shaderPaths;
        shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetch.vert";
        shaderPaths[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag";
+
        addChild(new InstanceFactory<DrawIndexed>(m_testCtx, "draw_indexed_triangle_list", "Draws indexed triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
        addChild(new InstanceFactory<DrawIndexed>(m_testCtx, "draw_indexed_triangle_strip", "Draws indexed triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP));
 
        shaderPaths[glu::SHADERTYPE_VERTEX] = "vulkan/draw/VertexFetchWithInstance.vert";
        shaderPaths[glu::SHADERTYPE_FRAGMENT] = "vulkan/draw/VertexFetch.frag";
+
        addChild(new InstanceFactory<DrawIndexed>(m_testCtx, "draw_instanced_indexed_triangle_list", "Draws indexed triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
        addChild(new InstanceFactory<DrawIndexed>(m_testCtx, "draw_instanced_indexed_triangle_strip", "Draws indexed triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP));
 }
 
 }      // DrawTests
-}      // vkt
\ No newline at end of file
+}      // vkt
index ce00305..b00fea0 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _VKTDRAWINDEXEDTESTS_HPP
-#define _VKTDRAWINDEXEDTESTS_HPP
+#ifndef _VKTDRAWINDEXEDTEST_HPP
+#define _VKTDRAWINDEXEDTEST_HPP
 /*------------------------------------------------------------------------
 * Vulkan Conformance Tests
 * ------------------------
@@ -44,16 +44,16 @@ namespace Draw
 class DrawIndexedTests : public tcu::TestCaseGroup
 {
 public:
-                                       DrawIndexedTests                (tcu::TestContext &testCtx);
-                                       ~DrawIndexedTests               (void);
-       void                    init                                    (void);
+                                                       DrawIndexedTests                (tcu::TestContext &testCtx);
+                                                       ~DrawIndexedTests               (void);
+       void                                    init                                    (void);
 
 private:
-                                       DrawIndexedTests                (const DrawIndexedTests &other);
-                                       DrawIndexedTests&               operator=(const DrawIndexedTests &other);
+       DrawIndexedTests                                                                (const DrawIndexedTests &other);
+       DrawIndexedTests&               operator=                               (const DrawIndexedTests &other);
 
 };
-} //Draw
-} //vkt
+} // Draw
+} // vkt
 
-#endif // #define _VKTDRAWINDEXEDTESTS_HPP
+#endif // _VKTDRAWINDEXEDTEST_HPP
index 1d5f579..9896ed1 100644 (file)
@@ -44,6 +44,7 @@
 #include "tcuResource.hpp"
 #include "tcuImageCompare.hpp"
 #include "tcuTextureUtil.hpp"
+#include "tcuRGBA.hpp"
 
 #include "vkDefs.hpp"
 
@@ -55,18 +56,22 @@ namespace
 {
 struct JunkData
 {
-       deUint16 x16 = 16;
-       deUint32 x32 = 32;
-       std::string str = "junk_data";
+       JunkData()
+               : varA  (0xcd)
+               , varB  (0xcd)
+       {
+       }
+       const deUint16  varA;
+       const deUint32  varB;
 };
 
 class IndirectDraw : public DrawTestsBaseClass
 {
 public:
                                                                IndirectDraw    (Context &context, ShaderMap shaders, vk::VkPrimitiveTopology topology);
-       virtual         tcu::TestStatus iterate                 (void);
+       virtual tcu::TestStatus         iterate                 (void);
 private:
-       de::SharedPtr<Buffer>                                   m_IndirectBuffer;
+       de::SharedPtr<Buffer>                                   m_indirectBuffer;
        std::vector<vk::VkDrawIndirectCommand>  m_indirectDrawCmd;
        vk::VkDeviceSize                                                m_offsetInBuffer;
        deUint32                                                                m_strideInBuffer;
@@ -80,7 +85,7 @@ public:
                                                                IndirectDrawInstanced   (Context &context, ShaderMap shaders, vk::VkPrimitiveTopology topology);
        virtual tcu::TestStatus         iterate                                 (void);
 private:
-       de::SharedPtr<Buffer>                                   m_IndirectBuffer;
+       de::SharedPtr<Buffer>                                   m_indirectBuffer;
        std::vector<vk::VkDrawIndirectCommand>  m_indirectDrawCmd;
        vk::VkDeviceSize                                                m_offsetInBuffer;
        deUint32                                                                m_strideInBuffer;
@@ -90,61 +95,53 @@ private:
 
 IndirectDraw::IndirectDraw (Context &context, ShaderMap shaders, vk::VkPrimitiveTopology topology)
                : DrawTestsBaseClass(context, shaders[glu::SHADERTYPE_VERTEX], shaders[glu::SHADERTYPE_FRAGMENT])
-       {
-               m_topology = topology;
-
-               switch (m_topology)
-               {
-                       case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
-                               break;
-                       case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
-                               break;
-                       case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
-                               break;
-                       case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST:
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(     1.0f,  -1.0f,  1.0f,   1.0f), vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(    -1.0f,   1.0f,  1.0f,   1.0f), vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(    -0.3f,  -0.3f,  1.0f,   1.0f), vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(    -0.3f,   0.3f,  1.0f,   1.0f), vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(     0.3f,  -0.3f,  1.0f,   1.0f), vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(     0.3f,  -0.3f,  1.0f,   1.0f), vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(     0.3f,   0.3f,  1.0f,   1.0f), vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(    -0.3f,   0.3f,  1.0f,   1.0f), vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(    -1.0f,   1.0f,  1.0f,   1.0f), vec4Blue()));
-                               break;
-                       case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP:
-                               m_data.push_back(Vec4RGBA(tcu::Vec4( 1.0f,      -1.0f,   1.0f,   1.0f),  vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(-1.0f,       1.0f,   1.0f,   1.0f),  vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(-0.3f,       0.0f,   1.0f,   1.0f),  vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4( 0.3f,       0.0f,   1.0f,   1.0f),  vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(-0.3f,      -0.3f,   1.0f,   1.0f),  vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4( 0.3f,      -0.3f,   1.0f,   1.0f),  vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(-0.3f,       0.3f,   1.0f,   1.0f),  vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4( 0.3f,       0.3f,   1.0f,   1.0f),  vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(-0.3f,       0.0f,   1.0f,   1.0f),  vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4( 0.3f,       0.0f,   1.0f,   1.0f),  vec4Blue()));
-                               m_data.push_back(Vec4RGBA(tcu::Vec4(-1.0f,       1.0f,   1.0f,   1.0f),  vec4Blue()));
-                               break;
-                       case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN:
-                               break;
-                       case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY:
-                               break;
-                       case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY:
-                               break;
-                       case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
-                               break;
-                       case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
-                               break;
-                       case vk::VK_PRIMITIVE_TOPOLOGY_PATCH_LIST:
-                               break;
-                       case vk::VK_PRIMITIVE_TOPOLOGY_LAST:
-                               break;
-                       default:
-                               break;
-               }
+{
+       m_topology = topology;
 
-               DrawTestsBaseClass::initialize();
+       switch (m_topology)
+       {
+               case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST:
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(  1.0f,  -1.0f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -1.0f,   1.0f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -0.3f,  -0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -0.3f,   0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(  0.3f,  -0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(  0.3f,  -0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(  0.3f,   0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -0.3f,   0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -1.0f,   1.0f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       break;
+               case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP:
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( 1.0f,   -1.0f,   1.0f,   1.0f),  tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(-1.0f,    1.0f,   1.0f,   1.0f),  tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(-0.3f,    0.0f,   1.0f,   1.0f),  tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( 0.3f,    0.0f,   1.0f,   1.0f),  tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(-0.3f,   -0.3f,   1.0f,   1.0f),  tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( 0.3f,   -0.3f,   1.0f,   1.0f),  tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(-0.3f,    0.3f,   1.0f,   1.0f),  tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( 0.3f,    0.3f,   1.0f,   1.0f),  tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(-0.3f,    0.0f,   1.0f,   1.0f),  tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( 0.3f,    0.0f,   1.0f,   1.0f),  tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(-1.0f,    1.0f,   1.0f,   1.0f),  tcu::RGBA::blue().toVec()));
+                       break;
+               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
+               case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY:
+               case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
+               case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
+               case vk::VK_PRIMITIVE_TOPOLOGY_PATCH_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LAST:
+                       DE_FATAL("Topology not implemented");
+                       break;
+               default:
+                       DE_FATAL("Unknown topology");
+                       break;
        }
+       initialize();
+}
 
 tcu::TestStatus IndirectDraw::iterate (void)
 {
@@ -153,85 +150,91 @@ tcu::TestStatus IndirectDraw::iterate (void)
 
        switch (m_topology)
        {
-               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
-                       break;
-               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
-                       break;
-               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST:
-                       m_indirectDrawCmd.push_back(
-                       {
-                               3,              //vertexCount
-                               1,              //instanceCount
-                               2,              //firstVertex
-                               0               //firstInstance
-                       });
-
-                       // and this is junk data for stride
-                       m_indirectDrawCmd.push_back({ -4, -2, -11, -9 });
-
-                       m_indirectDrawCmd.push_back(
+               {
+                       vk::VkDrawIndirectCommand drawCommands[] =
                        {
-                               3,              //vertexCount
-                               1,              //instanceCount
-                               5,              //firstVertex
-                               0               //firstInstance
-                       });
+                               {
+                                       3,              //vertexCount
+                                       1,              //instanceCount
+                                       2,              //firstVertex
+                                       0               //firstInstance
+                               },
+                               { -4, -2, -11, -9 }, // junk (stride)
+                               {
+                                       3,              //vertexCount
+                                       1,              //instanceCount
+                                       5,              //firstVertex
+                                       0               //firstInstance
+                               }
+                       };
+                       m_indirectDrawCmd.push_back(drawCommands[0]);
+                       m_indirectDrawCmd.push_back(drawCommands[1]);
+                       m_indirectDrawCmd.push_back(drawCommands[2]);
                        break;
+               }
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP:
-                       m_indirectDrawCmd.push_back(
-                       {
-                               4,              //vertexCount
-                               1,              //instanceCount
-                               2,              //firstVertex
-                               0               //firstInstance
-                       });
-
-                       // and this is junk data for stride
-                       m_indirectDrawCmd.push_back({ -4, -2, -11, -9 });
-
-                       m_indirectDrawCmd.push_back(
+               {
+                       vk::VkDrawIndirectCommand drawCommands[] =
                        {
-                               4,              //vertexCount
-                               1,              //instanceCount
-                               6,              //firstVertex
-                               0               //firstInstance
-                       });
+                               {
+                                       4,              //vertexCount
+                                       1,              //instanceCount
+                                       2,              //firstVertex
+                                       0               //firstInstance
+                               },
+                               { -4, -2, -11, -9 }, // junk (stride)
+                               {
+                                       4,              //vertexCount
+                                       1,              //instanceCount
+                                       6,              //firstVertex
+                                       0               //firstInstance
+                               }
+                       };
+                       m_indirectDrawCmd.push_back(drawCommands[0]);
+                       m_indirectDrawCmd.push_back(drawCommands[1]);
+                       m_indirectDrawCmd.push_back(drawCommands[2]);
                        break;
+               }
+               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_PATCH_LIST:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LAST:
+                       DE_FATAL("Topology not implemented");
                        break;
                default:
+                       DE_FATAL("Unknown topology");
                        break;
        }
 
        m_strideInBuffer        = 2 * sizeof(m_indirectDrawCmd[0]);
        m_drawCount                     = 2;
        m_offsetInBuffer        = sizeof(m_junkData);
-       
+
        beginRenderPass();
 
        const vk::VkDeviceSize vertexBufferOffset       = 0;
        const vk::VkBuffer vertexBuffer                         = m_vertexBuffer->object();
+
        m_vk.cmdBindVertexBuffers(*m_cmdBuffer, 0, 1, &vertexBuffer, &vertexBufferOffset);
 
        const vk::VkDeviceSize dataSize = m_indirectDrawCmd.size()*sizeof(m_indirectDrawCmd[0]);
-       m_IndirectBuffer = Buffer::createAndAlloc(m_vk, m_context.getDevice(), BufferCreateInfo(dataSize,
-               vk::VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT), m_context.getDefaultAllocator(), vk::MemoryRequirement::HostVisible);
 
-       unsigned char *ptr = reinterpret_cast<unsigned char *>(m_IndirectBuffer->getBoundMemory().getHostPtr());
+       m_indirectBuffer = Buffer::createAndAlloc(      m_vk,
+                                                                                               m_context.getDevice(),
+                                                                                               BufferCreateInfo(dataSize,
+                                                                                                                                vk::VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT),
+                                                                                               m_context.getDefaultAllocator(),
+                                                                                               vk::MemoryRequirement::HostVisible);
+
+       deUint8* ptr = reinterpret_cast<deUint8*>(m_indirectBuffer->getBoundMemory().getHostPtr());
+
        deMemcpy(ptr, &m_junkData, m_offsetInBuffer);
        deMemcpy((ptr+m_offsetInBuffer), &m_indirectDrawCmd[0], dataSize);
 
@@ -242,9 +245,7 @@ tcu::TestStatus IndirectDraw::iterate (void)
                                                           dataSize);
 
        m_vk.cmdBindPipeline(*m_cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
-       
-       m_vk.cmdDrawIndirect(*m_cmdBuffer, m_IndirectBuffer->object(), m_offsetInBuffer, m_drawCount, m_strideInBuffer);
-
+       m_vk.cmdDrawIndirect(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer, m_drawCount, m_strideInBuffer);
        m_vk.cmdEndRenderPass(*m_cmdBuffer);
        m_vk.endCommandBuffer(*m_cmdBuffer);
 
@@ -252,15 +253,15 @@ tcu::TestStatus IndirectDraw::iterate (void)
        {
                vk::VK_STRUCTURE_TYPE_SUBMIT_INFO,      // VkStructureType                      sType;
                DE_NULL,                                                        // const void*                          pNext;
-               0,                                                                      // deUint32                                     waitSemaphoreCount;
-               DE_NULL,                                                        // const VkSemaphore*           pWaitSemaphores;
-               1,                                                                      // deUint32                                     commandBufferCount;
+               0,                                                                              // deUint32                                     waitSemaphoreCount;
+               DE_NULL,                                                                // const VkSemaphore*           pWaitSemaphores;
+               1,                                                                              // deUint32                                     commandBufferCount;
                &m_cmdBuffer.get(),                                     // const VkCommandBuffer*       pCommandBuffers;
-               0,                                                                      // deUint32                                     signalSemaphoreCount;
+               0,                                                                              // deUint32                                     signalSemaphoreCount;
                DE_NULL                                                         // const VkSemaphore*           pSignalSemaphores;
        };
        VK_CHECK(m_vk.queueSubmit(queue, 1, &submitInfo, DE_NULL));
-       
+
        VK_CHECK(m_vk.queueWaitIdle(queue));
 
        // Validation
@@ -272,6 +273,8 @@ tcu::TestStatus IndirectDraw::iterate (void)
 
        tcu::clear(referenceFrame.getLevel(0), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
 
+       ReferenceImageCoordinates refCoords;
+
        for (int y = 0; y < frameHeight; y++)
        {
                const float yCoord = (float)(y / (0.5*frameHeight)) - 1.0f;
@@ -280,7 +283,10 @@ tcu::TestStatus IndirectDraw::iterate (void)
                {
                        const float xCoord = (float)(x / (0.5*frameWidth)) - 1.0f;
 
-                       if ((yCoord >= -0.3f && yCoord <= 0.3f && xCoord >= -0.3f && xCoord <= 0.3f))                                   
+                       if ((yCoord >= refCoords.bottom &&
+                                yCoord <= refCoords.top        &&
+                                xCoord >= refCoords.left       &&
+                                xCoord <= refCoords.right))
                                referenceFrame.getLevel(0).setPixel(tcu::Vec4(0.0f, 0.0f, 1.0f, 1.0f), x, y);
                }
        }
@@ -302,7 +308,7 @@ tcu::TestStatus IndirectDraw::iterate (void)
 }
 
 IndirectDrawInstanced::IndirectDrawInstanced (Context &context, ShaderMap shaders, vk::VkPrimitiveTopology topology)
-               : IndirectDraw  (context, shaders, topology)
+       : IndirectDraw  (context, shaders, topology)
 {
 }
 
@@ -313,69 +319,66 @@ tcu::TestStatus IndirectDrawInstanced::iterate (void)
 
        switch (m_topology)
        {
-               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
-                       break;
-               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
-                       break;
-               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST:
-                       m_indirectDrawCmd.push_back(
-                       {
-                               3,              //vertexCount
-                               4,              //instanceCount
-                               2,              //firstVertex
-                               2               //firstInstance
-                       });
-
-                       // and this is junk data for stride
-                       m_indirectDrawCmd.push_back({ -4, -2, -11, -9 });
-
-                       m_indirectDrawCmd.push_back(
+               {
+                       vk::VkDrawIndirectCommand drawCmd[] =
                        {
-                               3,              //vertexCount
-                               4,              //instanceCount
-                               5,              //firstVertex
-                               2               //firstInstance
-                       });
-
+                               {
+                                       3,              //vertexCount
+                                       4,              //instanceCount
+                                       2,              //firstVertex
+                                       2               //firstInstance
+                               },
+                               { -4, -2, -11, -9 }, // junk (stride)
+                               {
+                                       3,              //vertexCount
+                                       4,              //instanceCount
+                                       5,              //firstVertex
+                                       2               //firstInstance
+                               }
+                       };
+                       m_indirectDrawCmd.push_back(drawCmd[0]);
+                       m_indirectDrawCmd.push_back(drawCmd[1]);
+                       m_indirectDrawCmd.push_back(drawCmd[2]);
                        break;
+               }
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP:
-                       m_indirectDrawCmd.push_back(
-                       {
-                               4,              //vertexCount
-                               4,              //instanceCount
-                               2,              //firstVertex
-                               2               //firstInstance
-                       });
-
-                       // and this is junk data for stride
-                       m_indirectDrawCmd.push_back({ -4, -2, -11, -9 });
-
-                       m_indirectDrawCmd.push_back(
+               {
+                       vk::VkDrawIndirectCommand drawCmd[] =
                        {
-                               4,              //vertexCount
-                               4,              //instanceCount
-                               6,              //firstVertex
-                               2               //firstInstance
-                       });
-
+                               {
+                                       4,              //vertexCount
+                                       4,              //instanceCount
+                                       2,              //firstVertex
+                                       2               //firstInstance
+                               },
+                               { -4, -2, -11, -9 },
+                               {
+                                       4,              //vertexCount
+                                       4,              //instanceCount
+                                       6,              //firstVertex
+                                       2               //firstInstance
+                               }
+                       };
+                       m_indirectDrawCmd.push_back(drawCmd[0]);
+                       m_indirectDrawCmd.push_back(drawCmd[1]);
+                       m_indirectDrawCmd.push_back(drawCmd[2]);
                        break;
+               }
+               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_PATCH_LIST:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LAST:
+                       DE_FATAL("Topology not implemented");
                        break;
                default:
+                       DE_FATAL("Unknown topology");
                        break;
        }
 
@@ -387,13 +390,20 @@ tcu::TestStatus IndirectDrawInstanced::iterate (void)
 
        const vk::VkDeviceSize vertexBufferOffset = 0;
        const vk::VkBuffer vertexBuffer = m_vertexBuffer->object();
+
        m_vk.cmdBindVertexBuffers(*m_cmdBuffer, 0, 1, &vertexBuffer, &vertexBufferOffset);
 
        const vk::VkDeviceSize dataSize = m_indirectDrawCmd.size()*sizeof(m_indirectDrawCmd[0]);
-       m_IndirectBuffer = Buffer::createAndAlloc(m_vk, m_context.getDevice(), BufferCreateInfo(dataSize,
-               vk::VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT), m_context.getDefaultAllocator(), vk::MemoryRequirement::HostVisible);
 
-       unsigned char *ptr = reinterpret_cast<unsigned char *>(m_IndirectBuffer->getBoundMemory().getHostPtr());
+       m_indirectBuffer = Buffer::createAndAlloc(      m_vk,
+                                                                                               m_context.getDevice(),
+                                                                                               BufferCreateInfo(dataSize,
+                                                                                                                                vk::VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT),
+                                                                                               m_context.getDefaultAllocator(),
+                                                                                               vk::MemoryRequirement::HostVisible);
+
+       deUint8* ptr = reinterpret_cast<deUint8*>(m_indirectBuffer->getBoundMemory().getHostPtr());
+
        deMemcpy(ptr, &m_junkData, m_offsetInBuffer);
        deMemcpy((ptr + m_offsetInBuffer), &m_indirectDrawCmd[0], dataSize);
 
@@ -404,9 +414,7 @@ tcu::TestStatus IndirectDrawInstanced::iterate (void)
                                                           dataSize);
 
        m_vk.cmdBindPipeline(*m_cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
-       
-       m_vk.cmdDrawIndirect(*m_cmdBuffer, m_IndirectBuffer->object(), m_offsetInBuffer, m_drawCount, m_strideInBuffer);
-
+       m_vk.cmdDrawIndirect(*m_cmdBuffer, m_indirectBuffer->object(), m_offsetInBuffer, m_drawCount, m_strideInBuffer);
        m_vk.cmdEndRenderPass(*m_cmdBuffer);
        m_vk.endCommandBuffer(*m_cmdBuffer);
 
@@ -414,21 +422,22 @@ tcu::TestStatus IndirectDrawInstanced::iterate (void)
        {
                vk::VK_STRUCTURE_TYPE_SUBMIT_INFO,      // VkStructureType                      sType;
                DE_NULL,                                                        // const void*                          pNext;
-               0,                                                                      // deUint32                                     waitSemaphoreCount;
-               DE_NULL,                                                        // const VkSemaphore*           pWaitSemaphores;
-               1,                                                                      // deUint32                                     commandBufferCount;
+               0,                                                                              // deUint32                                     waitSemaphoreCount;
+               DE_NULL,                                                                // const VkSemaphore*           pWaitSemaphores;
+               1,                                                                              // deUint32                                     commandBufferCount;
                &m_cmdBuffer.get(),                                     // const VkCommandBuffer*       pCommandBuffers;
-               0,                                                                      // deUint32                                     signalSemaphoreCount;
+               0,                                                                              // deUint32                                     signalSemaphoreCount;
                DE_NULL                                                         // const VkSemaphore*           pSignalSemaphores;
        };
        VK_CHECK(m_vk.queueSubmit(queue, 1, &submitInfo, DE_NULL));
-       
+
        VK_CHECK(m_vk.queueWaitIdle(queue));
 
        // Validation
        VK_CHECK(m_vk.queueWaitIdle(queue));
 
        tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+
        referenceFrame.allocLevel(0);
 
        const deInt32 frameWidth        = referenceFrame.getWidth();
@@ -436,6 +445,8 @@ tcu::TestStatus IndirectDrawInstanced::iterate (void)
 
        tcu::clear(referenceFrame.getLevel(0), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
 
+       ReferenceImageInstancedCoordinates refInstancedCoords;
+
        for (int y = 0; y < frameHeight; y++)
        {
                const float yCoord = (float)(y / (0.5*frameHeight)) - 1.0f;
@@ -444,7 +455,10 @@ tcu::TestStatus IndirectDrawInstanced::iterate (void)
                {
                        const float xCoord = (float)(x / (0.5*frameWidth)) - 1.0f;
 
-                       if ((yCoord >= -0.6f && yCoord <= 0.3f && xCoord >= -0.3f && xCoord <= 0.6f))
+                       if ((yCoord >= refInstancedCoords.bottom        &&
+                                yCoord <= refInstancedCoords.top               &&
+                                xCoord >= refInstancedCoords.left              &&
+                                xCoord <= refInstancedCoords.right))
                                referenceFrame.getLevel(0).setPixel(tcu::Vec4(0.0f, 0.0f, 1.0f, 1.0f), x, y);
                }
        }
@@ -481,14 +495,16 @@ void IndirectDrawTests::init (void)
        ShaderMap shaderPaths;
        shaderPaths[glu::SHADERTYPE_VERTEX]             = "vulkan/draw/VertexFetch.vert";
        shaderPaths[glu::SHADERTYPE_FRAGMENT]    = "vulkan/draw/VertexFetch.frag";
+
        addChild(new InstanceFactory<IndirectDraw>(m_testCtx, "indirect_draw_triangle_list", "Draws triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
        addChild(new InstanceFactory<IndirectDraw>(m_testCtx, "indirect_draw_triangle_strip", "Draws triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP));
 
        shaderPaths[glu::SHADERTYPE_VERTEX]             = "vulkan/draw/VertexFetchWithInstance.vert";
        shaderPaths[glu::SHADERTYPE_FRAGMENT]   = "vulkan/draw/VertexFetch.frag";
+
        addChild(new InstanceFactory<IndirectDrawInstanced>(m_testCtx, "indirect_draw_instanced_triangle_list", "Draws an instanced triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
        addChild(new InstanceFactory<IndirectDrawInstanced>(m_testCtx, "indirect_draw_instanced_triangle_strip", "Draws an instanced triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP));
 }
 
 }      // DrawTests
-}      // vkt
\ No newline at end of file
+}      // vkt
index 905ed2f..d51d7d5 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _VKTDRAWINDIRECTDRAWTESTS_HPP
-#define _VKTDRAWINDIRECTDRAWTESTS_HPP
+#ifndef _VKTDRAWINDIRECTTEST_HPP
+#define _VKTDRAWINDIRECTTEST_HPP
 /*------------------------------------------------------------------------
 * Vulkan Conformance Tests
 * ------------------------
@@ -44,16 +44,16 @@ namespace Draw
 class IndirectDrawTests : public tcu::TestCaseGroup
 {
 public:
-                                       IndirectDrawTests               (tcu::TestContext &testCtx);
-                                       ~IndirectDrawTests              (void);
-       void                    init                                    (void);
+                                               IndirectDrawTests               (tcu::TestContext &testCtx);
+                                               ~IndirectDrawTests              (void);
+       void                            init                                    (void);
 
 private:
-                                       IndirectDrawTests               (const IndirectDrawTests &other);
-                                       IndirectDrawTests&              operator=(const IndirectDrawTests &other);
+       IndirectDrawTests                                                       (const IndirectDrawTests &other);
+       IndirectDrawTests&      operator=                               (const IndirectDrawTests &other);
 
 };
-} //Draw
-} //vkt
+} // Draw
+} // vkt
 
-#endif // #define _VKTDRAWINDIRECTDRAWTESTS_HPP
+#endif // _VKTDRAWINDIRECTTEST_HPP
index 7e27cd8..a4dfa5f 100644 (file)
@@ -33,7 +33,7 @@
 * \brief Simple Draw Tests
 *//*--------------------------------------------------------------------*/
 
-#include "vktDrawsimpleTest.hpp"
+#include "vktDrawSimpleTest.hpp"
 
 #include "vktTestCaseUtil.hpp"
 #include "vktDrawTestCaseUtil.hpp"
@@ -44,6 +44,7 @@
 #include "tcuResource.hpp"
 #include "tcuImageCompare.hpp"
 #include "tcuTextureUtil.hpp"
+#include "tcuRGBA.hpp"
 
 #include "vkDefs.hpp"
 
@@ -52,19 +53,19 @@ namespace vkt
 namespace Draw
 {
 namespace
-{      
+{
 class SimpleDraw : public DrawTestsBaseClass
 {
 public:
-                                                       SimpleDraw      (Context &context, ShaderMap shaders, vk::VkPrimitiveTopology topology);        
-       virtual tcu::TestStatus iterate         (void);
+                                                       SimpleDraw                              (Context &context, ShaderMap shaders, vk::VkPrimitiveTopology topology);
+       virtual tcu::TestStatus iterate                                 (void);
 };
 
 class SimpleDrawInstanced : public SimpleDraw
 {
 public:
-                                               SimpleDrawInstanced                             (Context &context, ShaderMap shaders, vk::VkPrimitiveTopology topology);
-       tcu::TestStatus         SimpleDrawInstanced::iterate    (void);
+                                                       SimpleDrawInstanced             (Context &context, ShaderMap shaders, vk::VkPrimitiveTopology topology);
+       tcu::TestStatus                 iterate                                 (void);
 };
 
 SimpleDraw::SimpleDraw (Context &context, ShaderMap shaders, vk::VkPrimitiveTopology topology)
@@ -74,51 +75,44 @@ SimpleDraw::SimpleDraw (Context &context, ShaderMap shaders, vk::VkPrimitiveTopo
 
        switch (m_topology)
        {
-               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
-                       break;
-               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
-                       break;
-               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST:
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(     1.0f,  -1.0f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(    -1.0f,   1.0f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(    -0.3f,  -0.3f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(    -0.3f,   0.3f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(     0.3f,  -0.3f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(     0.3f,  -0.3f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(     0.3f,   0.3f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(    -0.3f,   0.3f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(    -1.0f,   1.0f,  1.0f,   1.0f), vec4Blue()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(  1.0f,  -1.0f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -1.0f,   1.0f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -0.3f,  -0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -0.3f,   0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(  0.3f,  -0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(  0.3f,  -0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(  0.3f,   0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -0.3f,   0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -1.0f,   1.0f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
                        break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP:
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(     1.0f,  -1.0f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(    -1.0f,   1.0f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(    -0.3f,  -0.3f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(    -0.3f,   0.3f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(     0.3f,  -0.3f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(     0.3f,   0.3f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(    -0.3f,   0.3f,  1.0f,   1.0f), vec4Blue()));
-                       m_data.push_back(Vec4RGBA(tcu::Vec4(    -1.0f,   1.0f,  1.0f,   1.0f), vec4Blue()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(  1.0f,  -1.0f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -1.0f,   1.0f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -0.3f,  -0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -0.3f,   0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(  0.3f,  -0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4(  0.3f,   0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -0.3f,   0.3f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
+                       m_data.push_back(PositionColorVertex(tcu::Vec4( -1.0f,   1.0f,  1.0f,   1.0f), tcu::RGBA::blue().toVec()));
                        break;
+               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_PATCH_LIST:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LAST:
+                       DE_FATAL("Topology not implemented");
                        break;
                default:
+                       DE_FATAL("Unknown topology");
                        break;
        }
-       DrawTestsBaseClass::initialize();
+       initialize();
 }
 
 tcu::TestStatus SimpleDraw::iterate (void)
@@ -130,39 +124,32 @@ tcu::TestStatus SimpleDraw::iterate (void)
 
        const vk::VkDeviceSize vertexBufferOffset       = 0;
        const vk::VkBuffer vertexBuffer                         = m_vertexBuffer->object();
-       m_vk.cmdBindVertexBuffers(*m_cmdBuffer, 0, 1, &vertexBuffer, &vertexBufferOffset);
 
+       m_vk.cmdBindVertexBuffers(*m_cmdBuffer, 0, 1, &vertexBuffer, &vertexBufferOffset);
        m_vk.cmdBindPipeline(*m_cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
 
        switch (m_topology)
        {
-               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
-                       break;
-               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
-                       break;
-               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST:
                        m_vk.cmdDraw(*m_cmdBuffer, 6, 1, 2, 0);
                        break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP:
                        m_vk.cmdDraw(*m_cmdBuffer, 4, 1, 2, 0);
                        break;
+               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_PATCH_LIST:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LAST:
+                       DE_FATAL("Topology not implemented");
                        break;
                default:
+                       DE_FATAL("Unknown topology");
                        break;
        }
 
@@ -173,11 +160,11 @@ tcu::TestStatus SimpleDraw::iterate (void)
        {
                vk::VK_STRUCTURE_TYPE_SUBMIT_INFO,      // VkStructureType                      sType;
                DE_NULL,                                                        // const void*                          pNext;
-               0,                                                                      // deUint32                                     waitSemaphoreCount;
-               DE_NULL,                                                        // const VkSemaphore*           pWaitSemaphores;
-               1,                                                                      // deUint32                                     commandBufferCount;
+               0,                                                                              // deUint32                                     waitSemaphoreCount;
+               DE_NULL,                                                                // const VkSemaphore*           pWaitSemaphores;
+               1,                                                                              // deUint32                                     commandBufferCount;
                &m_cmdBuffer.get(),                                     // const VkCommandBuffer*       pCommandBuffers;
-               0,                                                                      // deUint32                                     signalSemaphoreCount;
+               0,                                                                              // deUint32                                     signalSemaphoreCount;
                DE_NULL                                                         // const VkSemaphore*           pSignalSemaphores;
        };
        VK_CHECK(m_vk.queueSubmit(queue, 1, &submitInfo, DE_NULL));
@@ -186,6 +173,7 @@ tcu::TestStatus SimpleDraw::iterate (void)
 
        // Validation
        tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+
        referenceFrame.allocLevel(0);
 
        const deInt32 frameWidth        = referenceFrame.getWidth();
@@ -193,6 +181,8 @@ tcu::TestStatus SimpleDraw::iterate (void)
 
        tcu::clear(referenceFrame.getLevel(0), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
 
+       ReferenceImageCoordinates refCoords;
+
        for (int y = 0; y < frameHeight; y++)
        {
                const float yCoord = (float)(y / (0.5*frameHeight)) - 1.0f;
@@ -201,7 +191,10 @@ tcu::TestStatus SimpleDraw::iterate (void)
                {
                        const float xCoord = (float)(x / (0.5*frameWidth)) - 1.0f;
 
-                       if ((yCoord >= -0.3f && yCoord <= 0.3f && xCoord >= -0.3f && xCoord <= 0.3f))
+                       if ((yCoord >= refCoords.bottom &&
+                                yCoord <= refCoords.top        &&
+                                xCoord >= refCoords.left       &&
+                                xCoord <= refCoords.right))
                                referenceFrame.getLevel(0).setPixel(tcu::Vec4(0.0f, 0.0f, 1.0f, 1.0f), x, y);
                }
        }
@@ -228,45 +221,40 @@ SimpleDrawInstanced::SimpleDrawInstanced (Context &context, ShaderMap shaders, v
 tcu::TestStatus SimpleDrawInstanced::iterate (void)
 {
        tcu::TestLog &log               = m_context.getTestContext().getLog();
+
        const vk::VkQueue queue = m_context.getUniversalQueue();
 
        beginRenderPass();
 
        const vk::VkDeviceSize vertexBufferOffset = 0;
        const vk::VkBuffer vertexBuffer = m_vertexBuffer->object();
+
        m_vk.cmdBindVertexBuffers(*m_cmdBuffer, 0, 1, &vertexBuffer, &vertexBufferOffset);
 
        m_vk.cmdBindPipeline(*m_cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipeline);
 
        switch (m_topology)
        {
-               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
-                       break;
-               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
-                       break;
-               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST:
                        m_vk.cmdDraw(*m_cmdBuffer, 6, 4, 2, 2);
                        break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP:
                        m_vk.cmdDraw(*m_cmdBuffer, 4, 4, 2, 2);
                        break;
+               case vk::VK_PRIMITIVE_TOPOLOGY_POINT_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
+               case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_PATCH_LIST:
-                       break;
                case vk::VK_PRIMITIVE_TOPOLOGY_LAST:
+                       DE_FATAL("Topology not implemented");
                        break;
                default:
+                       DE_FATAL("Unknown topology");
                        break;
        }
 
@@ -277,11 +265,11 @@ tcu::TestStatus SimpleDrawInstanced::iterate (void)
        {
                vk::VK_STRUCTURE_TYPE_SUBMIT_INFO,      // VkStructureType                      sType;
                DE_NULL,                                                        // const void*                          pNext;
-               0,                                                                      // deUint32                                     waitSemaphoreCount;
-               DE_NULL,                                                        // const VkSemaphore*           pWaitSemaphores;
-               1,                                                                      // deUint32                                     commandBufferCount;
+               0,                                                                              // deUint32                                     waitSemaphoreCount;
+               DE_NULL,                                                                // const VkSemaphore*           pWaitSemaphores;
+               1,                                                                              // deUint32                                     commandBufferCount;
                &m_cmdBuffer.get(),                                     // const VkCommandBuffer*       pCommandBuffers;
-               0,                                                                      // deUint32                                     signalSemaphoreCount;
+               0,                                                                              // deUint32                                     signalSemaphoreCount;
                DE_NULL                                                         // const VkSemaphore*           pSignalSemaphores;
        };
        VK_CHECK(m_vk.queueSubmit(queue, 1, &submitInfo, DE_NULL));
@@ -292,6 +280,7 @@ tcu::TestStatus SimpleDrawInstanced::iterate (void)
        VK_CHECK(m_vk.queueWaitIdle(queue));
 
        tcu::Texture2D referenceFrame(vk::mapVkFormat(m_colorAttachmentFormat), (int)(0.5 + WIDTH), (int)(0.5 + HEIGHT));
+
        referenceFrame.allocLevel(0);
 
        const deInt32 frameWidth        = referenceFrame.getWidth();
@@ -299,6 +288,8 @@ tcu::TestStatus SimpleDrawInstanced::iterate (void)
 
        tcu::clear(referenceFrame.getLevel(0), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
 
+       ReferenceImageInstancedCoordinates refInstancedCoords;
+
        for (int y = 0; y < frameHeight; y++)
        {
                const float yCoord = (float)(y / (0.5*frameHeight)) - 1.0f;
@@ -307,7 +298,10 @@ tcu::TestStatus SimpleDrawInstanced::iterate (void)
                {
                        const float xCoord = (float)(x / (0.5*frameWidth)) - 1.0f;
 
-                       if ((yCoord >= -0.6f && yCoord <= 0.3f && xCoord >= -0.3f && xCoord <= 0.6f))
+                       if ((yCoord >= refInstancedCoords.bottom        &&
+                                yCoord <= refInstancedCoords.top               &&
+                                xCoord >= refInstancedCoords.left              &&
+                                xCoord <= refInstancedCoords.right))
                                referenceFrame.getLevel(0).setPixel(tcu::Vec4(0.0f, 0.0f, 1.0f, 1.0f), x, y);
                }
        }
@@ -343,14 +337,16 @@ void SimpleDrawTests::init (void)
        ShaderMap shaderPaths;
        shaderPaths[glu::SHADERTYPE_VERTEX]             = "vulkan/draw/VertexFetch.vert";
        shaderPaths[glu::SHADERTYPE_FRAGMENT]   = "vulkan/draw/VertexFetch.frag";
+
        addChild(new InstanceFactory<SimpleDraw>(m_testCtx, "simple_draw_triangle_list", "Draws triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
        addChild(new InstanceFactory<SimpleDraw>(m_testCtx, "simple_draw_triangle_strip", "Draws triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP));
 
        shaderPaths[glu::SHADERTYPE_VERTEX]             = "vulkan/draw/VertexFetchWithInstance.vert";
        shaderPaths[glu::SHADERTYPE_FRAGMENT]   = "vulkan/draw/VertexFetch.frag";
+
        addChild(new InstanceFactory<SimpleDrawInstanced>(m_testCtx, "simple_draw_instanced_triangle_list", "Draws an instanced triangle list", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST));
        addChild(new InstanceFactory<SimpleDrawInstanced>(m_testCtx, "simple_draw_instanced_triangle_strip", "Draws an instanced triangle strip", shaderPaths, vk::VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP));
 }
 
 }      // DrawTests
-}      // vkt
\ No newline at end of file
+}      // vkt
index 62eb957..c13e503 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _VKT_SIMPLE_DRAWTESTS_HPP
-#define _VKT_SIMPLE_DRAWTESTS_HPP
+#ifndef _VKTDRAWSIMPLETEST_HPP
+#define _VKTDRAWSIMPLETEST_HPP
 /*------------------------------------------------------------------------
 * Vulkan Conformance Tests
 * ------------------------
@@ -44,16 +44,16 @@ namespace Draw
 class SimpleDrawTests : public tcu::TestCaseGroup
 {
 public:
-                                       SimpleDrawTests                 (tcu::TestContext &testCtx);
-                                       ~SimpleDrawTests                (void);
-       void                    init                                    (void);
+                                               SimpleDrawTests                 (tcu::TestContext &testCtx);
+                                               ~SimpleDrawTests                (void);
+       void                            init                                    (void);
 
 private:
-                                       SimpleDrawTests                 (const SimpleDrawTests &other);
-                                       SimpleDrawTests&                operator=(const SimpleDrawTests &other);
+       SimpleDrawTests                                                         (const SimpleDrawTests &other);
+       SimpleDrawTests&        operator=                               (const SimpleDrawTests &other);
 
 };
-} //Draw
-} //vkt
+} // Draw
+} // vkt
 
-#endif // #define _VKT_SIMPLE_DRAWTESTS_HPP
+#endif // _VKTDRAWSIMPLETEST_HPP
index 65d3457..6484fe5 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _VKTDRAWTESTS_TESTCASEUTIL_HPP
-#define _VKTDRAWTESTS_TESTCASEUTIL_HPP
+#ifndef _VKTDRAWTESTCASEUTIL_HPP
+#define _VKTDRAWTESTCASEUTIL_HPP
 /*------------------------------------------------------------------------
  * Vulkan Conformance Tests
  * ------------------------
@@ -51,9 +51,9 @@ namespace vkt
 namespace Draw
 {
 
-class ShaderSourceProvider 
+class ShaderSourceProvider
 {
-public: 
+public:
        static std::string getSource (tcu::Archive& archive, const char* path)
        {
                tcu::Resource *resource = archive.getResource(path);
@@ -80,9 +80,9 @@ public:
        {
        }
 
-       TestInstance* createInstance (Context& context) const 
-       { 
-               return new Instance(context, m_shaderPaths, m_topology); 
+       TestInstance* createInstance (Context& context) const
+       {
+               return new Instance(context, m_shaderPaths, m_topology);
        }
 
        virtual void initPrograms (vk::SourceCollections& programCollection) const
@@ -99,7 +99,7 @@ private:
        const vk::VkPrimitiveTopology m_topology;
 };
 
-} //Draw
-} //vkt
+} // Draw
+} // vkt
 
-#endif //_VKTDRAWTESTS_TESTCASEUTIL_HPP
\ No newline at end of file
+#endif // _VKTDRAWTESTCASEUTIL_HPP
\ No newline at end of file
index a04b575..912fefa 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _VK_DRAWTESTS_HPP
-#define _VK_DRAWTESTS_HPP
+#ifndef _VKTDRAWTESTS_HPP
+#define _VKTDRAWTESTS_HPP
 /*------------------------------------------------------------------------
 * Vulkan Conformance Tests
 * ------------------------
 
 namespace vkt
 {
-       namespace Draw
+namespace Draw
 {
        tcu::TestCaseGroup*             createTests (tcu::TestContext& testCtx);
 
-} //Draw
-} //vkt
+} // Draw
+} // vkt
 
-#endif // _VK_DRAWTESTS_HPP
+#endif // _VKTDRAWTESTS_HPP