dEQP-VK.renderpass: Set IMAGE_USAGE_TRANSFER_SRC_BIT when needed
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / modules / vulkan / draw / vktDrawCreateInfoUtil.hpp
1 #ifndef _VKTDRAWCREATEINFOUTIL_HPP
2 #define _VKTDRAWCREATEINFOUTIL_HPP
3 /*------------------------------------------------------------------------
4  * Vulkan Conformance Tests
5  * ------------------------
6  *
7  * Copyright (c) 2015 The Khronos Group Inc.
8  * Copyright (c) 2015 Intel Corporation
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining a
11  * copy of this software and/or associated documentation files (the
12  * "Materials"), to deal in the Materials without restriction, including
13  * without limitation the rights to use, copy, modify, merge, publish,
14  * distribute, sublicense, and/or sell copies of the Materials, and to
15  * permit persons to whom the Materials are furnished to do so, subject to
16  * the following conditions:
17  *
18  * The above copyright notice(s) and this permission notice shall be included
19  * in all copies or substantial portions of the Materials.
20  *
21  * The Materials are Confidential Information as defined by the
22  * Khronos Membership Agreement until designated non-confidential by Khronos,
23  * at which point this condition clause shall be removed.
24  *
25  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
28  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
29  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
30  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
31  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
32  *
33  *//*!
34  * \file
35  * \brief CreateInfo utilities
36  *//*--------------------------------------------------------------------*/
37
38 #include "vkDefs.hpp"
39 #include "tcuVector.hpp"
40 #include "deSharedPtr.hpp"
41 #include <vector>
42
43 namespace vkt
44 {
45 namespace Draw
46 {
47
48 class ImageSubresourceRange : public vk::VkImageSubresourceRange
49 {
50 public:
51         ImageSubresourceRange           (vk::VkImageAspectFlags aspectMask,
52                                                                  deUint32                               baseMipLevel    = 0,
53                                                                  deUint32                               levelCount              = 1,
54                                                                  deUint32                               baseArrayLayer  = 0,
55                                                                  deUint32                               layerCount              = 1);
56 };
57
58 class ComponentMapping : public vk::VkComponentMapping
59 {
60 public:
61         ComponentMapping                        (vk::VkComponentSwizzle r = vk::VK_COMPONENT_SWIZZLE_R,
62                                                                  vk::VkComponentSwizzle g = vk::VK_COMPONENT_SWIZZLE_G,
63                                                                  vk::VkComponentSwizzle b = vk::VK_COMPONENT_SWIZZLE_B,
64                                                                  vk::VkComponentSwizzle a = vk::VK_COMPONENT_SWIZZLE_A);
65 };
66
67 class ImageViewCreateInfo : public vk::VkImageViewCreateInfo
68 {
69 public:
70         ImageViewCreateInfo                     (vk::VkImage                                            image,
71                                                                  vk::VkImageViewType                            viewType,
72                                                                  vk::VkFormat                                           format,
73                                                                  const vk::VkImageSubresourceRange&     subresourceRange,
74                                                                  const vk::VkComponentMapping&          components                      = ComponentMapping(),
75                                                                  vk::VkImageViewCreateFlags                     flags                           = 0);
76
77         ImageViewCreateInfo                     (vk::VkImage                                            image,
78                                                                  vk::VkImageViewType                            viewType,
79                                                                  vk::VkFormat                                           format,
80                                                                  const vk::VkComponentMapping&          components                      = ComponentMapping(),
81                                                                  vk::VkImageViewCreateFlags                     flags                           = 0);
82 };
83
84 class BufferViewCreateInfo : public vk::VkBufferViewCreateInfo
85 {
86 public:
87         BufferViewCreateInfo             (vk::VkBuffer          buffer,
88                                                                   vk::VkFormat          format,
89                                                                   vk::VkDeviceSize      offset,
90                                                                   vk::VkDeviceSize      range);
91 };
92
93 class BufferCreateInfo : public vk::VkBufferCreateInfo
94 {
95 public:
96         BufferCreateInfo                        (vk::VkDeviceSize                       size,
97                                                                  vk::VkBufferCreateFlags        usage,
98                                                                  vk::VkSharingMode                      sharingMode                             = vk::VK_SHARING_MODE_EXCLUSIVE,
99                                                                  deUint32                                       queueFamilyIndexCount   = 0,
100                                                                  const deUint32*                        pQueueFamilyIndices             = DE_NULL,
101                                                                  vk::VkBufferCreateFlags        flags                                   = 0);
102
103         BufferCreateInfo                        (const BufferCreateInfo&        other);
104         BufferCreateInfo& operator=     (const BufferCreateInfo&        other);
105
106 private:
107         std::vector<deUint32> m_queueFamilyIndices;
108 };
109
110 class ImageCreateInfo : public vk::VkImageCreateInfo
111 {
112 public:
113         ImageCreateInfo                         (vk::VkImageType                        imageType,
114                                                                  vk::VkFormat                           format,
115                                                                  vk::VkExtent3D                         extent,
116                                                                  deUint32                                       mipLevels,
117                                                                  deUint32                                       arrayLayers,
118                                                                  vk::VkSampleCountFlagBits      samples,
119                                                                  vk::VkImageTiling                      tiling,
120                                                                  vk::VkImageUsageFlags          usage,
121                                                                  vk::VkSharingMode                      sharingMode                             = vk::VK_SHARING_MODE_EXCLUSIVE,
122                                                                  deUint32                                       queueFamilyIndexCount   = 0,
123                                                                  const deUint32*                        pQueueFamilyIndices             = DE_NULL,
124                                                                  vk::VkImageCreateFlags         flags                                   = 0,
125                                                                  vk::VkImageLayout                      initialLayout                   = vk::VK_IMAGE_LAYOUT_UNDEFINED);
126
127 private:
128         ImageCreateInfo                         (const ImageCreateInfo&         other);
129         ImageCreateInfo& operator=      (const ImageCreateInfo&         other);
130
131         std::vector<deUint32> m_queueFamilyIndices;
132 };
133
134 class FramebufferCreateInfo : public vk::VkFramebufferCreateInfo
135 {
136 public:
137         FramebufferCreateInfo           (vk::VkRenderPass                                               renderPass,
138                                                                  const std::vector<vk::VkImageView>&    attachments,
139                                                                  deUint32                                                               width,
140                                                                  deUint32                                                               height,
141                                                                  deUint32                                                               layers);
142 };
143
144 class AttachmentDescription : public vk::VkAttachmentDescription
145 {
146 public:
147         AttachmentDescription   (vk::VkFormat                           format,
148                                                          vk::VkSampleCountFlagBits      samples,
149                                                          vk::VkAttachmentLoadOp         loadOp,
150                                                          vk::VkAttachmentStoreOp        storeOp,
151                                                          vk::VkAttachmentLoadOp         stencilLoadOp,
152                                                          vk::VkAttachmentStoreOp        stencilStoreOp,
153                                                          vk::VkImageLayout                      initialLayout,
154                                                          vk::VkImageLayout                      finalLayout);
155
156         AttachmentDescription   (const vk::VkAttachmentDescription &);
157 };
158
159 class AttachmentReference : public vk::VkAttachmentReference
160 {
161 public:
162         AttachmentReference             (deUint32 attachment, vk::VkImageLayout layout);
163         AttachmentReference             (void);
164 };
165
166 class SubpassDescription : public vk::VkSubpassDescription
167 {
168 public:
169         SubpassDescription                              (vk::VkPipelineBindPoint                        pipelineBindPoint,
170                                                                          vk::VkSubpassDescriptionFlags          flags,
171                                                                          deUint32                                                       inputAttachmentCount,
172                                                                          const vk::VkAttachmentReference*       inputAttachments,
173                                                                          deUint32                                                       colorAttachmentCount,
174                                                                          const vk::VkAttachmentReference*       colorAttachments,
175                                                                          const vk::VkAttachmentReference*       resolveAttachments,
176                                                                          vk::VkAttachmentReference                      depthStencilAttachment,
177                                                                          deUint32                                                       preserveAttachmentCount,
178                                                                          const vk::VkAttachmentReference*       preserveAttachments);
179
180         SubpassDescription                              (const vk::VkSubpassDescription&        other);
181         SubpassDescription                              (const SubpassDescription&                      other);
182         SubpassDescription& operator=   (const SubpassDescription&                      other);
183
184 private:
185         std::vector<vk::VkAttachmentReference>  m_inputAttachments;
186         std::vector<vk::VkAttachmentReference>  m_colorAttachments;
187         std::vector<vk::VkAttachmentReference>  m_resolveAttachments;
188         std::vector<vk::VkAttachmentReference>  m_preserveAttachments;
189
190         vk::VkAttachmentReference                               m_depthStencilAttachment;
191 };
192
193 class SubpassDependency : public vk::VkSubpassDependency
194 {
195 public:
196         SubpassDependency (     deUint32                                        srcSubpass,
197                                                 deUint32                                        dstSubpass,
198                                                 vk::VkPipelineStageFlags        srcStageMask,
199                                                 vk::VkPipelineStageFlags        dstStageMask,
200                                                 vk::VkAccessFlags                       srcAccessMask,
201                                                 vk::VkAccessFlags                       dstAccessMask,
202                                                 vk::VkDependencyFlags           dependencyFlags);
203
204         SubpassDependency (const vk::VkSubpassDependency& other);
205 };
206
207 class RenderPassCreateInfo : public vk::VkRenderPassCreateInfo
208 {
209 public:
210         RenderPassCreateInfo (const std::vector<vk::VkAttachmentDescription>&   attachments,
211                                                   const std::vector<vk::VkSubpassDescription>&          subpasses,
212                                                   const std::vector<vk::VkSubpassDependency>&           dependiences            = std::vector<vk::VkSubpassDependency>());
213
214         RenderPassCreateInfo (deUint32                                                                                  attachmentCount = 0,
215                                                   const vk::VkAttachmentDescription*                            pAttachments    = DE_NULL,
216                                                   deUint32                                                                                      subpassCount    = 0,
217                                                   const vk::VkSubpassDescription*                                       pSubpasses              = DE_NULL,
218                                                   deUint32                                                                                      dependencyCount = 0,
219                                                   const vk::VkSubpassDependency*                                        pDependiences   = DE_NULL);
220
221         void addAttachment      (vk::VkAttachmentDescription                                            attachment);
222         void addSubpass         (vk::VkSubpassDescription                                                       subpass);
223         void addDependency      (vk::VkSubpassDependency                                                        dependency);
224
225 private:
226         std::vector<AttachmentDescription>                      m_attachments;
227         std::vector<SubpassDescription>                         m_subpasses;
228         std::vector<SubpassDependency>                          m_dependiences;
229
230         std::vector<vk::VkAttachmentDescription>        m_attachmentsStructs;
231         std::vector<vk::VkSubpassDescription>           m_subpassesStructs;
232         std::vector<vk::VkSubpassDependency>            m_dependiencesStructs;
233
234         RenderPassCreateInfo                    (const RenderPassCreateInfo &other); //Not allowed!
235         RenderPassCreateInfo& operator= (const RenderPassCreateInfo &other); //Not allowed!
236 };
237
238 class RenderPassBeginInfo : public vk::VkRenderPassBeginInfo
239 {
240 public:
241         RenderPassBeginInfo (vk::VkRenderPass                                           renderPass,
242                                                  vk::VkFramebuffer                                              framebuffer,
243                                                  vk::VkRect2D                                                   renderArea,
244                                                  const std::vector<vk::VkClearValue>&   clearValues = std::vector<vk::VkClearValue>());
245
246 private:
247         std::vector<vk::VkClearValue> m_clearValues;
248
249         RenderPassBeginInfo                             (const RenderPassBeginInfo&     other); //Not allowed!
250         RenderPassBeginInfo& operator=  (const RenderPassBeginInfo&     other); //Not allowed!
251 };
252
253 class CmdPoolCreateInfo : public vk::VkCommandPoolCreateInfo
254 {
255 public:
256         CmdPoolCreateInfo (deUint32                                             queueFamilyIndex,
257                                            vk::VkCommandPoolCreateFlags flags                           = vk::VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT);
258 };
259
260 class CmdBufferBeginInfo : public vk::VkCommandBufferBeginInfo
261 {
262 public:
263         CmdBufferBeginInfo (vk::VkCommandBufferUsageFlags               flags                                   = 0);
264         CmdBufferBeginInfo (vk::VkRenderPass                                    renderPass,
265                                                 deUint32                                                        subpass,
266                                                 vk::VkFramebuffer                                       framebuffer,
267                                                 vk::VkCommandBufferUsageFlags           flags                                   = 0,
268                                                 bool                                                            occlusionQueryEnable    = false,
269                                                 vk::VkQueryControlFlags                         queryFlags                              = 0u,
270                                                 vk::VkQueryPipelineStatisticFlags       pipelineStatistics              = 0u);
271 };
272
273 class DescriptorPoolSize : public vk::VkDescriptorPoolSize
274 {
275 public:
276         DescriptorPoolSize (vk::VkDescriptorType _type, deUint32 _descriptorCount)
277         {
278                 type                    = _type;
279                 descriptorCount = _descriptorCount;
280         }
281 };
282
283 class DescriptorPoolCreateInfo : public vk::VkDescriptorPoolCreateInfo
284 {
285 public:
286         DescriptorPoolCreateInfo (const std::vector<vk::VkDescriptorPoolSize>&  poolSizeCounts,
287                                                           vk::VkDescriptorPoolCreateFlags                               flags,
288                                                           deUint32                                                                              maxSets);
289
290         DescriptorPoolCreateInfo& addDescriptors (vk::VkDescriptorType type, deUint32 count);
291
292 private:
293         std::vector<vk::VkDescriptorPoolSize> m_poolSizeCounts;
294 };
295
296 class DescriptorSetLayoutCreateInfo : public vk::VkDescriptorSetLayoutCreateInfo
297 {
298 public:
299         DescriptorSetLayoutCreateInfo (deUint32 bindingCount, const vk::VkDescriptorSetLayoutBinding* pBindings);
300 };
301
302 class PipelineLayoutCreateInfo : public vk::VkPipelineLayoutCreateInfo
303 {
304 public:
305         PipelineLayoutCreateInfo (deUint32                                                                              descriptorSetCount,
306                                                           const vk::VkDescriptorSetLayout*                              pSetLayouts,
307                                                                           deUint32                                                                              pushConstantRangeCount  = 0,
308                                                           const vk::VkPushConstantRange*                                pPushConstantRanges             = DE_NULL);
309
310         PipelineLayoutCreateInfo (const std::vector<vk::VkDescriptorSetLayout>& setLayouts                              = std::vector<vk::VkDescriptorSetLayout>(),
311                                                           deUint32                                                                              pushConstantRangeCount  = 0,
312                                                           const vk::VkPushConstantRange*                                pPushConstantRanges             = DE_NULL);
313
314 private:
315         std::vector<vk::VkDescriptorSetLayout>  m_setLayouts;
316         std::vector<vk::VkPushConstantRange>    m_pushConstantRanges;
317 };
318
319 class PipelineCreateInfo : public vk::VkGraphicsPipelineCreateInfo
320 {
321 public:
322         class VertexInputState : public vk::VkPipelineVertexInputStateCreateInfo
323         {
324         public:
325                 VertexInputState (deUint32                                                                              vertexBindingDescriptionCount   = 0,
326                                                   const vk::VkVertexInputBindingDescription*    pVertexBindingDescriptions              = NULL,
327                                                   deUint32                                                                              vertexAttributeDescriptionCount = 0,
328                                                   const vk::VkVertexInputAttributeDescription*  pVertexAttributeDescriptions    = NULL);
329         };
330
331         class InputAssemblerState : public vk::VkPipelineInputAssemblyStateCreateInfo
332         {
333         public:
334                 InputAssemblerState (vk::VkPrimitiveTopology topology, vk::VkBool32 primitiveRestartEnable = false);
335         };
336
337         class TesselationState : public vk::VkPipelineTessellationStateCreateInfo
338         {
339         public:
340                 TesselationState (deUint32 patchControlPoints = 0);
341         };
342
343         class ViewportState : public vk::VkPipelineViewportStateCreateInfo
344         {
345         public:
346                 ViewportState                           (deUint32                                               viewportCount,
347                                                                          std::vector<vk::VkViewport>    viewports               = std::vector<vk::VkViewport>(0),
348                                                                          std::vector<vk::VkRect2D>              scissors                = std::vector<vk::VkRect2D>(0));
349
350                 ViewportState                           (const ViewportState&                   other);
351                 ViewportState& operator=        (const ViewportState&                   other);
352
353                 std::vector<vk::VkViewport> m_viewports;
354                 std::vector<vk::VkRect2D>       m_scissors;
355         };
356
357         class RasterizerState : public vk::VkPipelineRasterizationStateCreateInfo
358         {
359         public:
360                 RasterizerState (vk::VkBool32                   depthClampEnable                = false,
361                                                  vk::VkBool32                   rasterizerDiscardEnable = false,
362                                                  vk::VkPolygonMode              polygonMode                             = vk::VK_POLYGON_MODE_FILL,
363                                                  vk::VkCullModeFlags    cullMode                                = vk::VK_CULL_MODE_NONE,
364                                                  vk::VkFrontFace                frontFace                               = vk::VK_FRONT_FACE_CLOCKWISE,
365                                                  vk::VkBool32                   depthBiasEnable                 = true,
366                                                  float                                  depthBiasConstantFactor = 0.0f,
367                                                  float                                  depthBiasClamp                  = 0.0f,
368                                                  float                                  depthBiasSlopeFactor    = 0.0f,
369                                                  float                                  lineWidth                               = 1.0f);
370         };
371
372         class MultiSampleState : public vk::VkPipelineMultisampleStateCreateInfo
373         {
374         public:
375                 MultiSampleState                        (vk::VkSampleCountFlagBits                              rasterizationSamples            = vk::VK_SAMPLE_COUNT_1_BIT,
376                                                                          vk::VkBool32                                                   sampleShadingEnable                     = false,
377                                                                          float                                                                  minSampleShading                        = 0.0f,
378                                                                          const std::vector<vk::VkSampleMask>&   sampleMask                                      = std::vector<vk::VkSampleMask>(1, 0xffffffff),
379                                                                          bool                                                                   alphaToCoverageEnable           = false,
380                                                                          bool                                                                   alphaToOneEnable                        = false);
381
382                 MultiSampleState                        (const MultiSampleState&                                other);
383                 MultiSampleState& operator= (const MultiSampleState&                            other);
384
385         private:
386                 std::vector<vk::VkSampleMask> m_sampleMask;
387         };
388
389         class ColorBlendState : public vk::VkPipelineColorBlendStateCreateInfo
390         {
391         public:
392                 class Attachment : public vk::VkPipelineColorBlendAttachmentState
393                 {
394                 public:
395                         Attachment (vk::VkBool32                blendEnable                     = false,
396                                                 vk::VkBlendFactor       srcColorBlendFactor     = vk::VK_BLEND_FACTOR_SRC_COLOR,
397                                                 vk::VkBlendFactor       dstColorBlendFactor     = vk::VK_BLEND_FACTOR_DST_COLOR,
398                                                 vk::VkBlendOp           colorBlendOp            = vk::VK_BLEND_OP_ADD,
399                                                 vk::VkBlendFactor       srcAlphaBlendFactor     = vk::VK_BLEND_FACTOR_SRC_COLOR,
400                                                 vk::VkBlendFactor       dstAlphaBlendFactor     = vk::VK_BLEND_FACTOR_DST_COLOR,
401                                                 vk::VkBlendOp           alphaBlendOp            = vk::VK_BLEND_OP_ADD,
402                                                 deUint8                         colorWriteMask          = 0xff);
403                 };
404
405                 ColorBlendState (const std::vector<vk::VkPipelineColorBlendAttachmentState>&    attachments,
406                                                  vk::VkBool32                                                                                                   alphaToCoverageEnable   = false,
407                                                  vk::VkLogicOp                                                                                                  logicOp                                 = vk::VK_LOGIC_OP_COPY);
408
409                 ColorBlendState (deUint32                                                                                                               attachmentCount,
410                                                  const vk::VkPipelineColorBlendAttachmentState*                                 attachments,
411                                                  vk::VkBool32                                                                                                   logicOpEnable                   = false,
412                                                  vk::VkLogicOp                                                                                                  logicOp                                 = vk::VK_LOGIC_OP_COPY);
413
414                 ColorBlendState (const vk::VkPipelineColorBlendStateCreateInfo&                                 createInfo);
415                 ColorBlendState (const ColorBlendState&                                                                                 createInfo,
416                                                  std::vector<float>                                                                                             blendConstants                  = std::vector<float>(4));
417
418         private:
419                 std::vector<vk::VkPipelineColorBlendAttachmentState> m_attachments;
420         };
421
422         class DepthStencilState : public vk::VkPipelineDepthStencilStateCreateInfo
423         {
424         public:
425                 class StencilOpState : public vk::VkStencilOpState
426                 {
427                 public:
428                         StencilOpState (vk::VkStencilOp failOp                                  = vk::VK_STENCIL_OP_REPLACE,
429                                                         vk::VkStencilOp passOp                                  = vk::VK_STENCIL_OP_REPLACE,
430                                                         vk::VkStencilOp depthFailOp                             = vk::VK_STENCIL_OP_REPLACE,
431                                                         vk::VkCompareOp compareOp                               = vk::VK_COMPARE_OP_ALWAYS,
432                                                         deUint32                compareMask                             = 0xffffffffu,
433                                                         deUint32                writeMask                               = 0xffffffffu,
434                                                         deUint32                reference                               = 0);
435                 };
436
437                 DepthStencilState (vk::VkBool32         depthTestEnable                 = false,
438                                                    vk::VkBool32         depthWriteEnable                = false,
439                                                    vk::VkCompareOp      depthCompareOp                  = vk::VK_COMPARE_OP_ALWAYS,
440                                                    vk::VkBool32         depthBoundsTestEnable   = false,
441                                                    vk::VkBool32         stencilTestEnable               = false,
442                                                    StencilOpState       front                                   = StencilOpState(),
443                                                    StencilOpState       back                                    = StencilOpState(),
444                                                    float                        minDepthBounds                  = -1.0f,
445                                                    float                        maxDepthBounds                  = 1.0f);
446         };
447
448         class PipelineShaderStage : public vk::VkPipelineShaderStageCreateInfo
449         {
450         public:
451                 PipelineShaderStage (vk::VkShaderModule shaderModule, const char* pName, vk::VkShaderStageFlagBits stage);
452         };
453
454         class DynamicState : public vk::VkPipelineDynamicStateCreateInfo
455         {
456         public:
457                 DynamicState                    (const std::vector<vk::VkDynamicState>& dynamicStates = std::vector<vk::VkDynamicState>(0));
458
459                 DynamicState                    (const DynamicState& other);
460                 DynamicState& operator= (const DynamicState& other);
461
462                 std::vector<vk::VkDynamicState> m_dynamicStates;
463         };
464
465         PipelineCreateInfo                              (vk::VkPipelineLayout                                                           layout,
466                                                                      vk::VkRenderPass                                                                   renderPass,
467                                                                          int                                                                                            subpass,
468                                                                          vk::VkPipelineCreateFlags                                                      flags);
469
470         PipelineCreateInfo& addShader   (const vk::VkPipelineShaderStageCreateInfo&                     shader);
471
472         PipelineCreateInfo& addState    (const vk::VkPipelineVertexInputStateCreateInfo&        state);
473         PipelineCreateInfo& addState    (const vk::VkPipelineInputAssemblyStateCreateInfo&      state);
474         PipelineCreateInfo& addState    (const vk::VkPipelineColorBlendStateCreateInfo&         state);
475         PipelineCreateInfo& addState    (const vk::VkPipelineViewportStateCreateInfo&           state);
476         PipelineCreateInfo& addState    (const vk::VkPipelineDepthStencilStateCreateInfo&       state);
477         PipelineCreateInfo& addState    (const vk::VkPipelineTessellationStateCreateInfo&       state);
478         PipelineCreateInfo& addState    (const vk::VkPipelineRasterizationStateCreateInfo&      state);
479         PipelineCreateInfo& addState    (const vk::VkPipelineMultisampleStateCreateInfo&        state);
480         PipelineCreateInfo& addState    (const vk::VkPipelineDynamicStateCreateInfo&            state);
481
482 private:
483         std::vector<vk::VkPipelineShaderStageCreateInfo>                m_shaders;
484
485         vk::VkPipelineVertexInputStateCreateInfo                                m_vertexInputState;
486         vk::VkPipelineInputAssemblyStateCreateInfo                              m_inputAssemblyState;
487         std::vector<vk::VkPipelineColorBlendAttachmentState>    m_colorBlendStateAttachments;
488         vk::VkPipelineColorBlendStateCreateInfo                                 m_colorBlendState;
489         vk::VkPipelineViewportStateCreateInfo                                   m_viewportState;
490         vk::VkPipelineDepthStencilStateCreateInfo                               m_dynamicDepthStencilState;
491         vk::VkPipelineTessellationStateCreateInfo                               m_tessState;
492         vk::VkPipelineRasterizationStateCreateInfo                              m_rasterState;
493         vk::VkPipelineMultisampleStateCreateInfo                                m_multisampleState;
494         vk::VkPipelineDynamicStateCreateInfo                                    m_dynamicState;
495
496         std::vector<vk::VkDynamicState>                                                 m_dynamicStates;
497
498         std::vector<vk::VkViewport>                                                             m_viewports;
499         std::vector<vk::VkRect2D>                                                               m_scissors;
500
501         std::vector<vk::VkSampleMask>                                                   m_multisampleStateSampleMask;
502 };
503
504 class SamplerCreateInfo : public vk::VkSamplerCreateInfo
505 {
506 public:
507         SamplerCreateInfo (vk::VkFilter                         magFilter                               = vk::VK_FILTER_NEAREST,
508                                            vk::VkFilter                         minFilter                               = vk::VK_FILTER_NEAREST,
509                                            vk::VkSamplerMipmapMode      mipmapMode                              = vk::VK_SAMPLER_MIPMAP_MODE_NEAREST,
510                                            vk::VkSamplerAddressMode     addressU                                = vk::VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT,
511                                            vk::VkSamplerAddressMode     addressV                                = vk::VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT,
512                                            vk::VkSamplerAddressMode     addressW                                = vk::VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT,
513                                            float                                        mipLodBias                              = 0.0f,
514                                            float                                        maxAnisotropy                   = 1.0f,
515                                            vk::VkBool32                         compareEnable                   = false,
516                                            vk::VkCompareOp                      compareOp                               = vk::VK_COMPARE_OP_ALWAYS,
517                                            float                                        minLod                                  = 0.0f,
518                                            float                                        maxLod                                  = 16.0f,
519                                            vk::VkBorderColor            borderColor                             = vk::VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE,
520                                            vk::VkBool32                         unnormalizedCoordinates = false);
521 };
522
523 } // Draw
524 } // vkt
525
526 #endif // _VKTDRAWCREATEINFOUTIL_HPP