Chromium Code Reviews| Index: src/gpu/vk/GrVkRenderPass.h |
| diff --git a/src/gpu/vk/GrVkRenderPass.h b/src/gpu/vk/GrVkRenderPass.h |
| index 082cccda776223d6240ef24b47a6be56b0579062..054f08e6a5ff766e1a6f8e8b19467fa72e975537 100644 |
| --- a/src/gpu/vk/GrVkRenderPass.h |
| +++ b/src/gpu/vk/GrVkRenderPass.h |
| @@ -21,25 +21,56 @@ class GrVkRenderTarget; |
| class GrVkRenderPass : public GrVkResource { |
| public: |
| GrVkRenderPass() : INHERITED(), fRenderPass(VK_NULL_HANDLE) {} |
| + |
| + struct LoadStoreOps { |
| + VkAttachmentLoadOp fLoadOp; |
| + VkAttachmentStoreOp fStoreOp; |
| + |
| + LoadStoreOps() |
| + : fLoadOp(VK_ATTACHMENT_LOAD_OP_LOAD) |
|
jvanverth1
2016/06/02 21:26:48
This means any time you create any of these struct
egdaniel
2016/06/06 14:14:58
Done.
|
| + , fStoreOp(VK_ATTACHMENT_STORE_OP_STORE) {} |
| + |
| + LoadStoreOps(VkAttachmentLoadOp loadOp, VkAttachmentStoreOp storeOp) |
| + : fLoadOp(loadOp), |
| + fStoreOp(storeOp) {} |
| + |
| + bool operator==(const LoadStoreOps& right) const { |
| + return fLoadOp == right.fLoadOp && fStoreOp == right.fStoreOp; |
| + } |
| + |
| + bool operator!=(const LoadStoreOps& right) const { |
| + return !(*this == right); |
| + } |
| + }; |
| + static const LoadStoreOps kBasicLoadStoreOps; |
| + |
| void initSimple(const GrVkGpu* gpu, const GrVkRenderTarget& target); |
| + void init(const GrVkGpu* gpu, |
| + const GrVkRenderTarget& target, |
| + const LoadStoreOps& colorOp, |
| + const LoadStoreOps& resolveOp, |
| + const LoadStoreOps& stencilOp); |
| + |
| + void init(const GrVkGpu* gpu, |
| + const GrVkRenderPass& compatibleRenderPass, |
| + const LoadStoreOps& colorOp, |
| + const LoadStoreOps& resolveOp, |
| + const LoadStoreOps& stencilOp); |
| struct AttachmentsDescriptor { |
| struct AttachmentDesc { |
| VkFormat fFormat; |
| int fSamples; |
| - VkAttachmentLoadOp fLoadOp; |
| - VkAttachmentStoreOp fStoreOp; |
| + LoadStoreOps fLoadStoreOps; |
| AttachmentDesc() |
| : fFormat(VK_FORMAT_UNDEFINED) |
| , fSamples(0) |
| - , fLoadOp(VK_ATTACHMENT_LOAD_OP_LOAD) |
| - , fStoreOp(VK_ATTACHMENT_STORE_OP_STORE) {} |
| + , fLoadStoreOps() {} |
| bool operator==(const AttachmentDesc& right) const { |
| return (fFormat == right.fFormat && |
| fSamples == right.fSamples && |
| - fLoadOp == right.fLoadOp && |
| - fStoreOp == right.fStoreOp); |
| + fLoadStoreOps == right.fLoadStoreOps); |
| } |
| bool operator!=(const AttachmentDesc& right) const { |
| return !(*this == right); |
| @@ -84,6 +115,10 @@ public: |
| // basic RenderPasses that can be used when creating a VkFrameBuffer object. |
| bool isCompatible(const GrVkRenderTarget& target) const; |
| + bool equalLoadStoreOps(const LoadStoreOps& colorOps, |
| + const LoadStoreOps& resolveOps, |
| + const LoadStoreOps& stencilOps) const; |
| + |
| VkRenderPass vkRenderPass() const { return fRenderPass; } |
| void genKey(GrProcessorKeyBuilder* b) const; |
| @@ -91,6 +126,11 @@ public: |
| private: |
| GrVkRenderPass(const GrVkRenderPass&); |
| + void init(const GrVkGpu* gpu, |
| + const LoadStoreOps& colorOps, |
| + const LoadStoreOps& resolveOps, |
| + const LoadStoreOps& stencilOps); |
| + |
| void freeGPUData(const GrVkGpu* gpu) const override; |
| VkRenderPass fRenderPass; |