1 /* 2 * Copyright 2016 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef GrVkFramebuffer_DEFINED 9 #define GrVkFramebuffer_DEFINED 10 11 #include "GrTypes.h" 12 13 #include "GrVkResource.h" 14 15 #include "vulkan/vulkan.h" 16 17 class GrVkGpu; 18 class GrVkImageView; 19 class GrVkRenderPass; 20 21 class GrVkFramebuffer : public GrVkResource { 22 public: 23 static GrVkFramebuffer* Create(GrVkGpu* gpu, 24 int width, int height, 25 const GrVkRenderPass* renderPass, 26 const GrVkImageView* colorAttachment, 27 const GrVkImageView* resolveAttachment, 28 const GrVkImageView* stencilAttachment); 29 framebuffer()30 VkFramebuffer framebuffer() const { return fFramebuffer; } 31 32 private: GrVkFramebuffer(VkFramebuffer framebuffer)33 GrVkFramebuffer(VkFramebuffer framebuffer) : INHERITED(), fFramebuffer(framebuffer) {} 34 35 GrVkFramebuffer(const GrVkFramebuffer&); 36 GrVkFramebuffer& operator=(const GrVkFramebuffer&); 37 38 void freeGPUData(const GrVkGpu* gpu) const override; 39 40 VkFramebuffer fFramebuffer; 41 42 typedef GrVkResource INHERITED; 43 }; 44 45 #endif