Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Vulkan Tests |
| 3 | * |
| 4 | * Copyright (C) 2014 LunarG, Inc. |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | * copy of this software and associated documentation files (the "Software"), |
| 8 | * to deal in the Software without restriction, including without limitation |
| 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 | * and/or sell copies of the Software, and to permit persons to whom the |
| 11 | * Software is furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included |
| 14 | * in all copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 22 | * DEALINGS IN THE SOFTWARE. |
| 23 | * |
| 24 | * Authors: |
| 25 | * Courtney Goeltzenleuchter <courtney@lunarg.com> |
| 26 | */ |
| 27 | |
| 28 | #ifndef VKRENDERFRAMEWORK_H |
| 29 | #define VKRENDERFRAMEWORK_H |
| 30 | |
| 31 | #include "vktestframework.h" |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 32 | #include "vk_debug_report_lunarg.h" |
| 33 | #include "vk_debug_marker_lunarg.h" |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 34 | |
| 35 | |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 36 | class VkDeviceObj : public vk_testing::Device |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 37 | { |
| 38 | public: |
Tony Barbour | d1c3572 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 39 | VkDeviceObj(uint32_t id, VkPhysicalDevice obj); |
Courtney Goeltzenleuchter | 5bac609 | 2015-07-07 11:47:33 -0600 | [diff] [blame] | 40 | VkDeviceObj(uint32_t id, VkPhysicalDevice obj, |
| 41 | std::vector<const char *> &layers, |
| 42 | std::vector<const char *> &extension_names); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 43 | |
Chia-I Wu | f368b60 | 2015-07-03 10:41:20 +0800 | [diff] [blame] | 44 | VkDevice device() { return handle(); } |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 45 | void get_device_queue(); |
| 46 | |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 47 | uint32_t id; |
| 48 | VkPhysicalDeviceProperties props; |
Cody Northrop | d080288 | 2015-08-03 17:04:53 -0600 | [diff] [blame] | 49 | const VkQueueFamilyProperties *queue_props; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 50 | |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 51 | VkQueue m_queue; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 52 | }; |
| 53 | |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 54 | class VkDepthStencilObj : public vk_testing::Image |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 55 | { |
| 56 | public: |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 57 | VkDepthStencilObj(); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 58 | void Init(VkDeviceObj *device, int32_t width, int32_t height, VkFormat format); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 59 | bool Initialized(); |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 60 | VkImageView* BindInfo(); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 61 | |
| 62 | protected: |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 63 | VkDeviceObj *m_device; |
| 64 | bool m_initialized; |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 65 | vk_testing::ImageView m_imageView; |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 66 | VkFormat m_depth_stencil_fmt; |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 67 | VkImageView m_attachmentBindInfo; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 68 | }; |
| 69 | |
Tony Barbour | fe3351b | 2015-07-28 10:17:20 -0600 | [diff] [blame] | 70 | class VkCommandBufferObj; |
| 71 | |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 72 | class VkRenderFramework : public VkTestFramework |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 73 | { |
| 74 | public: |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 75 | VkRenderFramework(); |
| 76 | ~VkRenderFramework(); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 77 | |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 78 | VkDevice device() {return m_device->device();} |
Tony Barbour | d1c3572 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 79 | VkPhysicalDevice gpu() {return objs[0];} |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 80 | VkRenderPass renderPass() {return m_renderPass;} |
| 81 | VkFramebuffer framebuffer() {return m_framebuffer;} |
Tony Barbour | 823e6ca | 2015-07-27 13:31:04 -0600 | [diff] [blame] | 82 | std::vector<vk_testing::ShaderModule*> m_shader_modules; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 83 | void InitViewport(float width, float height); |
| 84 | void InitViewport(); |
| 85 | void InitRenderTarget(); |
| 86 | void InitRenderTarget(uint32_t targets); |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 87 | void InitRenderTarget(VkImageView *dsBinding); |
| 88 | void InitRenderTarget(uint32_t targets, VkImageView *dsBinding); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 89 | void InitFramework(); |
Courtney Goeltzenleuchter | cd69eee | 2015-07-06 09:10:47 -0600 | [diff] [blame] | 90 | void InitFramework( |
| 91 | std::vector<const char *> instance_layer_names, |
| 92 | std::vector<const char *> device_layer_names, |
| 93 | std::vector<const char *> instance_extension_names, |
| 94 | std::vector<const char *> device_extension_names, |
| 95 | PFN_vkDbgMsgCallback=NULL, |
| 96 | void *userData=NULL); |
| 97 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 98 | void ShutdownFramework(); |
| 99 | void InitState(); |
| 100 | |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 101 | const VkRenderPassBeginInfo &renderPassBeginInfo() const { return m_renderPassBeginInfo; } |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 102 | |
| 103 | protected: |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 104 | VkApplicationInfo app_info; |
| 105 | VkInstance inst; |
| 106 | VkPhysicalDevice objs[16]; |
| 107 | uint32_t gpu_count; |
| 108 | VkDeviceObj *m_device; |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 109 | VkCommandPool m_commandPool; |
| 110 | VkCommandBufferObj *m_commandBuffer; |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 111 | VkRenderPass m_renderPass; |
| 112 | VkFramebuffer m_framebuffer; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 113 | std::vector<VkViewport> m_viewports; |
| 114 | std::vector<VkRect2D> m_scissors; |
| 115 | float m_lineWidth; |
Chia-I Wu | d8c946a | 2015-10-26 19:08:09 +0800 | [diff] [blame] | 116 | float m_depthBiasConstantFactor; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 117 | float m_depthBiasClamp; |
Chia-I Wu | d8c946a | 2015-10-26 19:08:09 +0800 | [diff] [blame] | 118 | float m_depthBiasSlopeFactor; |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 119 | float m_blendConstants[4]; |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 120 | float m_minDepthBounds; |
| 121 | float m_maxDepthBounds; |
| 122 | uint32_t m_stencilCompareMask; |
| 123 | uint32_t m_stencilWriteMask; |
| 124 | uint32_t m_stencilReference; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 125 | std::vector<VkClearValue> m_renderPassClearValues; |
| 126 | VkRenderPassBeginInfo m_renderPassBeginInfo; |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 127 | vector<VkImageObj*> m_renderTargets; |
| 128 | float m_width, m_height; |
| 129 | VkFormat m_render_target_fmt; |
| 130 | VkFormat m_depth_stencil_fmt; |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 131 | VkClearColorValue m_clear_color; |
Chris Forbes | e182fe0 | 2015-06-15 09:32:35 +1200 | [diff] [blame] | 132 | bool m_clear_via_load_op; |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 133 | float m_depth_clear_color; |
| 134 | uint32_t m_stencil_clear_color; |
| 135 | VkDepthStencilObj *m_depthStencil; |
Courtney Goeltzenleuchter | f579fa6 | 2015-06-10 17:39:03 -0600 | [diff] [blame] | 136 | PFN_vkDbgCreateMsgCallback m_dbgCreateMsgCallback; |
Courtney Goeltzenleuchter | 7e46b62 | 2015-06-08 15:16:04 -0600 | [diff] [blame] | 137 | PFN_vkDbgDestroyMsgCallback m_dbgDestroyMsgCallback; |
Courtney Goeltzenleuchter | d971b61 | 2015-06-17 20:51:59 -0600 | [diff] [blame] | 138 | VkDbgMsgCallback m_globalMsgCallback; |
| 139 | VkDbgMsgCallback m_devMsgCallback; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 140 | |
| 141 | /* |
| 142 | * SetUp and TearDown are called by the Google Test framework |
| 143 | * to initialize a test framework based on this class. |
| 144 | */ |
| 145 | virtual void SetUp() { |
| 146 | this->app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; |
| 147 | this->app_info.pNext = NULL; |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 148 | this->app_info.pApplicationName = "base"; |
| 149 | this->app_info.applicationVersion = 1; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 150 | this->app_info.pEngineName = "unittest"; |
| 151 | this->app_info.engineVersion = 1; |
| 152 | this->app_info.apiVersion = VK_API_VERSION; |
| 153 | |
| 154 | InitFramework(); |
| 155 | } |
| 156 | |
| 157 | virtual void TearDown() { |
| 158 | ShutdownFramework(); |
| 159 | } |
| 160 | }; |
| 161 | |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 162 | class VkDescriptorSetObj; |
| 163 | class VkIndexBufferObj; |
| 164 | class VkConstantBufferObj; |
| 165 | class VkPipelineObj; |
| 166 | class VkDescriptorSetObj; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 167 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 168 | class VkCommandBufferObj : public vk_testing::CommandBuffer |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 169 | { |
| 170 | public: |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 171 | VkCommandBufferObj(VkDeviceObj *device, VkCommandPool pool); |
| 172 | VkCommandBuffer GetBufferHandle(); |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 173 | VkResult BeginCommandBuffer(); |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 174 | VkResult BeginCommandBuffer(VkCommandBufferBeginInfo *pInfo); |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 175 | VkResult EndCommandBuffer(); |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 176 | void PipelineBarrier(VkPipelineStageFlags src_stages, VkPipelineStageFlags dest_stages, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const void* const* ppMemoryBarriers); |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 177 | void AddRenderTarget(VkImageObj *renderTarget); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 178 | void AddDepthStencil(); |
Chris Forbes | f0796e1 | 2015-06-24 14:34:53 +1200 | [diff] [blame] | 179 | void ClearAllBuffers(VkClearColorValue clear_color, float depth_clear_color, uint32_t stencil_clear_color, VkDepthStencilObj *depthStencilObj); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 180 | void PrepareAttachments(); |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 181 | void BindPipeline(VkPipelineObj &pipeline); |
| 182 | void BindDescriptorSet(VkDescriptorSetObj &descriptorSet); |
Tony Barbour | d1c3572 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 183 | void BindVertexBuffer(VkConstantBufferObj *vertexBuffer, VkDeviceSize offset, uint32_t binding); |
Cody Northrop | d2ad034 | 2015-08-05 11:15:02 -0600 | [diff] [blame] | 184 | void BindIndexBuffer(VkIndexBufferObj *indexBuffer, VkDeviceSize offset); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 185 | void BeginRenderPass(const VkRenderPassBeginInfo &info); |
Chia-I Wu | 0b50a1c | 2015-06-26 15:34:39 +0800 | [diff] [blame] | 186 | void EndRenderPass(); |
Tony Barbour | c1eb1a5 | 2015-07-20 13:00:10 -0600 | [diff] [blame] | 187 | void FillBuffer(VkBuffer buffer, VkDeviceSize offset, VkDeviceSize fill_size, uint32_t data); |
Courtney Goeltzenleuchter | 08c2637 | 2015-09-23 12:31:50 -0600 | [diff] [blame] | 188 | void Draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); |
| 189 | void DrawIndexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 190 | void QueueCommandBuffer(); |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 191 | void QueueCommandBuffer(VkFence fence); |
Courtney Goeltzenleuchter | 078f817 | 2015-09-21 11:44:06 -0600 | [diff] [blame] | 192 | void SetViewport(uint32_t viewportCount, const VkViewport* pViewports); |
| 193 | void SetScissor(uint32_t scissorCount, const VkRect2D* pScissors); |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 194 | void SetLineWidth(float lineWidth); |
Chia-I Wu | d8c946a | 2015-10-26 19:08:09 +0800 | [diff] [blame] | 195 | void SetDepthBias(float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor); |
Chia-I Wu | 2bfb33c | 2015-10-26 17:24:52 +0800 | [diff] [blame] | 196 | void SetBlendConstants(const float blendConstants[4]); |
Courtney Goeltzenleuchter | 49c7308 | 2015-09-17 15:06:17 -0600 | [diff] [blame] | 197 | void SetDepthBounds(float minDepthBounds, float maxDepthBounds); |
| 198 | void SetStencilReadMask(VkStencilFaceFlags faceMask, uint32_t stencilCompareMask); |
| 199 | void SetStencilWriteMask(VkStencilFaceFlags faceMask, uint32_t stencilWriteMask); |
| 200 | void SetStencilReference(VkStencilFaceFlags faceMask, uint32_t stencilReference); |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 201 | void UpdateBuffer(VkBuffer buffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const uint32_t *pData); |
| 202 | void CopyImage(VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions); |
| 203 | void ResolveImage(VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 204 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 205 | protected: |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 206 | VkDeviceObj *m_device; |
| 207 | vector<VkImageObj*> m_renderTargets; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 208 | }; |
| 209 | |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 210 | class VkConstantBufferObj : public vk_testing::Buffer |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 211 | { |
| 212 | public: |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 213 | VkConstantBufferObj(VkDeviceObj *device); |
| 214 | VkConstantBufferObj(VkDeviceObj *device, int constantCount, int constantSize, const void* data); |
| 215 | ~VkConstantBufferObj(); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 216 | void BufferMemoryBarrier( |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 217 | VkFlags outputMask = |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 218 | VK_MEMORY_OUTPUT_HOST_WRITE_BIT | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 219 | VK_MEMORY_OUTPUT_SHADER_WRITE_BIT | |
| 220 | VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT | |
| 221 | VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
Courtney Goeltzenleuchter | b9776ab | 2015-04-15 15:29:59 -0600 | [diff] [blame] | 222 | VK_MEMORY_OUTPUT_TRANSFER_BIT, |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 223 | VkFlags inputMask = |
Courtney Goeltzenleuchter | f69f8a2 | 2015-04-29 17:16:21 -0600 | [diff] [blame] | 224 | VK_MEMORY_INPUT_HOST_READ_BIT | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 225 | VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT | |
| 226 | VK_MEMORY_INPUT_INDEX_FETCH_BIT | |
| 227 | VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT | |
| 228 | VK_MEMORY_INPUT_UNIFORM_READ_BIT | |
| 229 | VK_MEMORY_INPUT_SHADER_READ_BIT | |
| 230 | VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT | |
| 231 | VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT | |
Courtney Goeltzenleuchter | b9776ab | 2015-04-15 15:29:59 -0600 | [diff] [blame] | 232 | VK_MEMORY_INPUT_TRANSFER_BIT); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 233 | |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 234 | void Bind(VkCommandBuffer commandBuffer, VkDeviceSize offset, uint32_t binding); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 235 | |
Courtney Goeltzenleuchter | 4cb6d92 | 2015-10-23 13:38:14 -0600 | [diff] [blame] | 236 | VkDescriptorBufferInfo m_descriptorBufferInfo; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 237 | |
| 238 | protected: |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 239 | VkDeviceObj *m_device; |
| 240 | vk_testing::BufferView m_bufferView; |
| 241 | int m_numVertices; |
| 242 | int m_stride; |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 243 | vk_testing::CommandPool *m_commandPool; |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 244 | VkCommandBufferObj *m_commandBuffer; |
| 245 | vk_testing::Fence m_fence; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 246 | }; |
| 247 | |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 248 | class VkIndexBufferObj : public VkConstantBufferObj |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 249 | { |
| 250 | public: |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 251 | VkIndexBufferObj(VkDeviceObj *device); |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 252 | void CreateAndInitBuffer(int numIndexes, VkIndexType dataFormat, const void* data); |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 253 | void Bind(VkCommandBuffer commandBuffer, VkDeviceSize offset); |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 254 | VkIndexType GetIndexType(); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 255 | |
| 256 | protected: |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 257 | VkIndexType m_indexType; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 258 | }; |
| 259 | |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 260 | class VkImageObj : public vk_testing::Image |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 261 | { |
| 262 | public: |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 263 | VkImageObj(VkDeviceObj *dev); |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 264 | bool IsCompatible(VkFlags usage, VkFlags features); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 265 | |
| 266 | public: |
| 267 | void init(uint32_t w, uint32_t h, |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 268 | VkFormat fmt, VkFlags usage, |
Tony Barbour | 4c97d7a | 2015-04-22 15:10:33 -0600 | [diff] [blame] | 269 | VkImageTiling tiling=VK_IMAGE_TILING_LINEAR, |
| 270 | VkMemoryPropertyFlags reqs=0); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 271 | |
| 272 | // void clear( CommandBuffer*, uint32_t[4] ); |
| 273 | |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 274 | void layout( VkImageLayout layout ) |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 275 | { |
Courtney Goeltzenleuchter | 4cb6d92 | 2015-10-23 13:38:14 -0600 | [diff] [blame] | 276 | m_descriptorImageInfo.imageLayout = layout; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 277 | } |
| 278 | |
Tony Barbour | d1c3572 | 2015-04-16 15:59:00 -0600 | [diff] [blame] | 279 | VkDeviceMemory memory() const |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 280 | { |
Chia-I Wu | 681d7a0 | 2015-07-03 13:44:34 +0800 | [diff] [blame] | 281 | return Image::memory().handle(); |
| 282 | } |
| 283 | |
| 284 | void *MapMemory() |
| 285 | { |
| 286 | return Image::memory().map(); |
| 287 | } |
| 288 | |
| 289 | void UnmapMemory() |
| 290 | { |
| 291 | Image::memory().unmap(); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 292 | } |
| 293 | |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 294 | void ImageMemoryBarrier(VkCommandBufferObj *cmd, |
Courtney Goeltzenleuchter | 908e767 | 2015-10-21 17:00:51 -0600 | [diff] [blame] | 295 | VkImageAspectFlags aspect, |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 296 | VkFlags output_mask, |
| 297 | VkFlags input_mask, |
| 298 | VkImageLayout image_layout); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 299 | |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 300 | VkResult CopyImage(VkImageObj &src_image); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 301 | |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 302 | VkImage image() const |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 303 | { |
Chia-I Wu | 681d7a0 | 2015-07-03 13:44:34 +0800 | [diff] [blame] | 304 | return handle(); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 305 | } |
| 306 | |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 307 | VkImageView targetView(VkFormat format) |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 308 | { |
| 309 | if (!m_targetView.initialized()) |
| 310 | { |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 311 | VkImageViewCreateInfo createView = {}; |
| 312 | createView.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; |
| 313 | createView.image = handle(); |
| 314 | createView.viewType = VK_IMAGE_VIEW_TYPE_2D; |
| 315 | createView.format = format; |
| 316 | createView.channels.r = VK_CHANNEL_SWIZZLE_R; |
| 317 | createView.channels.g = VK_CHANNEL_SWIZZLE_G; |
| 318 | createView.channels.b = VK_CHANNEL_SWIZZLE_B; |
| 319 | createView.channels.a = VK_CHANNEL_SWIZZLE_A; |
Cody Northrop | 4232dad | 2015-09-14 13:48:12 -0600 | [diff] [blame] | 320 | createView.subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}; |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 321 | createView.flags = 0; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 322 | m_targetView.init(*m_device, createView); |
| 323 | } |
Chia-I Wu | 3158bf3 | 2015-07-03 11:49:42 +0800 | [diff] [blame] | 324 | return m_targetView.handle(); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 325 | } |
| 326 | |
Courtney Goeltzenleuchter | 908e767 | 2015-10-21 17:00:51 -0600 | [diff] [blame] | 327 | void SetLayout(VkCommandBufferObj *cmd_buf, VkImageAspectFlagBits aspect, VkImageLayout image_layout); |
| 328 | void SetLayout(VkImageAspectFlagBits aspect, VkImageLayout image_layout); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 329 | |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 330 | VkImageLayout layout() const |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 331 | { |
Courtney Goeltzenleuchter | 4cb6d92 | 2015-10-23 13:38:14 -0600 | [diff] [blame] | 332 | return m_descriptorImageInfo.imageLayout; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 333 | } |
| 334 | uint32_t width() const |
| 335 | { |
| 336 | return extent().width; |
| 337 | } |
| 338 | uint32_t height() const |
| 339 | { |
| 340 | return extent().height; |
| 341 | } |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 342 | VkDeviceObj* device() const |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 343 | { |
| 344 | return m_device; |
| 345 | } |
| 346 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 347 | protected: |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 348 | VkDeviceObj *m_device; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 349 | |
Courtney Goeltzenleuchter | 5861a1b | 2015-09-01 17:30:39 -0600 | [diff] [blame] | 350 | vk_testing::ImageView m_targetView; |
Courtney Goeltzenleuchter | 4cb6d92 | 2015-10-23 13:38:14 -0600 | [diff] [blame] | 351 | VkDescriptorImageInfo m_descriptorImageInfo; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 352 | }; |
| 353 | |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 354 | class VkTextureObj : public VkImageObj |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 355 | { |
| 356 | public: |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 357 | VkTextureObj(VkDeviceObj *device, uint32_t *colors = NULL); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 358 | |
Courtney Goeltzenleuchter | 4cb6d92 | 2015-10-23 13:38:14 -0600 | [diff] [blame] | 359 | VkDescriptorImageInfo m_imageInfo; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 360 | |
| 361 | protected: |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 362 | VkDeviceObj *m_device; |
| 363 | vk_testing::ImageView m_textureView; |
| 364 | VkDeviceSize m_rowPitch; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 365 | }; |
| 366 | |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 367 | class VkSamplerObj : public vk_testing::Sampler |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 368 | { |
| 369 | public: |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 370 | VkSamplerObj(VkDeviceObj *device); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 371 | |
| 372 | protected: |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 373 | VkDeviceObj *m_device; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 374 | |
| 375 | }; |
| 376 | |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 377 | class VkDescriptorSetObj : public vk_testing::DescriptorPool |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 378 | { |
| 379 | public: |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 380 | VkDescriptorSetObj(VkDeviceObj *device); |
| 381 | ~VkDescriptorSetObj(); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 382 | |
| 383 | int AppendDummy(); |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 384 | int AppendBuffer(VkDescriptorType type, VkConstantBufferObj &constantBuffer); |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 385 | int AppendSamplerTexture(VkSamplerObj* sampler, VkTextureObj* texture); |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 386 | void CreateVKDescriptorSet(VkCommandBufferObj *commandBuffer); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 387 | |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 388 | VkDescriptorSet GetDescriptorSetHandle() const; |
Mark Lobodzinski | 0fadf5f | 2015-04-17 14:11:39 -0500 | [diff] [blame] | 389 | VkPipelineLayout GetPipelineLayout() const; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 390 | |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 391 | protected: |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 392 | VkDeviceObj *m_device; |
| 393 | vector<VkDescriptorTypeCount> m_type_counts; |
| 394 | int m_nextSlot; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 395 | |
Courtney Goeltzenleuchter | 4cb6d92 | 2015-10-23 13:38:14 -0600 | [diff] [blame] | 396 | vector<VkDescriptorImageInfo> m_imageSamplerDescriptors; |
Chia-I Wu | 9d00ed7 | 2015-05-25 16:27:55 +0800 | [diff] [blame] | 397 | vector<VkWriteDescriptorSet> m_writes; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 398 | |
| 399 | vk_testing::DescriptorSetLayout m_layout; |
Mark Lobodzinski | 0fadf5f | 2015-04-17 14:11:39 -0500 | [diff] [blame] | 400 | vk_testing::PipelineLayout m_pipeline_layout; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 401 | vk_testing::DescriptorSet *m_set; |
| 402 | }; |
| 403 | |
| 404 | |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 405 | class VkShaderObj : public vk_testing::Shader |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 406 | { |
| 407 | public: |
Courtney Goeltzenleuchter | d263550 | 2015-10-21 17:08:06 -0600 | [diff] [blame] | 408 | VkShaderObj(VkDeviceObj *device, const char * shaderText, VkShaderStageFlagBits stage, VkRenderFramework *framework); |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 409 | VkPipelineShaderStageCreateInfo* GetStageCreateInfo(); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 410 | |
| 411 | protected: |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 412 | VkPipelineShaderStageCreateInfo stage_info; |
Courtney Goeltzenleuchter | d263550 | 2015-10-21 17:08:06 -0600 | [diff] [blame] | 413 | VkShaderStageFlagBits m_stage; |
Courtney Goeltzenleuchter | d6079ec | 2015-04-22 10:09:35 -0600 | [diff] [blame] | 414 | VkDeviceObj *m_device; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 415 | |
| 416 | }; |
| 417 | |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 418 | class VkPipelineObj : public vk_testing::Pipeline |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 419 | { |
| 420 | public: |
Tony Barbour | 6918cd5 | 2015-04-09 12:58:51 -0600 | [diff] [blame] | 421 | VkPipelineObj(VkDeviceObj *device); |
| 422 | void AddShader(VkShaderObj* shaderObj); |
Courtney Goeltzenleuchter | fb4efc6 | 2015-04-10 08:34:15 -0600 | [diff] [blame] | 423 | void AddVertexInputAttribs(VkVertexInputAttributeDescription* vi_attrib, int count); |
| 424 | void AddVertexInputBindings(VkVertexInputBindingDescription* vi_binding, int count); |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 425 | void AddColorAttachment(uint32_t binding, const VkPipelineColorBlendAttachmentState *att); |
Courtney Goeltzenleuchter | 507ba97 | 2015-09-30 16:16:57 -0600 | [diff] [blame] | 426 | void MakeDynamic(VkDynamicState state); |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 427 | |
| 428 | void AddColorAttachment() |
| 429 | { |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 430 | VkPipelineColorBlendAttachmentState att = {}; |
Chia-I Wu | 08accc6 | 2015-07-07 11:50:03 +0800 | [diff] [blame] | 431 | att.blendEnable = VK_FALSE; |
| 432 | att.channelWriteMask = 0xf; |
| 433 | AddColorAttachment(0, &att); |
| 434 | } |
| 435 | |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 436 | void SetDepthStencil(VkPipelineDepthStencilStateCreateInfo *); |
Tony Barbour | 0ec8cd5 | 2015-08-06 09:27:11 -0600 | [diff] [blame] | 437 | void SetMSAA(VkPipelineMultisampleStateCreateInfo *ms_state); |
Tobin Ehlis | d332f28 | 2015-10-02 11:00:56 -0600 | [diff] [blame] | 438 | void SetViewport(vector<VkViewport> viewports); |
| 439 | void SetScissor(vector<VkRect2D> scissors); |
Tony Barbour | 5781e8f | 2015-08-04 16:23:11 -0600 | [diff] [blame] | 440 | VkResult CreateVKPipeline(VkPipelineLayout layout, VkRenderPass render_pass); |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 441 | |
| 442 | protected: |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 443 | VkPipelineVertexInputStateCreateInfo m_vi_state; |
| 444 | VkPipelineInputAssemblyStateCreateInfo m_ia_state; |
Chia-I Wu | 3432a0c | 2015-10-27 18:04:07 +0800 | [diff] [blame] | 445 | VkPipelineRasterizationStateCreateInfo m_rs_state; |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 446 | VkPipelineColorBlendStateCreateInfo m_cb_state; |
| 447 | VkPipelineDepthStencilStateCreateInfo m_ds_state; |
| 448 | VkPipelineViewportStateCreateInfo m_vp_state; |
| 449 | VkPipelineMultisampleStateCreateInfo m_ms_state; |
Courtney Goeltzenleuchter | 507ba97 | 2015-09-30 16:16:57 -0600 | [diff] [blame] | 450 | vector<VkDynamicState> m_dynamic_state_enables; |
| 451 | vector<VkViewport> m_viewports; |
| 452 | vector<VkRect2D> m_scissors; |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 453 | VkDeviceObj *m_device; |
| 454 | vector<VkShaderObj*> m_shaderObjs; |
Tony Barbour | dd6e32e | 2015-07-10 15:29:03 -0600 | [diff] [blame] | 455 | vector<int> m_vertexBufferBindings; |
| 456 | vector<VkPipelineColorBlendAttachmentState> m_colorAttachments; |
| 457 | int m_vertexBufferCount; |
Courtney Goeltzenleuchter | d8e229c | 2015-04-08 15:36:08 -0600 | [diff] [blame] | 458 | }; |
| 459 | |
| 460 | #endif // VKRENDERFRAMEWORK_H |